Build Breakout using C++ and SFML

Lesson 7 of 7

Final Project: Finish Your Breakout Game

You now have every piece: a paddle that responds to input, a ball that bounces off walls, a grid of bricks that break on contact, and score/lives tracking. Put it all together into a complete, playable game.

Requirements

  1. Combine the Paddle, Ball, and brick grid from earlier lessons into a single game with one game loop running at a consistent framerate (use window.setFramerateLimit(60) and deltaTime).
  2. Display the current score and remaining lives on screen every frame.
  3. When the ball passes below the paddle, lose a life and reset the ball above the paddle instead of ending immediately, only show "GAME OVER" once lives reach 0.
  4. Show "YOU WIN" once every brick has been destroyed.
  5. Add a simple start screen ("Press SPACE to start") shown before the game loop begins updating gameplay.

Stretch goals

  • Replace the simplified brick bounce (always flipping velocity.y) with proper side detection, compare the ball's previous position to the brick's edges to decide whether to flip x or y.
  • Make the paddle bounce affect the ball's angle based on where it hit the paddle (center vs. edge), instead of a fixed reflection.
  • Give brick rows different colors and point values, and add a basic sound effect for brick breaks with sf::SoundBuffer/sf::Sound.

Submit a link to your finished project (a repo or gist) below, an instructor will review it before you can mark this lesson complete. Good luck! 🚀

This lesson ends in a project. Build it on your own machine, there's nowhere to submit it here, but the brief above is everything you need.