About
Paranoia — four ghosts hunt you four different ways, and working out which one is which is the whole game. Built from scratch in vanilla JavaScript: no frameworks, no build step, no dependencies. It installs to your home screen and plays fully offline.
Eat everything
There are 244 things to eat: 240 dots worth 10 each, and four large energizers worth 50. Clear the board and the next one starts, a little faster. You have three lives, and a fourth at 10,000 points.
The four ghosts are four different programs
This is the part worth knowing. All four ghosts move by exactly the same rule — at every junction, take the turn that ends up closest to my target tile, and never turn back on yourself. Everything that makes them feel like characters comes from the single question of where that target is:
- Red targets you. That is the whole program. He is relentless and he is behind you.
- Pink targets four tiles in front of you, so she arrives where you are going rather than where you are. Turn sharply and her target lands behind her.
- Cyan is the strange one. Take the tile two ahead of you, draw a line from Red to it, and double that line — that is his target. He is harmless while Red is far away and vicious when Red is close. The two of them pincer you without a single line of code that says so.
- Orange chases you exactly like Red until he gets within eight tiles, then loses his nerve and runs for his corner — which brings him back into range, so he does it again. He spends the game circling.
Scatter and chase
The ghosts do not hunt continuously. They alternate between chasing and scattering to their own corners, on a fixed schedule that gets more hostile each level: seven seconds of relief early on, then five, then effectively none. When the phase changes every ghost reverses on the spot — which is both a warning and an opportunity.
Eating an energizer turns them blue and edible, worth 200, 400, 800 and 1,600 for the first, second, third and fourth caught on the same energizer. That is 3,000 per energizer, 12,000 a board, and it is most of a good score. The blue time shrinks every level and by level 17 there is none at all — the ghosts still turn around, but they never become edible again.
Two details that decide games
- Eating slows you down. You move slightly slower over a dot than over bare floor. That is the only reason ghosts ever catch up, and it is why a cleared corridor is an escape route.
- You corner better than they do. You can start a turn slightly before the junction; ghosts must reach it first. Every corner you take buys you a fraction of a tile, and that is how you survive the later levels, where the ghosts are strictly faster than you are.
Red also gets faster as the board empties — twice per level, at thresholds that arrive earlier the further you get. Late in a level he is quicker than you and no longer scatters at all.
Controls
- Arrows or WASD — move
- P or Esc — pause
- Enter — start, or play again
On a touchscreen, swipe anywhere on the board or use the D-pad. Turns are buffered: press before the junction and the turn happens as soon as it is legal, so you never have to be frame-perfect at a corner.
Settings
Starting level changes where you begin — later levels are faster with shorter scatters and less blue time. It applies to your next game, because it changes what a score means.
Modern ghost AI is off by default, and that is deliberate. The original had two arithmetic bugs in how Pink and Cyan look ahead: when you face upward, their target also shifts to the left. Those bugs are the reason several well-known safe spots exist. Turning this on corrects the arithmetic — the ghosts then read your direction honestly, which is harder, and none of the classic patterns work any more.
Notes
The maze is written out as text in the source, one character per tile, and checked on load: 28 by 31, exactly 240 dots and 4 energizers. The ghosts' target selection is a pure function of integers with no randomness in it at all, which is why the same situation always produces the same chase — and why it can be tested to the letter.
Scores are yours: local ones stay in this browser, and the global board only ever sees a name and a number.