The gap
An Asteroids-like game needs inertia that feels right, readable glow graphics and fair saucers, and a gravity well makes all of that harder to tune.
Game templates
The complete source of Vectorne, a vector-glow space shooter with a gravity-well star, splitting asteroids, saucers and a bot that plays until its last ship.
Coming soon
Not published on its store yet, so there is no buy or download link. PN Scripts does not take payment for it here.
The gap
An Asteroids-like game needs inertia that feels right, readable glow graphics and fair saucers, and a gravity well makes all of that harder to tune.
What it is
This template ships a tuned gravity shooter with the physics, scoring, touch controls and a bot that proves a run plays to the end.
How you use it
Unzip, serve the folder and open index.html, then edit game.js; npm test plays it again in headless Chrome.
Source code of a real, playable game to reskin and learn from, with a smoke test whose bot plays it.
Use it when
Built for
Every moving object calls the same gravity function with its own strength: the ship 0.8, rocks 0.6 and shots 3, so shots bend the most.
Each bullet adds up how far its heading has turned; past 0.7 radians it glows gold and doubles the score of whatever it hits.
Plain JavaScript and Canvas 2D; open index.html through any static server and edit game.js.
A headless Chrome test loads the game, checks the console, presses keys and taps, and lets the built-in bot play a run to its result screen.
1 of 3
| Platform or runtime | Supported versions | Tested up to |
|---|---|---|
| Node.js | 22.12 or newer | Not stated |
The template is finished and tested. It is not on sale yet; this page will say where to get it when it is.
Coming soon
Not published on its store yet, so there is no buy or download link. PN Scripts does not take payment for it here.