gekro
GitHub LinkedIn

Space Rocks

Play a ship-and-rocks arcade game: turn, thrust and shoot drifting rocks that split into smaller ones, clear each wave and keep your lives.

Score 0

Best -

Wave 1

Lives 3

Left and Right arrows (or A and D) turn the ship, Up (or W) thrusts, Space fires; hold Space to keep firing. The four big buttons under the sky do the same on a touch screen. Escape or P pauses. The ship drifts, so it keeps moving after you stop thrusting, and anything that leaves one edge comes back at the opposite one. Big rocks break into two medium rocks, medium into two small, small just disappear. When your ship returns it cannot be hit for a couple of seconds. Sound is off until you turn it on.

How it works

Sixty times a second the game turns the ship, adds thrust to its speed, lets a little of that speed fade, and moves everything. A bullet can only travel for under a second, and the game checks the whole path a bullet took each step, so even a fast bullet cannot pass through a small rock. New rocks always appear at least 120 units away from your ship. A large rock is worth 20, a medium one 50 and a small one 100. You earn an extra life every 3000 points, up to 9 lives.

As-is, no warranty. These apps are free under their listed license and run entirely in your browser. Use at your own risk — don't blame me if your PC catches fire, your dog runs away, or the math turns out wrong. Verify anything that actually matters. None of this is professional financial, medical, legal, or engineering advice.

© 2026 Rohit Burani · MIT · Built at gekro.com · View source ↗

Guide

How to play

A small ship drifts across a dark sky full of rocks. Turn it, push it, and shoot the rocks. A big rock breaks into two medium rocks, a medium rock breaks into two small ones, and a small rock just disappears. When the sky is empty a new, bigger wave arrives. The game ends when you are out of lives.

The sky wraps around. Anything that leaves one edge comes back at the opposite edge, including you, your shots and the rocks. The ship keeps drifting after you stop pushing, so you can coast and aim at the same time.

  • Keyboard: Left and Right arrows (or A and D) turn the ship. Up (or W) thrusts. Space fires, and holding it keeps firing at a steady pace. Escape or P pauses.
  • Touch: four big buttons sit under the sky: turn left, turn right, thrust and fire. They are all at least 56 pixels square. Hold a button to keep doing it. You can press two at once, for example thrust and fire.
  • Starting: press Start, press Space, or press any of the buttons. The game waits for you, so the rocks do not move until you begin.
  • Pause: Escape, P, the Pause button, or switching to another tab. The game stays paused until you press Resume or P (Space also works while the game area has focus).
  • Sound: off until you press the Sound button. Every sound is a short tone made in the browser and kept quiet.

Levels

LevelLivesRock speedLarge rocks in wave 1Shots in the air
Easy575 percent35
Medium3100 percent44
Hard3130 percent54

Each wave has one more large rock, up to 10, and rocks get faster wave by wave, up to 50 percent faster. Large rocks score 20, medium rocks 50 and small rocks 100. You earn an extra life every 3000 points, up to 9 lives.

When a rock hits your ship you lose a life and the rock breaks. After 1.4 seconds the ship comes back in the middle, and it cannot be hit for 2.2 seconds. If a rock is sitting in the middle, the ship waits up to three seconds for it to move away.

Seeing the game

Rocks are soft blobby shapes with a glow, not outlines. The three sizes also have three colours (violet, orange and amber), but the size is clear from the shape alone, so you never need the colour. The canvas has a text label that gives your score, lives, wave and how many rocks are left, and a message line says what happened when you lose a ship, clear a wave or earn a life.

With reduced motion set on your device, the rocks are 20 percent slower, there are no sparks, the engine flame does not flicker, and a returning ship is shown steadily dimmed instead of blinking. Nothing on the page flashes.

How it works

The engine is a pure function: step(state, input, rng) advances the game by exactly one 1/60 second and returns a new state. The page runs it from a fixed-step clock, so a 60 Hz phone and a 144 Hz monitor play the same game, and a stalled tab cannot fast-forward it (one frame is cut off at 50 ms).

  • Ship. It turns at exactly 4.2 radians a second. Thrust adds 190 units a second squared along the nose. Each second 35 percent of the speed fades away, and the speed never passes 260.
  • Shots. A bullet leaves the nose at 340 units a second plus the ship’s own speed and lives 0.85 seconds. A shot can be fired every 0.2 seconds.
  • Hits. A rock’s hit circle is 90 percent of its drawn size, and the ship’s is smaller than it looks, so a graze does not count. The game does not just test where a bullet is at the end of a step. It tests the whole path the bullet took against the whole path the rock took, measured across the wrap-around edge. A test checks this against a brute-force sampling of the path on 3000 random cases, and another sends a fast bullet at a small rock at every offset across its width to prove it never slips through.
  • Waves. New rocks appear at least 120 units from the ship. The tests check this from every part of the screen, counting distance across the edges.
  • Seeds. The same random numbers and the same keys replay exactly the same game. The page takes its random numbers from the browser’s secure random source.

Can every wave be cleared? A rock can always be shot, because shots wrap around the sky and rocks cannot hide. As a check, the suite plays a simple pilot that only turns toward the nearest rock and fires, never thrusting. It clears the first wave on at least 15 of 20 seeds on Easy and Medium and at least 12 of 20 on Hard. A pilot that never shoots scores nothing, so the check can fail.

The suite also plays thousands of random key presses on every level and checks that the ship and rocks stay inside the sky, the shot count stays under the cap, the score never goes down, lives stay between 0 and 9, and no number turns into NaN.

Privacy and storage

Nothing is uploaded and there is no account. Your best score for each level (and for the slower pace used with reduced motion) is saved in your browser’s local storage under one key, as small whole numbers inside a small JSON object. The page address holds your level so you can share it. Clearing site data removes the scores.

Limits

  • One kind of rock and one ship. There are no flying saucers, no power-ups and no hyperspace jump.
  • A run you leave with Restart or a level change still counts toward your best, because the points were really earned.
All arcade games →

Free to play, no ads, nothing uploaded. These games are original and are not affiliated with any other game or brand.