@fi4f/hg
v0.0.20
Published
A tiny 2d game engine for the web.
Readme
Mercury
A tiny 2D engine for making interactive stuff on the web
What is Mercury?
Mercury is a tiny 2D engine for making interactive stuff on the web.
Mercury is not
- an editor
- a framework
- a AAA game engine
Why is Mercury?
The enemy of creativity is cognitive friction.
Many tools, engines, and frameworks come with an overwhelming amount of cognitive and philosophical baggage. I have experienced firsthand the pain of trying to master a new workflow, while each frustration gradually chips away at your creative motivation.
Context-switching is mentally taxing, and many modern tools incorporate many different abstractions that make it an unavoidable part of the user experience. Navigating between lists, inspectors, hierarchies, node editors, and script editors is exhausting.
Mercury is code-first. Just you, your text editor, and a few lines of code.
Mercury is data-first. All engine primitives are plain objects that can be easily serialized.
Mercury is unopinionated. No ideological buy-in required. Mercury exposes a handful of thin wrappers around browser APIs as well as a few plain primitives, but no module is strictly required. Mix and match and monkey-patch as you please.
How do Mercury?
Install via npm -
npm i @fi4f/hgImport the bits you need and start making things -
import { Stage, Scene, Event, ... } from "@fi4f/hg";
const stage = Stage.new();
Stage.change(stage, {
onRender(context) {
// draw stuff
// move stuff
// react to input
...
}
});