Questions tagged [pygame]
A game development library based on the Python programming language. It wraps SDL for easy use alongside Python.
487 questions
0
votes
0
answers
67
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
150
views
Why does a sprite with a larger texture render faster?
While drawing a map for a game in Pygame, I encountered a strange problem. Loading my grass sprite, which is a little over a kilobyte, and placing it, the FPS dropped by half. However, replacing the ...
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
105
views
How do I create a shooting tool that works on both sides?
I am a fairly new user of pygame and i decided to start out with a simple but 'funny' game.
I have successfully implemented jumping mechanics, movement mechanics and a one directional shooting ...
0
votes
0
answers
71
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 ...
0
votes
1
answer
146
views
Can I Create a Camera System in Pygame Without Using Classes?
I am working on a basic side scroller platformer in Pygame. I want to add a camera system that tracks the camera and scrolls the world and I want to make the camera systems without using Classes. ...
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 ...
0
votes
0
answers
62
views
How to use sensors and ray casting for collision detection in Pygame (using a custom Mask/sensor class)?
I am making a Sonic game in Pygame and I have recently gotten my hands on a Python class that uses pygame.rect and pygame.mask in unison to create sensors that can be used to accurately detect the ...
1
vote
0
answers
88
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
1
answer
204
views
Score counter in Python game assigning points to both players
I am trying to learn to code a simple game with 2 players shooting at horizontal-moving enemies from the bottom of the screen.
Everything is working fine except for this:
When player 1 hits enemy ...
0
votes
0
answers
63
views
How to Make Circular Space After Collision?
How to make circular space after collision like this?
Before collision:
After collision:
I'am using PyGame
0
votes
1
answer
181
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
124
views
Reading steering wheel events has 180 degree dead zone. How to remove/reduce dead zone?
I'm making a GUI that can be controlled by a steering wheel. It need only run on Windows.
It works as expected with exception of the fact that the first 90 degrees in either direction seems to be ...
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
160
views
How to make a tilemap in pygame?
so I have some Python code to generate a random 10x10 grid in which a mine will be or won't be placed, I am having trouble trying to convert this list into a use-able set of coordinates. Any help ...