Questions tagged [pygame]
Pygame is a set of Python modules designed for writing video games.
Use this tag only if you are using the Pygame library and not if you have a question about programming a game in Python in general.
I am currently coding a simple game using the pygame library with python. Is it possible to make this game a chrome extension considering pygame must be downloaded via a pip install command? I'm aware ...
I am newbie to Python and I am trying to develop a small game. I have an app class and buttons class and I would like to get the value of the button clicked and add it to the selected position on the ...
I have an entirely work code cause i ran it in Windows 10. I use Pycharm with Python 3.7. There are a virtual environment and i download all of libraries for this project successfully. Can ...
I have a simple script that is checking whether there is a pop-out message on the site, if there is it will click it and then play music. I tried with many libraries but only pygames mixer worked for ...
I already did a jumping system which is working, but i have to do one using mecanics.
At the moment my character never come back to the ground.
Here is my code :
It's a function that got Ghost to follow player, but I don't understand.
I want to know the meaning of the code.
def followPlayer(g, dirs):
d = ghosts[g].dir
if d == 1 or d == 3:
New to programming.
I have tried all sorts of solutions to my pygame.error: Couldn't open background.png issue to no avail. I have narrowed it down to the png files not being in the same folder as the ...
In my main loop I add health for the enemy. If I keep hitting the enemy and the health drops to 0, the enemy should disappear (enemys1.visible = False).
I ran the visible variable on my enemy class ...
I made the ghost move randomly.
But I want to know that instead of moving around in a random way, four Ghosts can track the player.
What can I do?
I'm trying to make a simple game where, given some condition, the vision field of the character (always at the center of the screen) gets radially reduced until it totally closes and the game ends. ...
I'm using pygame's MIDI module to collect a list of available MIDI input devices.
I'm using a method inside a custom-built class to generate this list like so:
I am trying to make my bullets collide with my enemy and then dis-pear but it just passes throw them for some reason
for bullet in bullets[:]:
if bullet.y + bullet.x < enemys1.hitbox...
what is wrong with this ?
i have watched tutotials but i still cant figure the one out
i want a hitbox to appear, am i doing it wrong or is it an easy fix
i made a class and defined draw, and now i ...
This is the original question:
As shown above, I need to print a blue screen. This is what I did:
blue = (0, 0, 255)
size = (width, height) = (640, 640)
screen = ...
I'm making a game where a spaceship shoots at aliens. The problem is that when I call the shoot function twice I don't get two projectiles, but one get destroyed. I think I have to store the two ...