Skip to content

MVT Games Documentation ​

Canvas and game applications tend to mix state, rendering, and timing into tangled code that is hard to test, debug, or extend. MVT (Model-View-Ticker) solves this by splitting applications into three strict layers, giving you deterministic models you can unit test, stateless views you can swap, and frame-consistent rendering across the board.

The Three Layers ​

LayerOwnsReceivesMust not touch
ModelState, domain logicdeltaMsViews, rendering, time
ViewPresentationBindings/modelDomain state, timers
TickerFrame loopAnimation frameDomain logic, rendering code

The Frame Sequence ​

Every frame follows the same strict order:

  Ticker (frame loop)
    ├── 1. model.update(deltaMs)   ← Models advance state
    ├── 2. view.refresh()          ← Views read state, update presentation
    └── 3. renderer draws          ← Frame drawn to screen

Models always settle before views read them. Views never see a half-updated world.

How This Documentation Is Organized ​

SectionWhat you'll findWhen to use it
ArchitectureThe transferable MVT specification - contracts, constraints, and patterns in language-neutral termsUnderstanding the architecture independent of any implementation
Building with MVTProgressive guide from quickstart to advanced topics - models, views, bindings, reactivity, testing, and moreLearning MVT and building with it
ReferenceTerse lookup pages - rules, style guide, glossary, project structureQuick lookups while working

Architecture ​

Want the pure MVT specification without implementation details?

Building with MVT ​

The progressive guide takes you from a working example to advanced topics:

  1. Quickstart - build a bouncing ball in under 5 minutes
  2. The Game Loop - the frame sequence your code lives inside
  3. Simulating the World - Models, Time Management, Model Composition
  4. Presenting the World - Views, Bindings, View Composition
  5. Reacting to Changes - Why Polling, Change Detection, Events and Signals
  6. Adding Visual Polish - Presentation State, Taming Complex Views
  7. Animating Transitions - Phase-Based, Open-Ended Phases, Complex Sequences
  8. Iterating with Confidence - Testing, Testing Models, Testing Views
  9. Avoiding Pitfalls - Common Mistakes
  10. Performance - Why Performance Matters, Hot Paths, Performance Measurements, Benchmarking Methods

Reference ​

Already familiar and need to look something up?

Common Mistakes ​

Making something work but not sure if you're doing it right? Common Mistakes covers the most frequent anti-patterns and how to fix them.

AI Agents ​

AI coding agents should start with AGENTS.md for compressed orientation.