Pygame
These resources are split into two sections: (1) tutorial series and (2) reference notes.
Tutorial series
If you are new to pygame and are looking for a step-by-step introduction to using it. This series will guide you through creating a classic arcade style platformer game.
Pre-start
- Download and install the latest version of Python (currently 3.8.5) here - make sure you turn on the tick box to install Python into the path.
- Download and install VS code here
- Start VS code. Go to file / preferences / extensions. Search for and install the Python extension. Detailed instructions here if needed.
- Press Windows and X keys together, and select to open Windows Powershell (Admin). Type the command pip install pygame to install the Pygame library onto your system.
- Video walkthrough of installing Python, VS Code and how to install packages (though it is targeted to a different course so demonstrates installing packages different to Pygame)
1. Basic template, drawing on screen, movement
- Video: https://youtu.be/StJNBwpJmVs
- Initial template code: template.py
- End of lesson code: video1-rectangles-movement.py
2. Animated sprites
- Video: https://youtu.be/HGdmuylI56I
- Download the Kenney sprite collection
- Alternatively create your own sprites with PiskelApp
- End of lesson code: video2-player-sprites.py
3. Simple gravity
- Video: https://youtu.be/yufmuxkN7yY
- End of lesson code: video3-simple-gravity.py
4. Tiled map editor
- Video: https://youtu.be/cWtyxv4i-fQ
- Download and install the Tiled map editor software
5. Pytmx
- Video: https://youtu.be/1ruj8v3_ydM
- End of lesson code: video5-pytmx.py
6. Change our world view
- Video: https://youtu.be/AFO7J75ktks
- End of lesson code: video6-worldoffset.py
7. Standing on solid ground
- Video: https://youtu.be/lww89U1yZ6c
- End of lesson code: video7-ground.py
8. Solid walls and ceilings
- Video: https://youtu.be/XWsnIup4XlY
- End of lesson code: video8-walls-ceilings.py
9. Health and points
- Video: https://youtu.be/oqMqU1hB9xE
- End of lesson code: video9-health-points.py
10. Ladders
- Video: https://youtu.be/nK3ayRh0-8s
11. Achievements/objectives
- Video: https://youtu.be/uz8Jx1S8cW4
12. Portals
- Video: https://youtu.be/p5ixHSnvp5I
13. Sounds, music
- Video: https://youtu.be/1tDbZZid6l0
Resources for creative commons music and sound effects:
- https://soundcloud.com/
- http://freesound.org/
- https://www.buildbox.com/13-places-to-find-free-game-sound-effects/
- https://creativecommons.org/about/program-areas/arts-culture/arts-culture-resources/legalmusicforvideos/
Reference notes
If you don't really need a tutorial, just need a lookup reference to remind yourself how to use a particular pygame feature, then refer to the following document:
Other tutorials, digital books
- Build your own first person shooter in unity 140 pages, 11 MB
- Code the classics volume 1 224 pages, 38 MB - Includes Tennis games (eg: Pong), Action Platformer (eg: Bubble Bobble), Top-Down platformer (eg: Frogger), Fixed Shooter (eg: Centipede), Football (eg: Sensible Soccer).