Yassir Chebaa

Eager software engineer with a BSc in Computer Science. C++ and Rust enthusiast, always learning.

  • Posts
  • About
  • Contact
  • GitHub
  • LinkedIn

Doodle Jump

done2023-11-24Source

  • c++
  • sfml
  • cmake
  • game
  • design-patterns
  • university

A Doodle Jump clone in C++17 and SFML, built for the Advanced Programming course with a strict split between game logic and rendering.

Why

The project for the Advanced Programming course (2023-2024): rebuild Doodle Jump in C++, with the focus on clean architecture rather than the game itself. The game logic had to be a standalone library that knows nothing about SFML, so the renderer could be swapped without touching it.

The original repository lived in the course’s GitHub organization and couldn’t be made public, so the code is republished without its commit history.

How it works

Game (SFML window, loop at 144 FPS)
 ├── ConcreteFactory ──> creates model + view pairs
 │      Player / Platform / Bonus / BGTile   (logic library, no SFML)
 │        └── notify() ──> EntityView        (SFML sprite or shape)
 │                     └─> Score
 └── Camera ──> scrolls with the player, recycles off-screen entities
  • Logic library: Player, four Platform types, Bonus, background tiles and Score. Pure C++, built as its own CMake target.
  • Game library: the SFML views, the camera and the game loop. Views observe their model and redraw when it changes.
  • Fallback rendering: if a sprite is missing, the game still runs with SFML-generated shapes.

Design patterns

PatternWhere
ObserverModels are subjects; views and the score observe them
Abstract FactoryAbstractFactory in logic, ConcreteFactory in the game creates each model with its view attached
SingletonRandom, StopWatch (frame delta time) and Logger

Gameplay

  • Move left and right with the arrow keys; gravity and jumping are automatic.
  • Platforms: static (green), horizontal (blue), vertical (yellow) and temporary (white, breaks after one jump).
  • A boost bonus launches the player higher.
  • Leaving the screen sideways wraps the player to the other side, with a random colour.
  • Falling off the bottom ends the game and shows the score.

Known limits

  • Bonuses spawn independently instead of on top of platforms.
  • On the very first launch the window position is sometimes off; restarting fixes it.
  • A screen shake at certain scores is only half implemented.

Stack

  • Language: C++17.
  • Graphics: SFML 2.5 (graphics, window, system).
  • Build: CMake, with an ENABLE_LOGGING option; CircleCI builds it on Ubuntu 22.04.
  • Style: clang-format.

Links

  • SFML
OlderSemiconductor SequencingNewerScaler 3 at KoalaDSP
All projects

Source codeQuestions about this project? Contact me

Disclaimer|Privacy Policy