Date: 2026-01-10 Framework: .NET 10 Platform: Windows (Console)
"Retro Snake" is a modular, SOLID-compliant Snake game implementation. It uses a Strategy pattern for levels and is decoupled via interfaces for Rendering, Input, and Audio.
- Engine (
GameEngine.cs): Passive orchestrator of game state (refactoring in progress). - Logic (
Logic/): Game rules viaIGameLogic.LevelManagerhandles level progression. - Infrastructure: Implementations for Spectre.Console, NAudio, and File IO.
- Remote Level (gRPC): Level 4+ is handled by
SnakeGame.Servervia gRPC.
- Level 1 (Classic): Standard rules.
- Level 2 (Gluttony): Yellow food -> Growth + Slow Motion.
- Level 3 (Snaketris): Falling Tetris blocks (Collision kills).
- Level 4 (Tron Mode - gRPC):
- Remote AI Snake avoids player.
- Player can trap AI Snake to "win" (AI dies).
- Full audio feedback (Eat, Game Over) integrated.
- Transition artifacts (frozen animations) fixed via state clearing.
-
Fixed TUI Level Transition Speed: Reset game loop timer after blocking animations in
ConsoleFrontend. -
Fixed MonoGame Level Cleanup: Ensured
TetrisBlocksandSpecialFoodPositionsare cleared inLevelManager. -
Prevented 180-Degree "Suicide" Turns:
-
Implemented
DirectionQueueinGameState. -
Updated all
IInputHandlerimplementations to validate and buffer inputs. -
GameEnginenow dequeues one valid move per logical tick.
-
-
Enhanced Engine Robustness: Added frame-clamping to
Tick()to prevent speed-bursts after lag spikes.
-
Input Handling: Now follows a "Producer-Consumer" pattern. Input handlers produce directions into a queue; the engine consumes them. This makes the game feel much more responsive and eliminates input-based bugs.
-
State Management:
LevelManageris now the central authority for cleaning up level-specific state during transitions.
- Settings Persistence: Expand settings to include sound volume and window sizes.
- Multiplayer: Support for local or network-based competitive play.
- Advanced AI: Improve Tron AI to use better pathfinding (A*).
- Unit Tests: Implement comprehensive tests for game logic and level strategies.