Documentation

The documentation

Depending on where you are coming from: install and start, learn by building a whole game, understand how a scene lives, get to know the hooks and the creators, or look up one symbol.

Up and running in ten minutes

The fast track, for people who already code. Install, a sprite on screen, and move it.

Install and start

Step-by-step tutorial

A complete Breakout in nine chapters, running on this very page. Nothing to install, and no prior coding needed.

Take the tutorial

The lifecycle of a scene

What happens to a scene from the moment it starts until it leaves, frame by frame, with a diagram for every step.

See the lifecycle

What the engine hands a shader

Every name a material or a screen effect can read, for sprites, models and the whole screen, on both graphics backends.

See the shader inputs

The scene format

One scene written down as JSON, field by field: for anyone making a tool that reads or writes .scene files.

See the format

2D lighting

Lamps on sprites, tilemaps and particles with no normal maps: a dark cave, the player's lantern, what glows with its own light. On WebGPU and WebGL2.

Read the 2D lighting guide

Making music

Songs written as notes for the NES, the SNES and the Genesis: instruments, echo, pan, and thirty-nine classics ready to play. To read here or download.

Read the music guide

Online games

The same scenes in a server's room and in each player's page: shared objects, moving in real time, shots, and what carries the lines. Experimental.

Read the online guide

Your first plugin

A package other games import: a typewriter, from the template to the .zip you hand to anyone. With the template to download.

Make a plugin

A plugin on the GPU

useGpuPass, for the plugin that needs what a material or an effect cannot do: a simulation in compute, a picture worked out on the GPU. On WebGPU and WebGL2.

Read the useGpuPass guide

Hooks and creators

The two kinds of function a game is written with, by topic and with an example each.

See hooks and creators

API reference

Everything your game can use from the engine, generated from the code itself: signatures, options and examples.

Open the reference

Where each thing is imported from

The package root provides the core game API. Math, procedural pixels, shaders, effects, transitions and file formats have their own modules: math, pixels, shader, effects, transitions and files. Physics has two subpaths because the physics engine is installed separately. Headless runs the game without a browser, from a test or a script. The reference shows which module each symbol comes from.

What a game runsimport { createGame, createSprite } from 'nacatamalon'
A module of its ownimport { clamp } from 'nacatamalon/math'import { glow } from 'nacatamalon/effects'
What moves the physicsimport { installPhysics2d } from 'nacatamalon/physics2d'import { installPhysics3d } from 'nacatamalon/physics3d'
What checks the game, with no browserimport { createHeadlessGame } from 'nacatamalon/headless'