How muhammadthaufiq95/elementfusion works
This repository is a browser-based element-fusion falling-block game. The player uses keyboard or touch controls to move and drop elements; the game resolves board gravity and fusions, tracks score and discoveries, and emits hooks that drive the HUD, visuals, and audio. Local storage preserves discoveries, best score, and mute preference. The graph follows the sampled entry point and core modules; the board implementation and some UI details were not excerpted, so their internal links are limited to relationships visible in the index or callers.
Main entry points: main.js App orchestration · config.js Game configuration · game.js Game state machine · renderer.js Canvas renderer
Components 16
Game entry
- App orchestration
js/main.js - Game configuration
js/config.js - Keyboard and touch
js/ui/input.js
Game rules
- Game state machine
js/core/game.js - Board state
js/core/board.js - Fusion and spawn rules
js/core/fusion.js - Scoring and records
js/core/score.js - Element catalogue
js/data/elements.js
Player presentation
- Canvas renderer
js/ui/renderer.js - Visual effects
js/ui/effects.js - HUD and screens
js/ui/hud.js
Persistence and audio
- Audio manager
js/utils/audio.js - Sound assets
assets/sounds - Local storage helpers
js/utils/storage.js
Other components
- Player
- Browser local storage
Connections 29
- Player → Keyboard and touch: controls
- App orchestration → Game state machine: creates
js/main.js - App orchestration → Keyboard and touch: registers controls
js/main.js - App orchestration → Canvas renderer: creates and renders
js/main.js - App orchestration → Visual effects: updates effects
js/main.js - App orchestration → HUD and screens: updates HUD
js/main.js - App orchestration → Audio manager: plays audio
js/main.js - App orchestration → Game configuration: loads settings
js/main.js - App orchestration → Element catalogue: looks up elements
js/main.js - Keyboard and touch → Game state machine: dispatches actions
js/main.js - Keyboard and touch → Game configuration: reads dimensions
js/ui/input.js - Game state machine → Board state: updates board
js/core/game.js - Game state machine → Fusion and spawn rules: resolves fusions
js/core/game.js - Game state machine → Scoring and records: updates score
js/core/game.js - Game state machine → Local storage helpers: saves discoveries
js/core/game.js - Game state machine → Game configuration: reads rules
js/core/game.js - Scoring and records → Local storage helpers: loads and saves record
js/core/score.js - Scoring and records → Game configuration: reads scoring rules
js/core/score.js - Fusion and spawn rules → Game configuration: reads fusion limits
js/core/fusion.js - Canvas renderer → Element catalogue: looks up elements
js/ui/renderer.js - Canvas renderer → Game configuration: reads layout
js/ui/renderer.js - Canvas renderer → Visual effects: draws effects
js/main.js - HUD and screens → Canvas renderer: draws preview
js/ui/hud.js - HUD and screens → Element catalogue: looks up elements
js/ui/hud.js - Visual effects → Game configuration: reads fonts
js/ui/effects.js - Audio manager → Local storage helpers: loads and saves mute
js/utils/audio.js - Audio manager → Game configuration: reads audio settings
js/utils/audio.js - Audio manager → Sound assets: fetches audio
js/utils/audio.js - Local storage helpers → Browser local storage: reads and writes
js/utils/storage.js