Running, restarting and troubleshooting the 2D game
Expected game states, causes of common failures and the limits of this prototype.
Run the whole project
Save documents and code, then build C# without errors. Assign Levels/Arena.rscene as main and use F5 or the menu beside Play → Run Project (Main Scene). The main Play button and F6 run the open document: on Player.rprefab that is only the player, without button, score or hazards.
| Action | Result |
|---|---|
| Open the main level | Score 0, start button visible; player movement is disabled |
| Press the button | Controls activate, button hides, circles spawn every 0.75 game seconds |
| Move diagonally | Speed does not exceed movement along one axis |
| Survive another second | Score increases by 1 |
| Touch a circle | Round stops; no new circles or points appear |
| Press Restart | Score 0, player at (320, 300), old circles removed by the end of the frame |
| Repeat defeat and start | Each button and timer still produces one action |
Find the failure
| Problem | Check |
|---|---|
Project rejected as Unsupported project / schema error | Match the archive to the engine build it was published for. Do not manually change project_schema: this is not a gameplay-code fix |
| SDK / package missing | Complete distribution, dotnet and NuGet beside the editor, separate terminal environment |
| C# build fails | All four complete classes, file names matching classes, old script replaced in full |
| Player or circle missing | Script with _Draw() attached, successful build, object visible and inside window |
| Player will not move | Round started, game window focused, all four actions bound |
| No circles spawn | F5 runs Arena, SpawnTimer exists, Prefabs/Enemy.rprefab has a DodgeEnemy root |
| Overlap does not end the round | Player layer 1, hazard mask 1 and Monitoring, both enabled shapes |
| Two points per tick or two start requests | No duplicate editor or script signal connections |
| Immediate defeat after restart | Old hazards ignored after QueueFree(); IsQueuedForDeletion() check retained |
| UI empty or too small | Root/... paths, visibility, control dimensions and launched document |
Use Debug → Visible Collision Shapes to compare physics with graphics. Do not change layers at random; each object has a known role and mask.
Change the mechanics
Set player Speed in the inspector. Change SpawnTimer.WaitTime for spawn frequency, or the source Enemy.rprefab's Velocity for falling speed. Saved inspector values can override C# initial values.
Changing arena dimensions requires updating player bounds, spawn range, cleanup threshold and UI layout together. Before export, check main level and templates. To persist a high score, use an explicit user:// format; the current Score lives only in memory.
The prototype covers one local round. Physics and code checks do not replace target-device execution, visual UI inspection or real input-device testing. Download the same project files.