Making a Game using C++ and SFML
Introduction
This is a fully featured 2D game about defending your planet from a onsalught of deadly asteroids. I made this as my semester end project for OOP using C++ and the SFML library for low-level access to hardware components.

About SFML
SFML or “Simple and Fast Multimedia Library” is a multi-platform (Windows, iOS, and Linux) and multi-language (C, C++, Java, Ruby, etc.) library that provides us with an interface to access the components of our PC. These include keyboard and mouse inputs, audio, graphics, and network. These features allow us to develop games and Multimedia applications.
About the game
Planet Defender is a space-themed video game in which the players take on the role of a fighter pilot who must protect the asteroid shield of their planet, from an onslaught of deadly asteroids.
The game is easy to learn, but very fast paced, so it provides a immersive and challenging gameplay experience. The players must learn to use their quick reflexes to destroy the asteroids and avoid them for survival.
During the gameplay, the players control the spaceship using the keyboard. The are equipped with a powerful weapon and a shield for the planet. The objective is to shoot down the incoming asteroids before they collide with the planet causing damage. The player must balance the health of their ship and the planet to survive until help arrives. The game loop is infinite and the difficulty scales linearly. They will encounter faster asteroids as time progresses.

Heath pools
- The player has a distinct HP bar
- The enemies chage color as they take damage and eventually die
- The shield at the bottom of the screen also changes color as it runs out of energy until it eventually fails as well
Ways the game can end
- Either the player’s HP reaches zero.
- Or the shield runs out of energy.
Conclusion
As this was done as an assignment with guidelines to use C++, I couldn’t use a mainstream game engine like Unity or Godot as they don’t have native support for C++. My next objective is to learn either Unity or Godot and make a full 2D using either one of them.
You can find the latest release and source code in GitHub.