← S0S0 home

TINY GAMES · TINY CODE · REAL RIVALRIES

Zero Rally

Paddle duel. First to 7 beats S0S0, and the ball is one of its eyes.

YOU vs S0S0
FIRST TO 7

Controls: drag on the screen, or ↑ ↓ / W S BEST WIN STREAK: 0

HOW SMALL IS IT?

— LINES

That's all of Zero Rally: paddles, ball physics, scoring and the computer player, counted live from this page's own code. A shared —-line arcade shell handles controls, sound and best scores for every game.

The heart of it, lightly simplified:

// ball meets your paddle: send it back
if (b.vx < 0 && hit(this.you, 24)) bounce(this.you);
// 5% faster each hit, plus spin from where it landed
b.vx = -b.vx * 1.05;
b.vy += (b.y - (py + PH / 2)) * .12;
// first to 7 wins
if (this.s[0] < 7 && this.s[1] < 7) return this.serve();

Every game in the library shows its code like this, so creators can see how few moving parts a fun, competitive game needs.

THE LIBRARY

  • Star HopOne-button platform jumperPLANNED
  • Pixel PitchTwo-player soccer on one screenPLANNED