Skip to content
Advertisement

Tag: pygame

How to fix Clock? For Chess. Python

I’m creating a Chess clock for my chess project. In chess there are time formats 5|5 is where each player (white and black) is granted a general 5 minutes, so when either player makes a move it adds 5 seconds to the clock. So 15|10 is 15 minutes in general and 10 seconds per move. My code: The issues I

How to run multiple while loops at a time in Pygame

I’m trying to work on a simple Pygame program for a project that simply displays some faces and talks in a text to speech voice, but there is a while loop at the end that is necessary for the code to run but blocks another while loop that I need for the program from running. The while loop I’m trying

Why is nothing drawn in PyGame at all?

i have started a new project in python using pygame and for the background i want the bottom half filled with gray and the top black. i have used rect drawing in projects before but for some reason it seems to be broken? i don’t know what i am doing wrong. the weirdest thing is that the result is different

‘event’ has no “key” attribute

** this is a part of a code ** ** error shows that: 38, in _cheak_events elif event.key == pygame.KEYDOWN: AttributeError: ‘Event’ object has no attribute ‘key’ Answer Replace all event.key with event.type

Advertisement