Module reference
Everything Purr hands you. Each module is a flat namespace of functions, always in scope, with no classes to instantiate and no objects to wire up.
The game loop
A Purr program is a tigr script. Define up to three top-level functions and Purr calls them for you: init once at startup, then update and draw every frame. Every module is already in scope, so there's nothing to import.
main.tg
init := fn() {
// called once at startup: bind actions, set up state
Input.bind('jump', 'space');
};
update := fn(dt) {
// called every fixed step: read input, move things
if Input.pressed('jump') { /* ... */ };
};
draw := fn() {
// called every frame: paint the world
Gfx.clear(43, 34, 28);
};
no functions match that filter 🐾