DEBUG HELP! CS Discoveries 2019-2020 Unit 3 Animations and Games Lesson 19 Bubble 12

DEBUG HELP!!! CS Discoveries 2019-2020 Unit 3 Animations and Games Lesson 19 Bubble 12

: Hi! My student keeps receiving an error message and we can’t figure it out!!!

Hi @erose!

The error cleared when I changed line 7 bac2.visible=setCoin(); to bac2.visible = false;. The .visible property is either only true or false. It can’t be set to a function call. I think that caused the program not to initialize the coin sprite and therefore generated the “undefined” error. I also had to add a default velocityY to the coin. Although the setCoin() function adds a velocityY, take a look at the conditions required for the setCoin() function to run (and therefore set a velocityY on the coin)? Let us know if you have trouble getting the coin moving:)

Hope that helped!
~Michelle

Awesome - thank you!