Zero asset files
No image, model or audio files anywhere. The city, every texture, every mesh and every sound is synthesised in code — which is why a whole game fits in about 915 KB minified, across two requests.
No assets. No build step. No dependencies. Every texture, mesh and sound is generated at runtime, so a complete open-world shooter ships in about 915 KB and runs offline. It powers two shipped games — Dead Zone and Neon Police.
A small, dependency-light WebGL engine for open-world browser shooters. A new game is mostly a config object plus a gameplay hook.
No image, model or audio files anywhere. The city, every texture, every mesh and every sound is synthesised in code — which is why a whole game fits in about 915 KB minified, across two requests.
A 5 × 5 window of 96-unit chunks around the player, derived from a seeded hash so the same seed always builds the same world. Each chunk merges its geometry per material — roughly one draw call per material, not hundreds.
Construct new GameBase(canvas, config) and implement hooks like onGameplay and extraPois. A game never talks to three.js directly — it configures the shell and inherits the rest.
Every SFX and all music is synthesised with the WebAudio API — per-weapon gunshots, impacts, footsteps, groans, thunder and wind beds. A generative engine crossfades four moods on tempo and layer mix, live.
Chunk building is synchronous but budgeted to a 6 ms slice, nearest-first, so travel never hitches. Collision is AABB prisms and vehicles use an arcade model — no physics engine, no worker threads.
Weapons, enemy AI director, loot, levelling and prestige, a store, a safe house, HUD and maps, throwables, vehicles, a companion, a 16-mission campaign and four game modes — all switched on by config keys.
The engine source is plain ES modules, so it needs a server — python3 -m http.server 8080. The import map is required: the engine imports three as a bare specifier.
No build step and no dependencies. Any modern browser with WebGL2 will run it. The engine imports three as a bare specifier, so the import map is required.
A canvas, an overlay and a module script. Load hud.css for the shared HUD, touch, shop and map styling.
Construct GameBase with a config object, then call init() and loop(). That alone is a complete, playable open-world shooter.
Vehicles, companion, campaign and modes are off unless you ask. Each is a single config key — mode: 'bossrush' replaces the normal spawn loop.
<!-- 1. the import map is required --> <script type="importmap"> { "imports": { "three": "./engine/three.module.js" } } </script> <canvas id="game"></canvas> <script type="module" src="./mygame.js"></script>
import { GameBase } from './engine/gamebase.js'; const game = new GameBase(document.getElementById('game'), { seed: 1234, dayLength: 300, worldWeights: [['city', 5], ['park', 2], ['jungle', 2]], pool: ['walker', 'runner'], // what the director sends autoSpawn: true, persist: true, // save to localStorage startingWeapons: ['knife', 'pistol'], objectiveMain: 'SURVIVE', onGameplay(dt, g) { /* your logic each frame */ }, }); game.init(); game.loop();
const game = new GameBase(canvas, { // …the above, plus: vehicles: true, // drivable cars (F to get in) ally: true, // a companion who follows and shoots allyName: 'Rook', campaign: true, // the 16-mission scripted chain mode: 'bossrush', // 'arena' | 'bossrush' | 'defence' | 'extraction' });
A game configures GameBase and implements hooks; everything else is inherited. Play the two games built on it, or read the architecture notes in the repo.
Endless zombie survival. No timer, no end — the horde escalates as you level. Free to play in your browser, no install, no account.
drsamonline.github.io/neon-games/play/dead-zone play · built on neon-engineRespond to crime in an open city. Arrest when you can, shoot when you must. Also free, also in-browser, also no install.
drsamonline.github.io/neon-games/play/neon-policeThe result is a static bundle with all paths relative, so it works from a sub-path — drag it onto a static host, or push to a repo and enable GitHub Pages.
# 1. get the engine git clone https://github.com/drsamonline/neon-engine.git cd neon-engine # 2. serve it (ES modules need a server) python3 -m http.server 8080 # 3. open the example game — the smallest complete game on the engine # http://localhost:8080/example/ # optional: bundle everything for release (~915 KB in 2 requests) python3 minify.py
The repo ships full documentation alongside the source.
minify.py can bundle everything for release, but it is optional.python3 -m http.server 8080. Games bundled with minify.py emit an IIFE and can launch from disk via file://.WEAPONS in weapons.js, to ENEMY_TYPES in ai.js, or a new generator method plus a weight on World. Extensions are data-first — the shop, HUD and firing code follow automatically.BufferGeometryUtils remain under their own MIT licences.drsamonline.github.io/neon-games/.