Game Information
- Language: C++
- Graphics API: OpenGL
- Creation: Summer 2020
- Source URL: GitHub Page
Sonic Breakout
Created as a summer project, this game is based on the LearnOpenGL Breakout game. After following the tutorials and creating the basic game, I decided to add more features, while also implementing a Sonic theme to make it more fun and interesting. The game was created in OpenGL and incorporates a number of techniques such as collision detection and resolution, a particle system and postprocessing.
How the Game was Developed
The base game was created by following the tutorials on the LearnOpenGL website. This covered player input, sprite rendering, level maps, collisions, postprocessing, a particle system and more. Collision detection/resolution was likely the most complex technique to implement. AABB, or axis-aligned bounding box, collisions were required for the blocks but as for the ball, to ensure accuracy, a circular AABB variant was required. This solution required more work, with a different approach to collision repositioning to prevent the ball from passing through blocks unintentionally.
// AABB collision example bool collisionX = one.Position.x + one.Size.x >= two.Position.x && two.Position.x + two.Size.x >= one.Position.x; bool collisionY = one.Position.y + one.Size.y >= two.Position.y && two.Position.y + two.Size.y >= one.Position.y; // return true if collision occurred on both axes return collisionX && collisionY;The addition of a particle system was something that I had not previously implemented into a game. This was used to add a trial to the ball to make the game more visually interesting. Adding the power-ups was also quite fun as each one needed to affect the game in a different way. The 'confuse' and 'chaos' power-ups utilized postprocessing in a fun way to make the game harder to play. Aside from these features, sprite and text rendering, along with audio and level maps, are all implementations that I had worked with in previous projects.
Additional Features
In order to make the game more unique, I first decided to re-sprite the entire game using sprites from the original 'Sonic the Hedgehog,' with audio also taken from the original trilogy. Following this, I expanded upon the particle system, so that when a block is destroyed, the player is given another form of feedback. I also expanded upon the sprite rendering and implemented a few additional postprocessing effects. Further, I also added additional menus, such as the Help menu, which the player can access to receive more information on the various game elements.