My student is trying to get the code “Presents Collected” to go away when the YOU WIN!! shows. Is there a way to do this?
To fix this issue, you have to return the function which only takes one line of code.
Basically what I’m saying is that all you have to do is this.
I have marked it with “^” so that you know I have changed something in the code.
if (PresentsCollected == 3) {
background2();
return Score;
// ^^^^^^^^
} else {
background1();
}
This will return everything from the function.
I hope your class does well!
1 Like