pygame

new with pygame. My button doesnt work. why? [duplicate]

坚强是说给别人听的谎言 提交于 2021-02-05 12:23:26
问题 This question already has answers here : How do I detect if the mouse is hovering over a button? PyGame button class is not displaying the text or changing colour on hover (1 answer) How to detect when a rectangular object, image or sprite is clicked (1 answer) Closed 2 months ago . Ignore AmountOfPlayers() function. Im new with pygame and my button doesn't do anything. why? How can I improve my code with pygame? while True: pygame.init() size=(1440,810) screen = pygame.display.set_mode(size)

python pygame mask collision [closed]

纵饮孤独 提交于 2021-02-05 12:20:50
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed last year . Improve this question when I try to use this piece of code, it only works for 1 object, not for every. I'm trying to modify code from this video (https://www.youtube.com/watch?v=Idu8XfwKUao). Is there is a simpler way to get a result ?.If there is,please let me know #part of code that doesn't matter

How do I get the value of an entry and enter it in Ssol.txt? [duplicate]

让人想犯罪 __ 提交于 2021-02-05 12:17:34
问题 This question already has answers here : Get contents of a Tkinter Entry widget (3 answers) Closed 3 years ago . from tkinter import * from tkinter import ttk win = Tk() win.title("hello") win.geometry('510x50+200+100') Block = IntVar() def x(): k = open("Ssol.txt", 'w') Entry(win, width=5, textvariable=Block).grid(column=1, row=0,sticky=(N,W,E)) ttk.Button(win, text="실행", command=x).grid(column=0, row=1,sticky=(W,E)) mainloop() I want to get the value of entry and input it in Ssol.txt. def x

Python and PyGame Error Code 134: Cannot figure out why

浪尽此生 提交于 2021-02-05 11:20:43
问题 Every time I run my code on Windows it works. I have installed pygame on Mac with Homebrew and the same program doesn't work. Other programs work on Mac with pygame, just not mine. Here is the error I get: 2015-01-17 15:09:41.591 Python[1237:51113] -[SDLApplication _setup:]: un recognized selector sent to instance 0x105d271e0 2015-01-17 15:09:41.607 Python[1237:51113] An uncaught exception was raised 2015-01-17 15:09:41.607 Python[1237:51113] -[SDLApplication _setup:]: unrecognized selector

pygame.error: File is not a Windows BMP file (continuation of the problem)

烈酒焚心 提交于 2021-02-05 11:13:51
问题 I have recently started using Mac for coding. Thus, I had to move all my files from my previous computer (Windows). Long story short, everything was good until this error occurred. pygame.error: File is not a Windows BMP file I checked Stackoverflow and found this question with the explanation of how to resolve the problem. How to uninstall pygame on mac OSX 10.9.4 But still nothing. I use python3, however, python 2.7 was installed on my computer initially (Idk how) and I checked so that my

pygame.error: File is not a Windows BMP file (continuation of the problem)

时光怂恿深爱的人放手 提交于 2021-02-05 11:13:13
问题 I have recently started using Mac for coding. Thus, I had to move all my files from my previous computer (Windows). Long story short, everything was good until this error occurred. pygame.error: File is not a Windows BMP file I checked Stackoverflow and found this question with the explanation of how to resolve the problem. How to uninstall pygame on mac OSX 10.9.4 But still nothing. I use python3, however, python 2.7 was installed on my computer initially (Idk how) and I checked so that my

PyGame NotImplementedError

爷,独闯天下 提交于 2021-02-05 11:12:01
问题 I made a pygame application using PyInstaller but for some reason when I open it it raises the NotImplementedError, if found out that this error is being raised in the _has function on line 1663 of init .py in pkg-resources but i'm not sure why its being called. I tried to trace it back as far as I can and so far i cant find and connection between pkg-resources and pygame. The exe worked with the previous version, which didn't include text so i tried importing pygame._view but that didn't

PyGame NotImplementedError

允我心安 提交于 2021-02-05 11:05:48
问题 I made a pygame application using PyInstaller but for some reason when I open it it raises the NotImplementedError, if found out that this error is being raised in the _has function on line 1663 of init .py in pkg-resources but i'm not sure why its being called. I tried to trace it back as far as I can and so far i cant find and connection between pkg-resources and pygame. The exe worked with the previous version, which didn't include text so i tried importing pygame._view but that didn't

PyGame NotImplementedError

混江龙づ霸主 提交于 2021-02-05 11:05:45
问题 I made a pygame application using PyInstaller but for some reason when I open it it raises the NotImplementedError, if found out that this error is being raised in the _has function on line 1663 of init .py in pkg-resources but i'm not sure why its being called. I tried to trace it back as far as I can and so far i cant find and connection between pkg-resources and pygame. The exe worked with the previous version, which didn't include text so i tried importing pygame._view but that didn't

I am wondering why it says the distance has to be less than 27? Why less than 27? Where is 27 coming from?

有些话、适合烂在心里 提交于 2021-02-05 10:50:48
问题 My teacher gave us this code to analyze and I am not sure why he put 27 there for collision.. I asked him he said if the distance between the player and the enemy is less than 27 then I will call it a collision, but I still don't understand, can someone please kindly explain it to me in simpler terms. I don't understand where the number 27 comes from.. when my dimensions are so big? import math import random import pygame # Intialize the pygame pygame.init() # create the screen screen =