Game Problems-Help again

When the student moves to collect the coins the score does not go up. Also, when the student jumps onto the third platform the screen displays “You Win” for a couple of seconds and stops. Any help would be much appreciated.

@jmarro,

Hope all is going well with you!

Just a few things…

On line 2, of your code, you need the word “var” in front of score to declare the score variable. That’s why there is a yellow triangle out to the side of that line of code and next to all lines of code dealing with the score (and why the score isn’t working). It needs to be declared once and then updated everywhere else you use it (like with the collisions).

Also, in line 115, the display doesn’t really display the score anyway. It just displays “0”, so that would need to be fixed as well so it displays the score and not the number zero.

Then, the “You wins” text is being displayed when the jumper comes in collision with exitdoor3. It is in the top right corner, but it is being covered up by the background. The code tells it to display “you win” if the jumper is in contact with that exit door, but once it lands and is no longer in contact, the “you win” text and background disappear.

If this isn’t the intended behavior, they may need to remove that exit door (it’s there, even though it’s covered up) and/or figure out what else needs to happen to make the jumper win. (Does it have to have a certain score? Is there any other condition?).

Finally, if the “you win” is supposed to stick, they may want to change the code so it doesn’t show up just when it’s in contact. Maybe being in contact changes a variable called “winner” to being true and then there’s a separate function that tells the screen to turn black and display “you win” if the “winner” variable has been switched from false to true.

Just a few suggestions, but check back in if we can help any further!

thanks,

Mike