Video Tutorial: Simple Space Invaders Clone

I was a child when Space Invaders came out in 1978 and I can still remember playing it at the bar my dad used to frequent, the Conewago Inn. Space Invaders is one of the classic arcade games, along with Pacman, Donkey Kong, Frogger and other games of that era.  It is also one of the simplest and a good candidate for a tutorial.

Game play is rather simple, you are a lone defender defending your planet from hordes of space invaders.  The invaders move left and right on the screen - when one invader reaches a border, all of the invaders drop down one row towards the planet.  You have a weapon that can only be fired once at a time.  The game also includes barriers, a special ufo that comes out randomly, and the invaders can also shoot their weapons at you. 

The Program

We will be making a very simple version of Space Invaders with the player, and a number of invaders.   As this tutorial is aimed at beginners, we will not be using any advanced features such as classes - that will have to wait for a future tutorial.  

Here is what your finished output will look like:

Space Invaders Screenshot

Please watch the video introduction here.

The Tutorial

The tutorial is in 10 stages as follows:

STAGE I: VIDEO / CODE

  • Create the screen and player.

STAGE II: VIDEO / CODE

  • Move the player left and right using the arrow keys.

STAGE III: VIDEO / CODE

  • Create the enemy invader and move it left, right, and down.

STAGE IV: VIDEO / CODE

  • Create the player bullet and fire it with the spacebar.

STAGE V: VIDEO / CODE

  • Register collisions between the bullet and invaders and the invaders and player.

STAGE VI: VIDEO / CODE

  • Add multiple enemies using loops and lists.

STAGE VII: VIDEO / CODE

  • Move all enemies down at the same time (using nested loops).

STAGE VIII: VIDEO / CODE

  • Add a scoring system to our Space Invaders game.

STAGE IX: VIDEO / CODE

STAGE X: VIDEO / CODE

I hope you find this useful.  If so, please comment on the YouTube videos, subscribe to my YouTube channel, and follow me on Twitter (@tokyoedtech)

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.

@TokyoEdTech

Poll

What LMS does your school use?: