top of page
Tamer Ibrahim
SDL PROJECTS
These are games I have developed using the SDL2 library and C++
2025

BRICK BREAKER
This game is a remake of the original Brick Breaker.
The game only features a single level but includes brick difficulty. You have only three lives to complete the level.
COLLISION, BOUNCE AND
STREAKS
Collision
The ball interacts with bricks, barriers, and the player paddle. The bounces and reflections behave naturally, with angles shifting accurately depending on the impact surface.
Edge-Collision
The ball reacts well to edges and deciding what direction to reflect effectively, mainly due to a tolerance value in the code that adds a realistic touch.
Streak
The score will be multiplied by a constant value for each brick hit until it touches the player.
GAME DIFFICULTY
BRICK DIFFICULTY
The first row of bricks requires three hits to disappear, the second row needs two hits, and the third row vanishes after a single hit.
RANDOM BALL MOVEMENT
​There's a 30% chance that when the ball hits the player, it'll change direction randomly to keep the game unpredictable and prevent it from moving the same way every time.
CODE SNIPPETS
GAMEOBJECTS

Game objects like the player paddle, barriers, ball, and bricks all inherit from the GameObject class, which includes methods like Update, OnHit, Death, and more.


When game objects are created, they are added to the GameObjectRegistry, making it easy to access them and call the Update method.

The GameObjectRegistry makes it easy to remove a brick from the level once it has been hit.
RENDERING

SCREEN_STATES is an enum that contains all the menu states.

During the update loop, the game checks the current screen state to determine how to render the UI.
Base Screen Menu

Game

All menus inherit from the BaseMenu class, allowing easy customization by overriding methods like RenderText, HandleUI, OnScreenActivate and OnScreenDeactivate.
MainMenu

Retry Menu

In the constructor, you can initialize text elements, fonts, text size, text position audio, and more.
Event UI Manager

The menus can subscribe to an event, making it easy to control when certain sounds, texts, or logic appear, disappear, or activate upon screen activation or deactivation.
bottom of page