Learn the game loop, input, components and collisions before combining them in small playable projects.
Purpose of this learning path
Choose between widget-driven interaction and a continuously updated game world.
How to study this section
Read the chapters in the listed order when learning the subject for the first time. For a reference lookup, choose the exact subtopic instead. Predict what the example will do, run or inspect it, then complete the exercise before moving on.
Configuration examples belong in a local project. The browser editor is available only for complete examples that can run without native platform access.
What this section covers
Choose between widget-driven interaction and a continuously updated game world.
Build Flutter and Flame games, then add AI-assisted workflows, enemy behavior, validated levels, NPC dialogue and repeatable tests.
The game loopUnderstand update and render, frame-independent movement and why game state should not depend on frame count.
Your first gameBuild a complete tap-to-score game with a moving target, visible score and restart action using Flutter widgets.
Flame and componentsUnderstand when to move from Flutter widgets to a component-based game world with the Flame engine.
Collision basicsCheck circle overlaps, distinguish detection from response and test edge cases before adding graphics.
Game input and coordinatesDistinguish screen, local and world coordinates, and route input through game rules rather than directly awarding points.
Sprites and assetsLoad a sprite before using it, separate world scale from asset pixels and keep interface overlays outside asset-loading logic.
Your first Flame gameRun a complete asset-free Flame example, understand GameWidget, onLoad and update(dt), and keep a moving component inside the visible play area.
Flutter memory gameBuild a complete memory-pairs game with shuffled cards, guarded input, a mismatch delay, score and lifecycle-safe restart.
AI-assisted game planningUse an AI coding assistant to turn a small Flutter game brief into testable rules, focused code changes and a playable verification checklist.
Enemy AI: patrol, chase & attackBuild predictable enemy AI with distance thresholds, explicit states and cooldowns, then connect the rules to a Flame component.
AI-generated levels & validationTurn generated game-level JSON into a bounded, reachable grid with a safe fallback, using a complete Dart validation example.
AI NPC dialogue & safe fallbacksDesign a game dialogue service with bounded responses, timeouts and deterministic fallbacks while keeping rewards under game control.
AI game testing & balancingUse an AI assistant to propose game edge cases, then verify invariants with deterministic Dart simulations and real device checks.