A small surface.
Draw pixels, rectangles, and sprites. Read input. Own your game loop. Start with the pieces that make a game feel like yours.
THE PIXELJS ARCADE / 001
A little maze. A lot of second chances. Collect the pellets, dodge the ghosts, and make one more turn.
Play it. Then see how it works.READY · Choose a direction to play
Draw pixels, rectangles, and sprites. Read input. Own your game loop. Start with the pieces that make a game feel like yours.
C handles the framebuffer. The web host handles the browser. Engine instances have explicit lifetimes and resources have owners.
Use plain JavaScript or TypeScript. The same ESM runtime and runtime validation serve both, with declarations included.
002 / MAKE IT YOURS
The 0.0.1 candidate is a local preview.
The package has not been published to
npm.
Explore the @pixeljs/core candidate and the source running this arcade. An installable archive will follow once its distribution license is confirmed.
Download previewnpm install ./pixeljs-core-0.0.1.tgz
Archive download pending license confirmation. The candidate is not published to npm.
Open standalone JS example Download TypeScript sourceLoading example source…
This is the real runnable game source, loaded directly from its example file.
003 / A FEW GOOD BUILDING BLOCKS
A focused first milestone.
Implemented features and future work stay distinct.
await createEngine({ canvas, width, height }) loads an instance. Use
start({ update, draw }) to begin the loop, pause() and
resume() to control it, and await dispose() to release it.
Keep drawing in the draw callback. Dispose makes the engine unavailable immediately; cleanup waits for an active callback to finish. Create a fresh instance to restart after disposal.
The preview includes clear, pixel, rect,
sprite, setCamera, setClip, and
resetClip. Colors use the engine's original 16-color palette.
Create indexed images with
createImage({ width, height, pixels, transparentIndex }) while the
engine is idle. Keep the returned image object for sprite drawing and call
release(image) when it is no longer needed. Raw heap offsets and
internal handles stay private.
input.isDown(code), wasPressed(code), and
wasReleased(code) use browser key codes such as
ArrowLeft and KeyA. Pointer coordinates are in game
pixels.
Read the input snapshot in update. Focus the canvas for keyboard play; blur and lifecycle changes reset input. The game host adds swipe and direction-button controls for this demo.
This M1 candidate connects a C17 raster core, a private WASM bridge, a typed ESM host, and a playable sample. It is an early development preview, not a promise of production stability or broad device certification.
Browser compatibility, mobile performance, and memory safety require concrete tests on each target. A live demo alone does not establish those guarantees.
THERE'S ROOM FOR ONE MORE SMALL WORLD.