Run the demo
The demo is a ready-to-play scene. Open
Assets/SimpleHamiltonian/Scenes/, open the demo scene, and press
Play. The landing menu appears first — pick a mode and grid, hit Play.
Controls
Square: WASD / arrows · Hex: QE AD ZC (corner cluster) · hold & drag the mouse to draw the path · R reset · H hide legend · F auto-solve.
During auto-solve, only R responds (cancel) — everything else is locked so it can't fight the playback.
The landing menu
Random generates a fresh set on a background thread behind a progress bar, then plays it. Puzzle Packs plays a curated Square or Hex pack. Solving the last level shows the win screen; any key / click / Play Again restarts.
Skin it with your art
On the LevelRenderer3D in the scene, drop your own Tile Prefab
(square) and Hex Tile Prefab (pointy-top, 1.0 flat-to-flat wide, pivot centered).
Fit To Cell auto-scales any prefab to the grid; Tile Euler
fixes Z-up Blender imports. State is shown by color: dark = empty, green = walked, blue =
start, orange = end; checkpoints light up only when they're next.
Empty prefab slots fall back to colored primitives, so the scene runs with zero art.
The parts
| Component | Role |
|---|---|
DemoGame | The controller. Plays a list of puzzles; Play(list) / Play(provider). |
LevelGame | Pure-C# play brain (events: LevelLoaded, PathChanged, LevelComplete, GameCompleted). |
LevelRenderer3D | Spawns tiles, draws the path by color; square & hex layout. |
PlayerController3D | Grid-step + drag input, auto-solve trigger. |
DemoMenu / DemoHud | Landing menu (with loading) / HUD (legend, stats, win). |
DemoCameraFit / DemoEnvironment / DemoAudio | Angled auto-framing camera / shadows+fog+ground / procedural SFX. |
All of this is plain example code — read it, copy it, or replace it with your own.
Rebuild it / set up your own scene
The demo scene ships pre-built — open it and press Play; you never need the builders to use
it. To re-skin, drop your own prefabs onto LevelRenderer3D /
PlayerController3D (empty slots fall back to primitives).
One-click builders that recreate each piece (3D demo, HUD, menu) are included in
Assets/SimpleHamiltonian/Editor/Tools but kept off the menu. To use one,
uncomment its [MenuItem] line — it then appears under
Window ▸ Living Failure ▸ Simple Hamiltonian ▸ Demo Setup.