Skip to content
RANJEETJ06Public

About

Browser-based Contra-style action platformer featuring deterministic simulation, DOM rendering, procedural audio, and mobile touch controls.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

ZORA

A browser run-and-gun in the Contra lineage, rendered entirely with DOM elements - no canvas, no WebGL, no game engine. Every enemy, bullet and spark on screen is a real element you can inspect in devtools.

npm run dev     # http://localhost:3000
npm run build
npm run lint
npm run smoke   # headless simulation checks - no browser needed

Controls

Key Action
← → / A D move · swim
↑ ↓ / W S aim up & diagonally · go prone · dive
Space / K jump - press again in mid-air for a second jump; in water, a swim stroke
J / X fire
F · M · Esc fullscreen · sound · pause
R restart, on the results screen

The game runs edge to edge and widens its view on a wider window - you genuinely see more of the level, not a bigger picture of the same slice.

Touch devices get an on-screen thumbstick and two action buttons, floated over the frame rather than parked below it. The stick is eight-way and follows your thumb: press anywhere in the lower-left quarter and the ring plants itself there, so you never have to look down to find it.

They also get landscape, whether or not the phone is willing. Pressing play asks for screen.orientation.lock("landscape"), and where that is refused - which is to say on every iPhone - the game turns itself a quarter turn in CSS instead and asks you to turn the device to match. A portrait phone crops away exactly the part of the screen a run-and-gun is about.

What's here

A run opens with a helicopter insertion: it banks in from off-screen, hovers, drops you, and pulls away - control is yours the moment the rope lets go.

Sixteen chunks of one sector, in Contra's grammar:

  • One hit kills. Five lives, generous checkpoints, and a drop-in respawn from above the screen.
  • Double jump - the climb sector is built around ledges a single jump cannot reach.
  • A stretch of open sea with a blown-out bridge over it: buoyancy, diving, swim strokes, and hauling yourself back onto the shore.
  • Weapon pods stencilled M and S, the way the arcade did it. Destroying a gun emplacement drops one.
  • A stage boss. The Gate: an armoured bunker with two gun pods on its front face. Shots ring off the core until both pods are down, then the iris opens and it starts throwing radial volleys. The camera locks into the arena and the exit cannot be walked to - the fight is the win condition.
  • Prone, 8-way aim, spike pits, flyers, turret crossfire, and a combo multiplier for chaining kills.

How it's built

  • Next.js 16 / React 19 / Tailwind v4. The game is a single client island; everything around it is a normal server component.
  • A deterministic simulation (game/core) that knows nothing about the DOM or React - seeded RNG, fixed 60 Hz timestep, input as a bitmask. Solo play runs it through the same Transport interface a networked session would.
  • A pooled DOM renderer (game/render) that never creates a node on a steady-state frame and only writes transform and custom properties, so the browser never re-runs layout mid-game.
  • The soldier lives in one place (game/render/human.ts + human.css): thirty-odd nested elements - skull, jaw, neck, hips, boots, and a rifle with a stock, magazine and optic you can select in devtools. Limbs nest, so rotating a thigh swings its own shin and boot, and every pose is one data-pose attribute rather than a branch in the renderer.
  • Synthesised audio - a few oscillators and one noise buffer, driven off the simulation's event stream. No assets, no licences.
  • npm run smoke - because game/core has no DOM dependency, the interesting questions (can the climb be climbed, does the swimmer float, does a checkpoint restore you) are answered in a few hundred milliseconds of Node rather than by driving a browser and hoping.

Full write-up - including how to add a sector, a new enemy, or multiplayer - is in architecture.md.

About

Browser-based Contra-style action platformer featuring deterministic simulation, DOM rendering, procedural audio, and mobile touch controls.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages