How wa1kingr3d/tetris-v1 works
This is a small SFML Tetris game. The main workflow is the window loop dispatching input and updates to Game, which manages play state, falling and queued tetrominoes, collision and board-clearing rules, scoring, and game-over handling; it then draws the game. Supporting components provide board storage, piece geometry, text, music, and persistent high scores. The source excerpts show the core gameplay and some rendering and persistence behavior; details of unsampled implementation are not inferred.
Main entry points: game.cpp Game Controller · tetris.cpp Window Loop · theMatrix.cpp Board Matrix · musicController.cpp Music Controller
Components 13
Game Runtime
- Window Loop
tetris-v1/tetris.cpp - Game Controller
tetris-v1/game.cpp
Gameplay Model
- Game Rules
tetris-v1/game.cpp - Tetrominoes
tetris-v1/tetromino.cpp - Board Matrix
tetris-v1/theMatrix.cpp - Shared Types
tetris-v1/globalTypes.h - Game Constants
tetris-v1/constants.h
Presentation
- Game Display
tetris-v1/game.cpp - Text Rendering
tetris-v1/text.cpp - Music Controller
tetris-v1/musicController.cpp - Music Tracks
tetris-v1/music
Persistence
- High Score File
tetris-v1/highScore.txt
Other components
- Player
Connections 14
- Player → Window Loop: plays
tetris-v1/tetris.cpp - Window Loop → Game Controller: dispatches input
tetris-v1/tetris.cpp - Window Loop → Game Controller: updates
tetris-v1/tetris.cpp - Window Loop → Game Controller: draws
tetris-v1/tetris.cpp - Game Controller → Tetrominoes: creates pieces
tetris-v1/game.cpp - Game Controller → Board Matrix: creates board
tetris-v1/game.cpp - Game Controller → Game Rules: runs rules
tetris-v1/game.cpp - Game Rules → Board Matrix: reads and clears
tetris-v1/game.cpp - Board Matrix → Tetrominoes: plots piece
tetris-v1/theMatrix.cpp - Game Controller → Game Display: renders screen
tetris-v1/game.cpp - Game Display → Text Rendering: draws labels
tetris-v1/game.cpp - Game Controller → Music Controller: sets tracks
tetris-v1/game.cpp - Music Controller → Music Tracks: opens audio
tetris-v1/musicController.cpp - Game Controller → High Score File: reads and writes
tetris-v1/game.cpp