A small Arkanoid-style brick breaker game written in modern C++17 using SFML.
The project demonstrates scene management, resource handling, basic collision detection, and highscore persistence, with a clean modular architecture.
Arkanoid is built around a scene-based architecture:
- Scenes: Opening, Game, Highscores
- Scene Manager: switches scenes and forwards updates/render calls
- Level Implementation:
LevelOne(paddle, ball, bricks, collisions) - Subsystems:
ResourceManagerfor textures/fontsScoreManagerfor score/livesHighscoreManagerfor load/save of highscoresCollisionDetectorfor simple bounding-box overlap
- Sandbox Demo: particle/box simulation for testing
- inc/ → Public headers (scenes, game objects, managers, utilities)
- src/ → Implementation (.cpp) files
- resources/ → Assets (fonts, images, highscores file)
- tests/ → Small test apps (main game, box/particles demo) + Makefiles- SFML (Graphics, Window, System modules)
- C++17-capable compiler
- On Windows:
- Visual Studio (link SFML), or
- MSYS/MinGW using provided Makefiles in
/tests
Ensure resources/ contains:
resources/fonts/(e.g.OpenSans-VariableFont_wdth,wght.ttf,ARCADECLASSIC.ttf)resources/images/(e.g.MainMenu.png,Level.png,Highscores.png,Ball.png)resources/top10.dat(created if missing)
cd tests/game
make
./game.exe- Main game:
tests/game/game
-
Scene / SceneManager
Scene: abstract base (init, render, handle_event, update)SceneManager: registers scenes, manages active scene
-
ResourceManager
- Loads fonts & textures on startup
- Throws on missing resource
-
GameScene
- Owns
LevelOne, ScoreManager, HighscoreManager - Handles pause/game over/win prompts, user input, and highscores
- Owns
-
LevelOne
- Encapsulates
Paddle,Ball, andBricks - Updates positions, handles collisions, removes bricks, awards points
- Encapsulates
-
HighscoreManager
- Stores scores in binary file
resources/top10.dat - Keeps sorted top-10 with tie-breaking by recency
- Stores scores in binary file
- Ball: movement, wall bounce, paddle stick/launch
- Paddle: player movement with bounds check
- Brick: simple destructible objects
- Displayer: simple text rendering wrapper
- CollisionDetector: bounding box intersection checks
- ScoreManager: tracks lives and score
-
Highscores saved in
resources/top10.datas fixed binary struct: bash struct HighscoreEntry { char name[32]; uint32_t score; uint64_t time_ms; }; -
Assets (images, fonts) loaded from
resources/on startup.