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
| Layer | Owns | Receives | Must not touch |
|---|---|---|---|
| Model | State, domain logic | deltaMs | Views, rendering, time |
| View | Presentation | Bindings/model | Domain state, timers |
| Ticker | Frame loop | Animation frame | Domain 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 screenModels always settle before views read them. Views never see a half-updated world.
How This Documentation Is Organized
| Section | What you'll find | When to use it |
|---|---|---|
| Architecture | The transferable MVT specification - contracts, constraints, and patterns in language-neutral terms | Understanding the architecture independent of any implementation |
| Building with MVT | Progressive guide from quickstart to advanced topics - models, views, bindings, reactivity, testing, and more | Learning MVT and building with it |
| Reference | Terse lookup pages - rules, style guide, glossary, project structure | Quick lookups while working |
Architecture
Want the pure MVT specification without implementation details?
- Architecture Overview - The problem, the solution, the three layers
- Architecture Rules - Universal MVT constraints
- Heritage - The proven patterns MVT assembles
Building with MVT
The progressive guide takes you from a working example to advanced topics:
- Quickstart - build a bouncing ball in under 5 minutes
- The Game Loop - the frame sequence your code lives inside
- Simulating the World - Models, Time Management, Model Composition
- Presenting the World - Views, Bindings, View Composition
- Reacting to Changes - Why Polling, Change Detection, Events and Signals
- Adding Visual Polish - Presentation State, Taming Complex Views
- Animating Transitions - Phase-Based, Open-Ended Phases, Complex Sequences
- Iterating with Confidence - Testing, Testing Models, Testing Views
- Avoiding Pitfalls - Common Mistakes
- Performance - Why Performance Matters, Hot Paths, Performance Measurements, Benchmarking Methods
Reference
Already familiar and need to look something up?
- Architecture Rules - All rules on one page
- Style Guide - Code conventions and naming
- Glossary - Term definitions
- Project Structure - Directory layout and barrel files
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.