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.
Tag: pygame
The draw polygon function in pygame doesn’t draw the correct amount of vertices
I am trying to create a function that draws a random triangle on the screen. I need to make sure that the triangle is at least somewhat on the screen (although it doesn’t have to be fully on the screen). First I choose a random point with the range of the random numbers being the bounds of the screen, and
Is it possible to run game made with pygame on browser using pyscript?
I have made a small space invader game using pygame and I was wondering if I could play it on the browser using pyscript. Is this even possible ? Do I have to rewrite everything ? Answer No, Pygame is not supported in PyScript at this time. I’m not sure what is the best way to find out what packages
getting the current color of the visible pixel in the pygame module
I am using PYgame to create an environment with multiple cars. etch car has its own radar where it can check the distance between obstacles. the problem that I am having is, how to get the color of a pixel. so if a moving car has the color purple and it is currently over the [x,y] Pixsle I will get
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
How to code a menu bar across your Pygame project
I have been struggling with merging my code. I am creating an arcade game on Python and have a main file where I have an image and clickable assets which link to a game I have imported. Now I am working on creating constant features in the game, including a menu bar which displays reminders, can change the volume and