Closed shuzel99 closed 3 years ago
I lied. There's an error message that says newScore isnt defined
Ah ok! So you're going to want your newScore set to zero since we're adding points to it!
I want the initial amount of points to be 30 then add to 10 more points once a collision is detected
Your interpolation (so it alters the HTML element and renders) should look something like this: Points: ${newScore}
(in back tics)
You can set your starting point to 30. That's fine!
I tried the interpolation like that before and nothing renders, not even the fruits
What's the problem you're trying to solve?
I want my game to start out with an initial 30 points and add an additional 10 points per collision
Post any code you think might be relevant (one fenced block per file)
If you see an error message, post it here. If you don't, what unexpected behavior are you seeing?
There's no error message but the Points in the game remain at 30. When I try to incorporate the 'newScore' variable into the pointsUpdate nothing in the game shows up at all.
What is your best guess as to the source of the problem?
not sure yet
What things have you already tried to solve the problem?
tried incorporating newScore in a couple different ways including ${newScore} with & without backticks into the pointsUpdate