Questions tagged [pygame]
A game development library based on the Python programming language. It wraps SDL for easy use alongside Python.
488 questions
0
votes
0
answers
61
views
Applying greyscale shading to objects in a Python 3D renderer
I need help with how to apply greyscale shading to objects in a 3D renderer I made in Python. The code is pasted below:
...
0
votes
0
answers
21
views
How do I make smooth 2 way shooting in pygame? [duplicate]
I have been trying many thing to make my code work to make a player shoot a small box both ways (left and right) without being able to change the direction of the projectile mid shot.
I would be very ...
0
votes
0
answers
70
views
Pygame won't display volume control
I'm making a game in Pygame running in Python 3.10 and the lastest version of pygame, and I can't get to display a volume control for the background music . The music is played correctly, but there is ...
1
vote
1
answer
94
views
Pygame display.Info() / fullscreen not working under Linux
I am experiencing some issues with pygame.display.Info() and the FULLSCREEN property on Linux. The game is displaying at roughly ...
1
vote
0
answers
87
views
How to handle collision events in games with multiple interactive objects?
I'm developing a 2D game where multiple types of objects interact with each other through collisions. Currently, I'm using pygame.spritecollide() to detect ...
0
votes
0
answers
100
views
Torch light effect
I want to implement a torch with in my pygame platformer, I don't know how to do it and so I need help on that. I have the lamp image, all I need is the light around a certain area of the lamp.
0
votes
1
answer
178
views
How can I improve vector collision algorithm?
I'm making a game (shocker) in pygame and had issues with tile-based collision detection. There are 5 different non-empty tile types (pictured below) which can be rotated in increments of 90 degrees ...
1
vote
1
answer
117
views
Connecting Isolated Paths in Randomly Generated Maps
I am new to game development, I previously created games using tiledmap editor and pygame, but manually creating map was real pain, so i begun to look how can i procedurally generate map, after ...
0
votes
0
answers
66
views
How can I change checkers pieces to move only horizontally and vertically?
I am a beginner level programmer trying to learn Python. I could not figure out how to change the values so I can restrict the pieces of checkers from moving diagonally. I want them to be able to move ...
1
vote
1
answer
88
views
Player not sliding on the side of a wall when two keys are pressed
I am making a game right now, and I am working on collision for different Rect walls (all of their data is stored in a list). It works great, except for one problem:...
2
votes
2
answers
191
views
How to stop moving a sprite if the user is holding down the opposing moving key at the same time?
I am new to creating games with graphics, and I want to make a very hard game. I have the movement down, but it has a weird bug where it if the user presses down the opposing movement key (i.e. A is ...
0
votes
2
answers
322
views
Infinite scrolling with mouse
I know we're able to scroll a background image hardcoded or using awsd keys(or arrows) if they're pressed. But what about scrolling it with mouse movement? So I have a piece of panoramic image as a ...
0
votes
1
answer
105
views
Sprite chasing a target using move_towards_ip does not move
I'm trying to get a turtle sprite to chase a falling algae sprite utilising Pygame's inbuilt functionality. I have spent many hours reviewing questions and answers and suspect I'm missing some ...
1
vote
1
answer
108
views
Selecting Tiles Correctly With Scroll
I would like to understand the process of selecting the correct tile from a scaled Surface when I have information about the number of tiles on the x and y axes, the length of the Surface, and also ...
0
votes
1
answer
150
views
Client and server with fixed tick in pygame
I'm trying to write a 2D RTS game with maximum of 10 players.
When server finish intializing each player receives start coordinates and game start time so each client will start processing ticks ...
0
votes
1
answer
353
views
PyGame moves object in one direction but not in the opposite one
I'm having trouble with a PyGame animation I'm writting. I have a Ball class that defines an object that moves on the screen and bounces on the edges. I initialize ...
0
votes
1
answer
90
views
Why doesn't the fire appear when moving code to a function?
This is my code:
...
1
vote
0
answers
249
views
Why don't people use try-finally to call pygame.quit() in pygame programs?
I've seen several games made in Pygame, and none of them uses try/finally to call ...
0
votes
1
answer
911
views
How to get better performance with pygame?
I'm not a gamedev, I'm a API/Cloud dev, performance has never been an issue for me since most of the time we are limited by network calls.
I've been playing with that for the past 2 days, I wanted to ...
0
votes
1
answer
646
views
for event in pygame.event.get(): pygame.error: video system not initialized
I'm going through a tutorial and trying to build a game using Python and struggling to resolve below error. Not sure what I'm missing here can someone help with it
Alien_invasion.py
...
0
votes
1
answer
970
views
Having trouble trying to figure out why pygame.sprite.Group's draw method isn't working properly, but switching to player sprite does work
Goal, Description & Scope (when encountered issue)
I was building a testing script to see how implementing different ideas (event handling, update handling, draw method) to loading sprite images, ...
0
votes
0
answers
24
views
Find which tiles are intersected between two points on an isometric tilemap [duplicate]
I need to be able to find out which tiles are intersected when a line is drawn between two points.
I'm currently working with a isometric perspective which makes things a little more complicated.
I've ...
0
votes
0
answers
84
views
Game window freezes whenever enter is pressed on textbox
I recently programmed a game in Pygame and added a text box (which I made using pygame_gui) which will send data directly to a MySQL database. But whenever I type ...
0
votes
0
answers
440
views
2
votes
1
answer
5k
views
Creating a nav mesh
I'm coding a custom engine using Python and Pygame. It's a top down 2D isometric RTS and I wan't to implement pathfinding for my units.
My research has lead me to using a Navigation mesh which seems ...