👾 SPACE INVADERS

Twenty-four aliens, three lives, and one bullet at a time

← Back to Fun Time
Score
0
Lives
3
Wave
1
Best
0

⌨️ Controls

  • or A D slide the ship
  • SPACE, or W fire
  • Tapping the field fires too
  • P pause  •  R new game
  • 🎮 Xbox controller? Just plug it in or pair it — the stick and D-pad are the arrow keys, A is SPACE, Menu pauses and View starts again

🎯 How to play

  • Shoot all 24 aliens before they land on you.
  • Only one of your bullets can be in the air at a time — make it count.
  • The hollow shots are alien bombs. Do not stand under them.
  • Every time the fleet touches a wall it drops a row closer.

🏆 Scoring

  • The back row is worth 40, the front row 10.
  • Clearing a whole wave is another 100.
  • The fewer aliens are left, the faster they march.
  • Tip: shoot a column out at one end and the fleet gets extra room to march — that buys you time.

🧑‍💻 For young coders: build this game yourself

This game is split into small library files inside funtime/lib/, and every function has a comment saying exactly what goes in, what comes out, and the algorithm in plain English. Empty any function out, read its comment, and write it yourself.

File What it does Good functions to try re-writing
lib/invaders-rules.js The rules: the fleet, the shots, the hits alienRect, moveFleet, fireBullet, hitAliens
lib/invaders-draw.js Painting the fleet, the ship and the shots drawAlien, drawShip, renderGame
lib/invaders-main.js The glue: the keyboard, the taps, the loop doAction, holdButton, gameLoop

💡 The big idea: twenty-four things can share one position. The fleet knows where it is; each alien only knows its column and row. Change one number and the whole fleet moves — that is how this game ran on a computer with less memory than a single photo takes today.

🛠️ Want to be walked through it? Build Space Invaders Yourself takes you through the key functions one step at a time and tests each one you write. There is a Python version too.