software
First 2D Game (Pygame)
First 2D game built with Python and Pygame: an animated character that walks and jumps across a background, as an introduction to game loops and sprite animation.
Role
Developer — learning project
Problem
Learning project for core 2D game-development concepts: the game loop, keyboard input, sprite animation, and simple jump physics.
Tech Stack
PythonPygame
How It Works
- 01A single main.py opens an 800x600 window and runs the game loop at 30 FPS: handle the quit event, read held keys, update the player, redraw the frame.
- 02The left and right arrows move the player at a fixed speed, stopping at the window edges. Space starts a jump that rises and falls in a smooth arc.
- 03Each redraw paints the background, then either picks the next walking frame for the current direction or shows a standing sprite when the player is idle.
What I Learned
- –First time implementing a game loop, sprite animation, and jump movement from scratch instead of using a higher-level game engine.
- –Advancing the walk animation every third frame made the link between frame rate and animation speed concrete.