A rocket launch and upgrade game, flown by hand: hold the engine to climb (it burns fuel only while it fires), lean left and right to steer, collect stars and fuel, dodge what is in the way, and when the tank runs dry fall all the way back down (a fuel can caught on the way relights the engine). Then spend the stars in the hangar and fly higher. Five levels lead through nine layers of sky (Launch Field, Low Sky, Cloud Deck, Stratosphere, Aurora, Orbit, Deep Space, Lunar Transfer, The Moon) to a landing on the Moon. The sky is not to scale: the Moon waits at 170 km here, the real one is about 384,000 km away.
How it's built
- Rules apart from drawing.
core/ is plain TypeScript with no Phaser import: the flight simulation stepped at a fixed 60 Hz (countdown, burn, coast, crash or landing), the entities and their hit shapes, the spawn patterns per layer, the economy, the profile with levels and missions, and the save. It is covered by Vitest tests, including a balance test. - Manual flight. Thrust pushes along the rocket's lean toward a climb speed set by the engine; with the engine off gravity takes over, up to a fall of 3 km/s, and the fins still glide the rocket sideways so a fall can be steered onto stars and fuel cans. The lean turns at a rate set by the fins and eases back upright when nothing is pressed. A touch on the ground faster than a soft landing is a crash with a blast; a falling rocket with an empty tank can skip the rest of the fall straight to the report.
- The whole screen is the playfield. The view tells the simulation how wide the screen is; wide screens get two or three columns of patterns side by side, while jets and wind gusts (which cross the whole width) come from one column only.
- Seeded spawning. The sky is built in chunks from hand-made patterns per layer (bird flocks, balloon fields, storm clouds that charge and strike, jets that cross after an edge warning, meteors that fall after a warning line, wind gusts, asteroids, junk fields, satellites), picked by a seeded random generator and scaled by a difficulty that peaks around 110 km and eases off toward the Moon; the share of chunks with no hazard grows with height (15% in the Stratosphere, up to half on the way to the Moon), so space stays readable. Falling rockets get bands of stars and the odd fuel can below them, and everything already passed stays where it was, so the way down is worth steering too.
- Hazards that warn. Jets appear at the edge with a blinking marker before they cross, meteors draw a dashed line before they fall, storm clouds charge before lightning strikes. Close calls count, and stars, rings and near misses build a combo up to ×4.
- Progression you can read. Eight upgrade lines with eight levels each. Every level of every part changes the rocket's drawing (fin size and stripes, tank size and bands, nozzle size and cooling rings, hull plating bands, nitro bottles, shield rings and lights, scoop size, magnet dishes), and the hangar shows the rocket's spec sheet (climb speed, burn time, reach on one tank, hull, steering, magnet, nitro, shield, star value). Pointing at a part previews its next level on the rocket and in the numbers.
- An economy you can see. The hangar names the best buy (or the next goal and how many stars are missing), shows the average stars per flight over the last five flights and how many flights the next part is away, and says where stars come from: stars grabbed × combo × scoop, 10 per km climbed (8 above 10 km), missions and level bonuses.
- Levels. Five destinations (5 km, 20 km, the Kármán line at 100 km, 135 km, the Moon at 170 km), each with a star bonus, shown on the route map at the side of the screen together with the layers, the best height and the rocket.
- Drawing. Phaser 4 (WebGL). Every texture is painted with Canvas 2D at start-up at 2× and shown at half scale, so there are no image files: the rocket and its parts, clouds, balloons, birds, planes, storms, meteors, asteroids, satellites, the Earth's curve, the Moon and its surface, the pickups. The camera eases the rocket low in the view while it climbs and high while it falls, and shakes as a smooth, decaying sway rather than jitter.
- Everything readable is HTML. The HUD (altitude badge with the level, fuel tube, route map, star count, combo, nitro, touch controls), the title poster, the pause ticket, the flight report and the blueprint hangar are HTML in a 1960s space-age poster style (cream enamel, ink outlines, hard offset shadows, halftone dots), with Bowlby One and Space Mono loaded only by this example.
- Input. Keyboard (up, W or Space for thrust, left and right or A and D to lean, Shift or N for nitro, S to skip a fall), on-screen buttons on touch screens (lean left and right, a big Thrust button, nitro) and a gamepad, merged once per frame.
- Sound is generated with Web Audio (no files) and is off until turned on.
- Reduced motion. No camera shake, flashes, hit-stop or speed streaks, fewer particles, and banners fade instead of moving; the flight plays the same. Screen shake can also be turned off in the pause menu.
- Saves. The profile (stars, levels, level progress, missions, best height, recent earnings) and the settings are kept in this browser's local storage; older saves are upgraded on load.
Balance
core/pilot.ts is the pilot behind ?demo and ?shot, and the one core/balance.test.ts plays. It holds the engine on and leans toward the best lane across the playfield: hazards ahead count against the lanes they will cover when the rocket reaches them (moving hazards are projected along their speed, jets climb along with the rocket at 80% of its speed, warned hazards only move once the warning ends), stars, cans and rings count for their lanes, and it fires nitro when no lane is clear. The quick check always runs (a new pilot reaches 10 km within 8 flights); BALANCE=1 plays six programs of 60 flights from scratch, buying the cheapest part after every flight, and writes tmp/apogee-balance.txt.
- With five levels per part and the Moon at 200 km, a fully upgraded rocket crashed at 86–157 km on autopilot; no program reached the Moon. The answer was three more levels per part, a difficulty that eases off above 110 km, emptier chunks on the way to the Moon, the Moon at 170 km, and cheaper top levels.
- Earlier numbers: the Moon on flight 50 to 56 for three programs of six, too long a grind. After fewer hazards (meteors, balloons, space junk, more empty chunks with height), a steerable fall with one band of pickups per 1100 px, and a combo that needs 12 stars per step (×4 at 36): 30 km on flight 5 to 8, 100 km on flight 14 to 21, 135 km on flight 23 to 34, the Moon on flight 24 to 34 in all six programs.