top of page

SDL & C++ Game

SDL | C++ | 8 weeks | Solo Developer

Overview

This project is a 2D survival game built using a custom game engine developed in C++ with SDL. The goal for this project was to gain a deeper understanding of low-level systems and how core engine components work together.

bouncing.gif
Chasing.gif

Core Systems

In this project I developed all core systems of the engine and game, including:

 

* Rendering system using SDL

* Input handling and real-time game loop

* Collision detection and object interactions

* Enemy AI Behaviors (Player-tracking/bouncing)

* Dynamic coin spawning system

* Score system

Challanges & Design Decisions

One of the design requirements for this project was to create two variations of the game with some gameplay differences. To achieve this, I implemented two different enemy movement behaviors. One with enemies moving randomly by bouncing off walls and another where enemies actively track and move towards the player.

​

This approach allowed me to reuse core systems while still creating distinct gameplay experiences, and also gave me the opportunity to experiment with different AI behavior patterns.

Enemy AI Behaviors

The enemy system was designed with two different behavior types: a bouncing enemy and a player-chasing enemy. These were implemented as separate classes allowing for different gameplay variations.

​

A simple toggle was used to switch between the two behaviors making it easy to test and compare different gameplay styles.

Bouncing enemy: Moves in a straight direction and reverses velocity when hitting screen boundaries.

Chasing enemy: Calculates direction towards the player and moves using normalized vectors.

View on GitHub!

What I learned & What I would improve

Through this project I gained a better understanding of how different game systems work together, such as the game loop, collision handling and AI behavior.

​

I also learned how small changes in logic can affect gameplay, especially when working with different enemy behaviors like bouncing movement versus player-tracking.

​

Working in C++ and SDL gave me experience building systems from scratch, which helped me understand how game engines handle rendering, input and updates internally.

​

If i were to continue this project, I would:

​

* Improve the structure of the code to make it easier to expand

* Add more enemy types and behaviors to create more varied gameplay

​

bottom of page