Questions tagged [pygame]
A game development library based on the Python programming language. It wraps SDL for easy use alongside Python.
488 questions
1
vote
1
answer
712
views
How to get camera to follow car
i am making a top down racing game where the car progresses along the track, however i need the camera follow the car as it progresses through the track. I am unsure how to fix the error. I am new to ...
1
vote
1
answer
2k
views
How to Create a Perfect Dash (Quick Movement) in Pygame
I am trying to create 2d side scrolling platform similar to Megaman. Here is the progress so far:
Red box is the spriteholder while blue box is the hitbox of the character. The sprite I use is random ...
1
vote
2
answers
10k
views
Adjusting collision hitbox size with Pygame
So I coded a 2d sidescrolling platform, everything is fine except this:
As you can see, the sprite is standing at the platform when her feet is not in the platform anymore. I want to adjust the ...
0
votes
1
answer
419
views
How do I port a game which uses print-output to pygame font rendering with the least amount of work?
I've been working on a text based RPG. It's pretty simple, I'm not very experienced with Python, or any other language for that matter.
Edit: For context, I recently posted this question: Python 3: ...
5
votes
2
answers
2k
views
Simple 2D games - what is faster to render - images or drawing?
I am developing simple 2D environment in Pygame (Python 3.6), however I think this question is general. The environment is moving (player is rendered on the same position and everything else is ...
1
vote
1
answer
1k
views
How can I add 3D animation to my Pygame window?
I've developed a quiz game using Pygame but now I'm being asked to implement a 3D animation element (a game show host) to the game.
I used Pygame as I was told it would be an easy enough language to ...
3
votes
2
answers
3k
views
How to create custom methods for sprite groups in pygame?
I want to use sprite groups in my game using pygame and the default draw isn't enough. I have tried some tutorials but I failed.
So, being more specific: I want to create custom methods for sprite ...
1
vote
1
answer
238
views
Can somebody explain this behavior in pygame?
I have an image that I'm rotating and moving
And when the rotation angle is negative the image moves as expected.
But when the angle is positive it moves it's origing point to the left
Can anybody ...
1
vote
1
answer
86
views
Why is the position of this image changing?
I have a python script to simulate a wrench moving, I have calculated it's origins position in x and y as a function of time, the problem is when I try to rotate the image, my code moves the image out ...
1
vote
1
answer
89
views
Tile based game. Fixing surface issue for attack
So far I've loaded the images and can move the sprite around. When I hit the spacebar to cycle through the attack sprites within the attack_front list. The image ...
0
votes
0
answers
899
views
Using pygame on mac, strange errors
I am using pygame on a mac, and when the app runs, it draws a frame of the screen fine, and then crashes with the following error:
...
2
votes
1
answer
382
views
Flexible Controller Support
I am developing a platformer in Pygame with the eventual hope of releasing it on Steam.
I am currently trying to add input support for multiple controllers.
To do this, I am using the Pygame ...
4
votes
1
answer
573
views
Shooting function in pygame w/ 2 Players
I'm trying to program a shooting function in my game using pygame. Process:
Player one will press 'Space' and shoot their type of projectile
Player two would press 'E' and shoot their type of ...
1
vote
1
answer
2k
views
Handling Events & User Event Limits In Pygame
I am trying to make a vertical shoot em up using Python and Pygame. In order to handle timing, such as when certain enemies come out and other stage events, I've been using ...
1
vote
1
answer
218
views
Reflect Code Changes in a Current Run
I am developing a game in Python using Pygame. I am wondering whether there is a way to make changes to a currently running game by modifying the script (like Notch does in this clip).
For example, ...
2
votes
1
answer
6k
views
Implementing Jump in pygame
I have come across a problem in my code for my game. Currently i am developing a 2D platformer game in pygame. I have gotten the character to move left and right, although i haven't been able to get ...
0
votes
1
answer
418
views
Point inside a large polygon
I am just starting to get into using pyBox2D as I already knew python well and I was wondering if I have 500 points of a large polygon, how would I be able to check if a point lies inside of this ...
0
votes
1
answer
818
views
Choosing frame rate in PyGame with keyboard input
Using PyGame, I want to create a moving square which moves in a grid, controlled by keyboard presses of the arrows. So, pressing the "up" key moves the square to the cell directly upwards, pressing ...
-1
votes
1
answer
392
views
Collision Detection in Pygame
I'm making a game where the main character is a cat and has to avoid dogs and eat food. The collision detection works for the dogs and will subtract a bar of health from the cat, but when the cat ...
2
votes
2
answers
2k
views
How To Blit an Image onto Only Opaque Parts of a Surface?
I want to blit an image onto the parts of a surface that aren't transparent. I was wondering if there were a quick way to do this in Pygame. I want to be able to add effects to stuff.
I know that I ...
0
votes
2
answers
2k
views
In Pygame, why does my sprite only move each time the button is pressed?
As quite obviously stated in my title, why does my sprite only move each single time the key is pressed, (as opposed to moving WHILE the key is pressed.)
By the way, really sorry, you won't be able to ...
0
votes
1
answer
2k
views
How to only allow letters to be pressed on in pygame?
I want the user to press on any letter of the alphabet; it should block the input from the rest of the keys. How can I do this using pygame?
...
0
votes
1
answer
1k
views
Pygame moving rectangle
I am coding a snake game with pygame for Python 3.6 and wonder how I can make the snake move all the time, changing direction when buttons right, down, left and up pressed, like in the real snake game....
0
votes
2
answers
5k
views
Clearing screen in Pygame so content on the screen is not lost, but updated
I am creating a Tetris game using Pygame. It generates a random shape from a list and draws it onto the screen. However, when the arrow key is pressed by the user, it draws the shape again without ...
0
votes
1
answer
514
views