program SceneDemo { var counter: int = 0 handler Boot phase Start { counter = 0 print(1000) } scene Title start { on enter { print(1) } on exit { print(2) } layer Main { handler Tick phase Update { counter += 1 print(100 + counter) if counter >= 2 { become Play } # hand off to Play } } } scene Play { on enter { print(3) counter = 0 } on exit { print(4) } layer World { handler Step phase Update { counter += 1 print(200 + counter) if counter >= 2 { quit() } } } layer Hud { handler DrawHud phase Render { print(900) } } } }