Brick breaker not breaking bricks

I’m following the video on FreeCodeCamp’s YouTube page titled: Intro to Game Development with JavaScript - Full Tutorial

I’ve done everything up through the end of the chapter called Collison Detection with Bricks. The ball does bounce off the bricks, but the bricks do not disappear. Getting the bricks to disappear is the last step before continuing on to the next chapter, Pause Screen.

I’ve set the markForDeletion property in brick.js to be False by default, then True when a collision is detected. I’ve check the other code like 4 times over and looked at it for over an hour and a half. I can’t detect anything missing/incorrect. I think I need another set of eyes.

I hope it’s not a really silly mistake, but it probably is.

Here’s what I have in right now:

Nice game.

Took me a while, but looks like a typo… you call it markForDeletion in brick.js, markedForDeletion in game.js . Fixing that got your bricks to disappear.

Before that I did see the ball disappear into the bricks occassionally, but now that bricks disappear that might be a non-issue, just didn’t detect the bounce. Good luck continuing with your game:)

Ugh. That was it. Doh! CodeSandbox has been telling me if there are errors like unused or undeclared variables, and my eyes just slid right over this.

I can’t tell you how much I appreciate your time. Thank you, sir. May your next drive to work be 100% green lights.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.