How to play Galaga
| Keys | Action |
|---|---|
| ← → / A D | Move |
| Space / Click / Tap | Fire |
| Drag | Steer |
| P / Esc | Pause |
On phones and tablets, use the on-screen tactile D-pad under the viewport.
About Galaga
Galaga is a fixed-screen space shooter. Your fighter moves along the bottom and fires up at a wave of eighteen aliens that fly in along curved paths and settle into three ranks: four bosses on top, six tanks in the middle and eight fighters below. The formation sways from side to side while aliens peel off to dive at your ship, firing as they come. A diver that misses loops off the bottom of the screen and flies back to its place.
You start with three ships. You lose one to an enemy bullet, to a diving alien that rams you, or to a tractor beam. A new ship arrives once the current divers have finished their pass, and it blinks for a moment while it can't be hit. The run ends when the last ship is lost. Clear the whole formation and the stage goes up: the next wave sways faster, dives more often and in greater numbers, and fires more and faster bullets.
Tractor beam and dual fighter
Now and then a boss dives, hovers above you and lowers a tractor beam. If your ship is under the beam when it reaches the bottom, the ship is captured and counts as lost. The boss carries it back to the formation, where it rides above the boss. Shoot that boss down, in formation or in a dive, and the captured ship flies down and docks beside yours as a dual fighter.
A dual fighter fires two shots side by side, but it's twice as wide. If one of its two ships is hit, you lose only that ship and fly on with the other, without losing a life. Bosses don't use the beam while you fly a dual fighter or while they already hold a captured ship.
Scoring, levels and tips
- Bosses are worth 1,000 points, tanks 160 and fighters 80, in formation or diving.
- Bosses take two hits. A boss dims after the first one. Tanks and fighters go down in one hit.
- You can have two shots on screen at a time, or four with a dual fighter. Hold fire to keep shooting as fast as that allows.
- Your best score is saved in your browser when a run ends or you restart.
- Tip: a hovering boss can't fire. Step out from under the beam, or shoot the boss twice before the beam reaches you.
- Tip: getting captured on purpose costs a ship, but rescuing it gives you the dual fighter's double firepower. Don't try it on your last ship, because a capture then ends the run.
- Tip: shots that miss stay on screen until they leave the top, so close-range shots let you fire again sooner.
How it's built
This Galaga is written from scratch in TypeScript on an HTML canvas, with no game framework. The formation, dives, tractor beam, bullets and scoring live in a world module with no canvas or DOM code. It is stepped at a fixed 60 Hz inside requestAnimationFrame, with every speed set in pixels per second, so the game plays the same at any frame rate. A hit registers when a bullet falls inside a box around an alien on both axes.
Aliens enter along curved paths into their formation slots. Divers are picked at random from the aliens already in formation, and they steer toward your ship until they get close. Explosions throw off short-lived particles, and sound is synthesised with the Web Audio API. On a phone, hold the arrow buttons to move and tap or hold the middle Launch button to fire. You can also drag on the game to steer and tap it to fire.
This is an unofficial tribute written from scratch for the browser. It is not affiliated with or endorsed by the owners of the original game.