Breakout-like

Inspired by the legendary game of breaking bricks with a ball, Breakout, a game created entirely in OpenGL!

Using the libraries GLAD, GLFW, GLM, Irrklang and Freetype. Following the fabulous tutorial from: https://learnopengl.com/In-Practice/2D-Game/Breakout

GitLab repository available at: https://gitlab.com/jongompal/ch3-pg-final-project-in-opengl

Important characteristics of the project

Programming Challenges

  1. Configuration and Libraries:
    • I found problems with freetype due to differences in the structure of the project.
    • I solved problems with the naming of shaders files (changed sprite.fsto sprite.frag) and corrected the function getShaderto handle references correctly.
  2. Object Oriented Programming (OOP):
    • I started to modularize the project by creating reusable classes, like the Text Renderer .
  3. Smart Pointers:
    • Resolved compiler conflicts related to Game::~Gameand memory management with smart pointers .
  4. Power-Ups Mechanics:
    • Fixed issues with power-ups not restarting when restarting the game.
    • I adjusted the spawn rates to improve the game experience.

Gameplay Decisions

  1. Sprites and Visual Design:
    • I replaced the ball sprite with a custom chicken sprite.
    • I created a custom texture for the “second chance” power-up , using a heart symbol.
  2. New Power-Up: Second Opportunity:
    • Added a modifier that allows the ball to touch the bottom of the screen once without missing.
    • This power-up has a visual effect that includes a green gradient in post-processing.
  3. Game Difficulty Balance:
    • I adjusted the appearance rates of power-ups to facilitate the overcoming of levels.
    • I increased the height of the palette and the size of the screen to accommodate progress bars and visual effects of the power-ups .
  4. Simplified Level Progression:
    • I replaced the selection of levels by a progressive system (levels from 0 to 4).
    • I implemented the logic to advance to the next level when all the bricks are destroyed.
  5. Level Progression:
    • I implemented progressive levels (from 0 to 4) and simplified the game states ( GAME_ACTIVEGAME_WINGAME_LOSE).
    • I decided not to include lives for a more challenging and progressive experience.

Notable Additions and Decisions

  • Added a progress bar at the bottom of the screen that shows how much time is left for an active power-up to finish . If there is more than one, they are stacked on top of each other and use the corresponding color to differentiate them. ( Important note: the speed and palette size effects are cumulative and do not have a time bar ).
  • For the extra power-up , I decided to implement a “second chance” modifier. This power-up allows the ball to touch the bottom of the screen once without restarting the game. I also designed a texture for the sprite with a heart and added a post-processing effect that generates a green gradient from the bottom, with a “multiply” blending option to show that it is enabled.
  • In addition, I added text rendering functionality.

References

  • Laelath. (n.d.). OpenGL-Project/OpenGL-Project/.gitignore at master · laelath/OpenGL-Project. GitHub. Repository .
  • OpenAI. (2024). ChatGPT (December 18th version) [Language model]. platform
  • Conversation with ChatGPT to solve compilation errors, contribute ideas and clean code: Link 1 and Link 2 .
en_USEnglish