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.
18,833 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Unanswered (my tags)
How to fill a specific area with a certain color?
So I want to figure out to only fill the bottom part of my background green. However, since I just started Pygame I don't actually know what code there is for filling in backgrounds except for screen.... pygame
Blu
- 13
Pygame zooming screen
im writing a game right now with 32x32 textures, i have a problem because my screen window is too small, is there any solution? Can i "zoom" my whole game? Now it looks like this and exactly ... python pygame camera zooming
Yoshow2137
- 31
Pygame delete non sprite objects
So Im trying to make an upward scrolling platformer, and I need a way to delete the score counter and hide the death screen when a player dies and restarts. However, those objects aren't sprites. Is ... python pygame 2d-games
DatDerpyDude81
- 11
How can i move the character up and down? [duplicate]
enter image description here from sys import exit pygame.init() screen = pygame.display.set_mode((500,500)) name = pygame.display.set_caption('witchie') icon = pygame.image.load('C:\\Users\\lenovo\\... python pygame
Precious Candy
- 1
Conveyor belt kinematics Python
I'm trying to create a simulation for a conveyor belt with objects on it, to see how the behaviour would be. I am playing around but struggling with the functionality of the conveyor belt. Right now, ... python pygame simulation pymunk kinematics
Ruben Vreugdenhil
- 1
Create trails of paticles for the bullets
I'm creating a space shooting game in which a spaceship will fire out bullets every time the user clicks the left mouse and since I want the bullets to be a bit fancier I want them to have a trail of ... python pygame effects
no DHC
- 11
Can someone please explain this, please? [closed]
I'm using the pygame import in python, and it keeps telling me that I added an unneeded argument. Here is the code for the rectangle class: class Rectangle: x = 0 y = 0 width = 60 ... python pygame
KjAnimates
- 1
Speed is reduced substantially when writing to serial port
Using pygame to read info from controller, but when I add arduinoData.write(str.encode(ALL_DATA)) it reduces the speed a lot, what can I do? The line is added almost at the bottom. Is it the placement ... python pygame pyserial
Some Student
- 43
button is unresponsive and does not exit when clicked in pygame, is my code incorrect? all it does is display the button [duplicate]
if quit_button.draw(screen): pygame.quit() exit() in my window, the button is displayed but when clicked it doesn't close the window, did I do it wrong? python python-3.x pygame pygame2
rnsleep
- 9
when i run the code using pygame module it's terminal closes I use VS Code i cant understand the problem [duplicate]
The problem I am facing is in the image. I don't understand why is I not working? import pygame pygame.init() dis=pygame.display.set_mode((400,300)) pygame.display.update() pygame.quit(... python visual-studio-code terminal pygame terminology
Rudransh Joshi
- 1
pygame keeps keys pressed even after a new start of the game
I have a strange behavior with when using pygame. [...] pygame.init() screen = pygame.display.set_mode((WIDTH, HEIGHT)) [...] while running: [...] dt = (new_time - start_time).total_seconds() ... python pygame
ZenCoding
- 95
Failed to execute script error after successful execution exe
I am trying to create an exe file for my pygame game with pyinstaller. The command I am using is pyinstaller --noconsole 2d_minecraft.py. It creates the dist folder successfully. I am getting this ... pygame pyinstaller exe fatal-error
coder
- 65
Running into errors with pygame.image.fromstring() arguments
I would like to be able to display a PIL image object created from a numpy array of 8 bit integers (essentially just a grayscale image) using pygame, but have been running into several errors in the ... python numpy pygame python-imaging-library
JBowers
- 23
Character doesn't show up and I also get this message: TypeError: invalid destination position for blit
Console: pygame 2.1.2 (SDL 2.0.16, Python 3.8.12) Hello from the pygame community. Traceback (most recent call last): File "main.py", line 96, in <... python pygame
b.ferris
- 3
Collision betwen two same sprites but with diffrerent reactions
I have a small problem with my code. The goal is to simulate traffic (two lanes merging into one). I am close to finishing but i have the problem that when a car hits a car of the same Group the whole ... pygame sprite simulation collision
Jrmnp
- 25
153050per page