Skip to content
Advertisement

Tag: pygame

Attribute Error: List object has no attribute CheckClick

In the Swap function, I am checking under some index a button class instance, which I checked using print statements, but for some reason it still gives me an error saying that it has no such attribute check click. Any tips on formatting are also welcome, I am just a beginner. I am using three different arrays to hold various

What does ”event.pos[0]” mean in the pygame library? I saw an example using it to get the X axis of the cursor and ignore the Y axis

I don’t understand how it works. I don’t know if I understood the purpose of this function wrong. I tried to search what posx=event.pos[0] means but all I found was that if you want to take x, write the code of posx,posy=pygame.mouse.get_pos() and then take posx. But I still can’t understand the method he followed in the example I saw.

Python/Pygame : “pygame.error: display Surface quit”

So, I’m making a game project, and I decided, for once, to make a custom class for my pygame window, like so : And, in the gameloop, I decided to make an instance of this class, and to call the method, like so : But when I try to run the main loop, it gives me this error message (that

Advertisement