How skytree33157/tetris works
This repository is a Java Tetris game. Its main workflow is entering through the start menu, starting a game, moving and locking blocks on the board, applying item effects, and updating score and game state; game-over and scoreboard screens use persisted score records. The graph includes documented menu, settings, rendering, and item capabilities, but some UI and loop implementations were not sampled, so their connections are shown only where supported or left out.
Main entry points: StartMenu.java Start menu · ActionController.java Action controller · BlockFactory.java Block factory · GameController.java Game controller
Components 27
App and menus
- Application entry
src/app/Main.java - Start menu
src/menu/StartMenu.java - Game screen
src/menu/GameScreen.java - Pause screen
src/menu/PauseScreen.java - Game-over screen
src/menu/GameOverScreen.java - Scoreboard screen
src/menu/ScoreboardScreen.java - Settings screen
src/menu/settings/SettingsScreen.java
Game runtime
- Game controller
src/game/GameController.java - Action controller
src/game/ActionController.java - Game loop
src/game/GameLoop.java - Game state and levels
src/game/GameStateManager.java - Board and line clears
src/board/Board.java
Blocks and items
- Block model
src/blocks/core/Block.java - Block factory
src/blocks/core/BlockFactory.java - Tetromino shapes
src/blocks/tetromino - Difficulty rules
src/difficulty/Difficulty.java - Item registry
src/item/core/ItemRegistry.java - Item effects
src/item/types
Rendering and settings
- App settings
src/menu/settings/AppSettings.java - Item appearance resolver
src/ui/ItemAppearanceResolver.java - Block renderer
src/ui/BlockRenderer.java - Block preview
src/game/BlockPreviewPanel.java - Block styles
src/blocks/style/BlockStyle.java
Scores and records
- Score calculation
src/score/ScoreManager.java - Score storage
src/storage/ScoreStorage.java - Score record
src/menu/ScoreRecord.java
Other components
- Player
Connections 31
- Player → Start menu: opens
- Application entry → Start menu: launches
src/app/Main.java - Start menu → Game screen: opens
src/menu/StartMenu.java - Start menu → Scoreboard screen: opens
src/menu/StartMenu.java - Start menu → Settings screen: opens
src/menu/StartMenu.java - Game screen → Game controller: uses
- Game controller → Action controller: delegates
src/game/GameController.java - Game controller → Game loop: starts
src/game/GameController.java - Game controller → Game state and levels: uses
src/game/GameController.java - Action controller → Board and line clears: checks and updates
src/game/ActionController.java - Action controller → Block factory: spawns blocks
src/game/ActionController.java - Action controller → Score calculation: updates score
src/game/ActionController.java - Action controller → Game state and levels: updates state
src/game/ActionController.java - Block factory → Tetromino shapes: creates shapes
src/blocks/core/BlockFactory.java - Block factory → Item registry: creates items through
src/blocks/core/BlockFactory.java - Block factory → Difficulty rules: weights selection by
src/blocks/core/BlockFactory.java - Item registry → Item effects: registers creators
src/item/core/ItemRegistry.java - Item registry → Block factory: uses creators from
src/item/core/ItemRegistry.java - Board and line clears → Item appearance resolver: decodes markers with
src/board/Board.java - Item appearance resolver → Item registry: resolves item styles via
src/ui/ItemAppearanceResolver.java - Block renderer → Item appearance resolver: resolves cells with
src/ui/BlockRenderer.java - Block renderer → Block styles: uses
src/ui/BlockRenderer.java - Block preview → Block renderer: renders blocks with
src/game/BlockPreviewPanel.java - Block preview → App settings: reads
src/game/BlockPreviewPanel.java - Settings screen → App settings: configures
src/menu/settings/SettingsScreen.java - Scoreboard screen → Score storage: loads records from
src/menu/ScoreboardScreen.java - Scoreboard screen → Start menu: returns to
src/menu/ScoreboardScreen.java - Game-over screen → Score storage: saves records through
src/menu/GameOverScreen.java - Game-over screen → Scoreboard screen: opens
src/menu/GameOverScreen.java - Game-over screen → Start menu: returns to
src/menu/GameOverScreen.java - Score storage → Score record: reads and writes
src/storage/ScoreStorage.java