Skip to Content

How to Program a Simple Space Shooter Game

How to build a simple space shooter game.

When the green flag is clicked enemies (in my game basketballs) randomly fall from the sky. A variation you could easily add would be enemy ships running patterns in random order. You control a base ship that moves back and forth with the arrow keys on the bottom and uses the space bar to fire a laser. If the laser hits the enemies you score a point. If the enemies fall on you before you shoot them you loose a life. If you loose three lives the game is over. There are sounds when you fire your laser or are hit by an enemy ship.

Fran Lucena

An excellent tutorial, I'll do in class with my students. Tranks! 

John Kendall

This PDF is very helpful for a classroom situation.  Thanks!


Did you post the actual game, yet?  I can't seem to find it.  If you have, could you send me the exact address?


John Kendall

Rutgers Prep, Somerset, NJ