Code Angel Alien Invasion - a free Python game project

Alien Invasion

Earth is under attack from alien spacecraft, and there’s only one line of defence remaining. It’s down to you to stop the alien invasion and save the planet.

Learn to code the Alien Invasion arcade game in Python. This free Python game project includes all of the code, images and audio files required.

Starter Code Files

Download “Starter Python File: Alien Invasion” File size: 237 B

Download and unzip this starter Python code file to your Alien Invasion project folder

Images and Audio

Download “Images and audio for Alien Invasion” File size: 97 KB

Download and unzip these image and audio files to your Alien Invasion project folder

Book of Code

Download “Book of Code: Alien Invasion” File size: 510 KB

Copy the Alien Invasion Python program from the Book of Code into your IDE

Video Tutorials

1. Integer variable: missiles

An integer is a whole number. An integer variable is a variable which stores a whole number. This tutorial shows how the missiles integer variable is used in Alien Invasion.

Watch first: Snapper Integer Variables 2

Difficulty: 1

2. Coordinates

In this tutorial you will learn how to use Pygame’s coordinate system to display images on the screen.

Watch first: Forest Bomber Displaying Images

Difficulty: 2

Buy the book

Alien Invasion is one of the four games covered in the book Game Programming with Code Angel, available on Amazon now.

3. And

Learn how to use the Python and operator to build more complex if statements.

Watch first: Snapper Elif and Else

Difficulty: 3

4. Strings

A string is a sequence of characters. In Python, a string is created by enclosing the characters in quotes. Find out more about the use of strings in Python in this video.

Watch first: Alien Invasion missiles variable

Difficulty: 2

5. Random choice

Learn how to use Python’s random.choice() function to decide a new random direction for the UFO in Alien Invasion.

Watch first: Forest Bomber Lists

Difficulty: 3

6. Key Press

In this video tutorial you will learn how to handle a keypress in Pygame.

Watch first: Snapper Elif and Else

Difficulty: 4

7. Collisions

Detecting and handling decisions is an crucial aspect of game programming. In this video we will explain how to detect a missile collision with a UFO.

Watch first: Alien Invasion Coordinates

Difficulty: 4

8. UFO Dictionary

A Python dictionary is a way of storing data items. Each dictionary item also has a key to identify it.

In this tutorial you will learn how to use a dictionary to store the data relating to each UFO in Alien Invasion.

Watch first: Snapper Dictionary

Difficulty: 4

9. Move UFO Logic

In this tutorial we will take a closer look at the logic behind the movement of the UFO.

Watch first: Snapper Random Randint

Difficulty: 5

10. Parameter Passing

In Python a parameter is a variable which is declared within a function definition. This tutorial explains more about Python parameters and how they are used within Alien Invasion.

Watch first: Snapper Functions

Difficulty: 5

Kindle Paperwhite | Waterproof, 6″ High-Resolution Display, 8GB Black, available on Amazon