How ringtailsoftware/zigtris works
Main Components
a) Core Game Components:
• Main Game Loop (src/main.zig)
• Player Controller (src/player.zig)
• Stage Manager (src/stage.zig)
• Debris System (src/debris.zig)
• Decor Handler (src/decor.zig)
• Time Controller (src/time.zig)
• System (src/display.zig)
┌─ User Interface Layer ─────────────────┐
• Terminal Display │
• (via mibu library) │
• ┬───────────────────┘
• ↑
┌─ Display Layer ────────────────────────┐
• Display Component │
• (Double-buffered rendering) │
• ┬───────────────────┘
• ↑
┌─ Game Logic Layer ─────────────────────┐
• ┌─────────┐ ┌─────────┐ ┌─────────┐ │
• Player │ │ Stage │ │ Debris │ │
• ┘ └─────────┘ └─────────┘ │
• ┌─────────┐ ┌─────────┐ │
• Decor │ │ Time │ │
• ┘ └─────────┘ │
• ┬───────────────────┘
• ↑
┌─ System Layer ────────────────────────┐
• Main Game Loop │
• (Input Processing) │
• ┘
Component Relationships to Highlight
• System (display.zig):
• As a wrapper around the mibu terminal library
• Double-buffering mechanism with two buffer states
• Stage Component (stage.zig):
• Relationship with Player and Debris components
• Player Component (player.zig):
• Movement logic flow
• To Stage for rendering
• To Debris for collision detection
• Debris System (debris.zig):
• Connection to Stage for rendering
• Line completion detection logic
• To Player for collision checking
Additional Elements
• Version compatibility note (Zig 0.14.0)
• Entry points (both direct and SSH service)
Remember to indicate the build and deployment options (Docker, SSH service) as external wrapper elements around the main architecture, as they represent different ways to run the same core system.