How juliannicholls/flood-cpp works
Flood Puzzle is a Raylib implementation of Simon Tatham’s color-flood game. The player clicks a grid color; the game expands the top-left region to that color, animates the change, tracks moves and time, and detects completion. The sampled game code shows the game coordinating grid updates, sound, background imagery, and the exit button. The tree identifies the executable entry point, but its source was not sampled, so entry-point wiring is not shown. Image loading and resource definitions are represented only where sampled code documents their use.
Main entry points: game.cpp Game loop · block_grid.cpp Flood grid · animated_block.h Animated blocks · button.cpp Exit button
Components 10
Game flow
- Flood executable
flood.cpp - Game loop
game.cpp
Board logic
- Flood grid
block_grid.cpp - Animated blocks
animated_block.h - Game constants
resources.h
Presentation
- Exit button
button.cpp - Image loader
images.cpp - Game assets
assets
Runtime services
- Raylib
Other components
- Player
Connections 12
- Player → Flood executable: starts game
- Game loop → Flood grid: updates and draws
- Flood grid → Animated blocks: updates and draws
- Flood grid → Game constants: uses dimensions
- Game loop → Exit button: updates and draws
- Game loop → Image loader: constructs loader
- Game loop → Game assets: loads background and sound
- Image loader → Game assets: loads images
- Game loop → Raylib: plays sound, draws
- Flood grid → Raylib: reads mouse input
- Animated blocks → Raylib: draws blocks
- Exit button → Raylib: reads input, draws