Skip to content

Dorshir/Arkanoid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Arkanoid

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.


🎮 Overview

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:
    • ResourceManager for textures/fonts
    • ScoreManager for score/lives
    • HighscoreManager for load/save of highscores
    • CollisionDetector for simple bounding-box overlap
  • Sandbox Demo: particle/box simulation for testing

📂 Repository Layout

- 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

🛠️ Requirements

  • SFML (Graphics, Window, System modules)
  • C++17-capable compiler
  • On Windows:
    • Visual Studio (link SFML), or
    • MSYS/MinGW using provided Makefiles in /tests

🚀 Build & Run

Prepare Resources

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)

Build & Run (MSYS/MinGW example)

cd tests/game
make
./game.exe

Demos

  • Main game: tests/game/game

🏗️ Architecture & Components

Core Systems

  • 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
  • LevelOne

    • Encapsulates Paddle, Ball, and Bricks
    • Updates positions, handles collisions, removes bricks, awards points
  • HighscoreManager

    • Stores scores in binary file resources/top10.dat
    • Keeps sorted top-10 with tie-breaking by recency

Game Objects

  • Ball: movement, wall bounce, paddle stick/launch
  • Paddle: player movement with bounds check
  • Brick: simple destructible objects

Utilities

  • Displayer: simple text rendering wrapper
  • CollisionDetector: bounding box intersection checks
  • ScoreManager: tracks lives and score

📊 Data & Persistence

  • Highscores saved in resources/top10.dat as fixed binary struct: bash struct HighscoreEntry { char name[32]; uint32_t score; uint64_t time_ms; };

  • Assets (images, fonts) loaded from resources/ on startup.

About

Arkanoid-style brick breaker game in modern C++17 with SFML, featuring scenes, resource management, collisions, and highscores.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors