SpacePi is a line-drawing defense game where you guard a tiny orange base at the center of the screen. Red enemy lines fly in from the edges, and you stop them by dragging short white lines across their path. While you hold them off, the base slowly swells toward a target size. Jack Rugile built SpacePi for js13kGames, and every shape on screen is drawn in code.
How to Play SpacePi
Press Play Game, then pick a level from the row of 13 at the bottom of the upgrade screen. Only level 1 is open at first, and beating a level opens the next one.
Your base starts as a speck. The Completion bar at the top shows how close it is to the target radius, which gets larger in later levels. When a red line reaches the base it takes a chunk out of it, and if the base shrinks to almost nothing, the level fails. Reach the target and you win.
Click and drag to draw a defensive line. When a red line crosses it, both lines burst apart. Every line spends power equal to its length, shown in the Power bar, and power refills over time.
Destroyed enemy lines often drop coins, and sometimes a power-up. Move your pointer close and they drift toward it. Coins are worth more in later levels. Spend them on ten upgrades, such as more power, a sturdier base, a stronger magnet and better coin drops. Power-ups can slow enemies, give unlimited power, double base growth or scatter coins across the field.
SpacePi Controls
| Action | Keyboard | Mouse | Touch |
|---|---|---|---|
| Draw a defensive line | — | Click and drag | Drag a finger |
| Pull in coins and power-ups | — | Move the pointer near them | Touch near them |
| Pause or resume | Space | — | — |
| Buy upgrades and pick levels | — | Click the buttons | Tap the buttons |
Tips and Strategies
- Draw short lines close to the threat. A small line drawn right in front of a red streak costs little power and still blocks it.
- Guard the early seconds. Your base starts very small, so a single hit at the start can end the level. Watch every edge right away.
- Sweep the pointer over coins. The magnet pulls toward your pointer, not the base, so move toward drops between attacks.
- Upgrade power first. Power Capacity and Power Generation decide how many lines you can afford during a busy wave.
- Replay early levels for cash. If an upgrade is out of reach, a quick run on a cleared level adds coins without much risk.
- Aim for fewer lines. Each line adds to your score, so one well-placed line beats three hasty ones.
Features
- 13 levels: enemies arrive faster and hit harder as you go, and each base needs to grow larger.
- Ten upgrade tracks: each with five steps, bought with coins you collect during play.
- Four power-ups: slow enemies, unlimited power, faster base growth and a coin shower.
- Saved progress: coins, upgrades, best scores and overall stats stay in your browser, with a button to reset them.
Tested and updated:













