Python Game Development I: Intro to Game Dev with pygame-ce
Build, polish and share your first 2D games
About this course
Your first games in Python: the game loop, drawing, input, vectors and angles, images and sprites, collisions, sound and animation, ending with a capstone arcade game you put on the web for friends to play.
Who it is for: You finished an intro Python course (variables, loops, functions, lists, dictionaries) and want to make games. No classes needed yet: this course introduces them in the Vectors lesson, when your game objects first need them.
Before you start
This course assumes:
Setup: install Python 3.10 or newer, then run pip install pygame-ce in a terminal. Lesson 1 walks through it.
Modules
Each module is one three-hour session: instruction, guided practice and a lab you can finish at home. Teaching it in a classroom? See the 7-session instructor-led syllabus (PDF).
-
Module 1: Your First Game Window (2.5 h)
Open a window, run a real game loop with delta time, and draw shapes, colors and Surfaces.
- Lesson 1: The Game Loop 1 h 30 min
- Lesson 2: Drawing Shapes & Surfaces 1 h
-
Module 2: Input & Screen Space (3 h)
Read the keyboard, mouse and gamepads, and learn how screen coordinates, world coordinates and a camera offset relate.
- Lesson 3: Keyboard, Mouse & Gamepad 1 h 45 min
- Lesson 4: Coordinate Systems 1 h 15 min
-
Module 3: Vectors & Angles (3.5 h)
Move things with pygame.math.Vector2 and float positions, then aim, rotate and orbit with trigonometry.
-
Module 4: Images & Sprites (3.25 h)
Load and transform images, organize game objects as Sprite classes in Groups, and cut frames from sprite sheets.
- Lesson 7: Images & Sprite Classes 1 h 45 min
- Lesson 8: Sprite Sheets 1 h 30 min
-
Module 5: Collisions & Sound (3.5 h)
Detect and resolve collisions with Rects, FRects and circles, and add sound effects and music.
- Lesson 9: Collision Detection 2 h
- Lesson 10: Sound & Music 1 h 30 min
-
Module 6: Animation & Capstone Kickoff (3.25 h)
Animate sprites with dt-based frame timing, then design your capstone game and build its core loop.
- Lesson 11: Sprite Animation 1 h 45 min
- Lesson 12: Capstone Part 1: Design & Core Loop 1 h 30 min
-
Module 7: Finish & Share (3 h)
Polish and playtest your capstone, then put it on the web with pygbag and share a source zip.
- Lesson 13: Capstone Part 2: Polish & Playtest 1 h 30 min
- Lesson 14: Share Your Game (pygbag + zip) 1 h 30 min