Skip to content
Advertisement

Tag: pygame

How to make fighting game command inputs in PyGame

I am currently making a fighting game and was wondering how command inputs could be added. I understand it is kind of irrelevant and many substitutes are possible, but it would be nice to use familiar fighting game inputs. I currently have something like this: The “commandcount” helps keep the window of action available until a certain amount of time.

pygame sprite move faster if window is smaller

my character sprite moves faster if my game is in window mode. to set the velocity i used ROOTwidth, in theory the velocity should be scaled… this is my code (simplified) I don’t know what to do… for every element in my game, using ROOT dimensions works fine, only in velocity I have problems Answer I guess it might be

How to draw rectangles from a list in pygame

It says rect argument is invalid but when I give the same rect without a variable it works, here is the part of a code responsible for it I also tried self.obstacleses(0) in pygame.draw.rect but then i get list object is not callable. Answer You have to draw the rectangles in a loop:

Pycharm Window Not Displaying Correctly

I followed a Youtube tutorial for creating a Chess engine in Python code for code but it will not work in Pycharm? I can see that the correct chess board has been created but only when I close the pop-up window. Initially it shows as a black screen, then when I close the window it briefly appears before shutting as

How Do You Add A Replay Button To A Game?

Im trying to make a replay button for my game where when you die the game pauses until you press the space bar which resets the game so you can play again. I’m using python with pygame. If you can fix this, please do! It would make my day. If possible, please include the code for the fix and where

Python AttributeError When Attribute is Set

I am creating a snake clone using pygame and I am running into a strange problem. I have a class called snake_tile that inherits from the pygame rectangle class with one additional attribute, the direction the tile is moving: I pass in a tuple as the direction when initializing the snake_tile object: Which will serve as the offset when I

Advertisement