CAS Community   >   Resources   >  

Pygame tutorial - step by step - covering all the functionalities

A pygame tutorial, starting with drawing shapes, images, collision, levels and music

GowriR GowriR

Created by GowriR GowriR
last edited May 05 2017 by GowriR GowriR

A pygame tutorial for beginners covering all aspects on pygame.

The tutorial has 19 parts to it:

Part 1 – pygame building blocks Part 2 – Part 2 – Draw shapes Part 3 – Draw shapes at random positions on the screen Part 4 – Events – Draw the circle wherever the mouse is clicked Part 5 – Events- Change the colour of the circle on space key press Part 6 – Events – Change colour on key press and draw circles on mouse movement Part 7 – Events- Draw circles of different colours at the mouse position on space key press Part 8 – Move the circle (up, down, left and right) on key movement Part 9 – Add support for WASD keys too Part 10 – Detect collision Part 11 – OOP Introduced – Detect collision for multiple objects Part 12 – Objects as pygame Sprites Part 13 – More sprites – Cannons and rockets together! Part 14 – Collision of cannons and rockets Part 15 – Part 15: Changing the cannon balls to ball images Part 16 – Game over screen Part 17 – Store scores! Part 18 – Add some music and add some spice! Part 19 – Add levels, the last leg – using nested lists in python

All of this is posted on and the git hub repository at has the entire code with two additional tile based games:

Memory game – Tile based game where you remember the numbers displayed and find pairs. Just10 – Tile based game to form pairs of numbers adding up to 10

Level: (Intermediate/ Advanced)

Duration: (40 hrs)

Teaches: (pygame, python, OOP)

Feedback and Comments

Available when logged in (join via the front page, for free):
  • View 0 comments on this resource.
  • View resource history, links to related resources.
  • Leave feedback for the author(s), or help by editing the resource.