Just another BlockBreaker, with an in-game pause menu and lives

Hey and thanks for clicking!

This is just my go at the BlockBreaker game. I have to admit, I’ve learned a lot from the video and I think we all agree that this course is amazing! But it also really inspired me to try doing some things on my own and outside the scope of the videos. So here are a few improvements that you can try to build yourself:

  • Started by adding the lives system, which carry over from level to level (so no new lives when you finish a level).

  • Added the Pause Meniu. I guess this is by far the largest and most extensive one. It’s not that hard to implement and there are miriads of such tutorials online. There are a few tricks to getting it to work in this context but it was a lot of fun to figure them out an I have to say I learned a lot from doing it. Not guaranteeing, though, that it’s the right way to do it and something of the sorts is probably implemented in later videos (I only now finished the BlockBreaker part of the course so no idea really what’s ahead)

  • Added Toggle buttons for the Music and Sounds in the Pause Meniu. Pretty simple in theory but requires a little trickery to get them to keep changes you’ve made in pevious Levels/Scenes.

Try Game Here

So thanks again for reading and/or trying the game and hope you have fun and learn a lot from the course!


PS I accidentally added a similar thread in the BlockBreaker category, not realizing I should probably add it here. My bad. :sweat: Won’t happen again, I promise.


So, I’ve been trying to work on the issue pointed out by @David_Gibbs and I do believe I’ve reached a point where it’s a little bit better. The game will now no longer reset your mouse to the middle of the screen and you can now use the Arrow keys + Space button to play as well:

Try Version 2


There is however still a downside to this implementation that I am aware of, in that the paddle can sometimes not reach the farthest left corner when playing by mouse (it can still reach via the arrow keys), depending on where your paddle is as opposed to where the mouse is when the resume button is pressed. This issue happens since the game will always be displayed attached to the left side of the browser. I realize now that depending on there actually being more of the browser on each side of the game, rather than staying constrained in your own game-space might not be the way to go. Valuable lesson that. But at this point I suppose I might as well throw in the towel on this one and carry on with the course.

The game looks and sounds nice and plays well, but one big issue with the pause menu is that clicking the Resume button to exit snaps your paddle to the middle. This resulted in the loss of a life because when I paused my paddle was off to the right with the ball about to land on it. Not cool, grrrrr! :rage:

Hey! Thanks a lot for giving it a try! You’re right though, the resume button is annoying that way. Problem is the Update function instantly kicks in and moves the paddle to the position of the mouse, which, in this case is the center of the screen, since that’s where the button is. I’ll really have to find a way to work around this. I could alternatively use say the escape button to close the menu and resume but I suspect the problem still holds since one could still move the mouse in the meantime.

Sorry about the lost life though, you’ve got a round of drinks on me!

Privacy & Terms