~ How to do various things in Pygame - main menu, score, timer, next level, background and more...

How to do X,Y,Z in Pygame and Python - Teach yourself Python - quick guide

Going through the creation of various features for a complete game in Pygame

Before you delve back in to Object Orientated Programming, it is useful to know how to create all the functions and write code that does various things in pygame - for instance - how do you draw things on the screen, add a score variable, create a main menu screen, add a next level feature or a timer. The following pages and code solutions will show you how!

This series will go through the following:

  • -Game set up
  • -Creation of a new player and additional (e.g. enemy) players
  • -Movement of player(s)
  • -Collision detection (screen, range and enemy collision)
  • -Creating and adding a background
  • -Creating a "health ball" and collision detection
  • -Creating a score variable that display on the screen in pygame
  • -Creating a "Game over" feature in Pygame
  • -Creating a Timer feature in Pygame
  • -Creating a Main Menu Screen in Pygame
  • -Addition of a High Scores feature in Pygame - writing the scores of each player to a file

Video Demo

This particular series will give you the actual functions to create the above mentioned features. Look ahead to see how this same game is created using OOP and Classes. You'll notice the significant improvement in terms of efficiency and organisation of code.

All the best!