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
- Combine the
Paddle,Ball, and brick grid from earlier lessons into a single game with one game loop running at a consistent framerate (usewindow.setFramerateLimit(60)and deltaTime). - Display the current score and remaining lives on screen every frame.
- 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. - Show "YOU WIN" once every brick has been destroyed.
- 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 flipxory. - 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! 🚀