A downloadable tool

Yuuna's Game Engine

Live demo & playground  ·  GitHub  ·  Wiki

A lightweight, state-machine-based TypeScript game engine built for quick prototypes — drop it into a page and it's running, no editor or build step required. You describe your game as a state, a render(state) function, and a nextState({ state, event, keyboard }) function — Yuuna owns the render loop, input handling, and canvas drawing.

Yuuna
Live demo & playground
Try Yuuna in the browser — edit and run examples live, no install needed
Open the playground →

Concepts

  • Renderables — declarative shapes drawn each frame: RECTANGLE, CIRCLE, TEXT, SPRITE, ANIMATED_SPRITE, LINE, and GROUP. Give one an id plus isClickable/isHoverable to make it interactive.
  • EventsnextState receives one GameEvent per call: TIME, CLICK, HOVER_IN, HOVER_OUT, MOUSE_MOVE, MOUSE_LEAVE, MUSIC_END, or a CUSTOM event of a type you define yourself, for reporting things like an async fetch() resolving back into your state machine.
  • Keyboard, camera, sprites & animation, sound effects & music, canvas config, and mechanics pipelines all follow the same idea: small, focused props and functions runEngine/nextState take, that compose with everything above instead of replacing it.

The full concept-by-concept reference, with every option and example, lives on the wiki. The playground also has a small, focused example for most of these you can run and edit directly.

MIT © lucy-dot-exe

Leave a comment

Log in with itch.io to leave a comment.