CSD 3.27 Why is the score not showing? Help!

@langilla1,

The link isn’t working. It says this project isn’t available for sharing. I’m not sure if the link is incorrect or it is correct, but sharing was removed from the account? Can you see if it is the right link or make sure you’ve shared using the “share” button and we’d be happy to look at it.

Mike

https://studio.code.org/projects/gamelab/4LiVjJ1NtxJiZ4gZzoWVLEx15FnYyrddJ0xPFxFPAHQ

@langilla1,

In line 22, you are calling the function Score (capital S), but the function is called “score” (lower-case ‘s’). javascript sees those as different names. Use either lower or upper case, but make sure it matches and your program should work!

Good luck!

Mike

I tried that and what happens is I get this error at line 22 :"

ERROR: Line: 22: TypeError: score is not a function

@langilla That’s what I saw when line 22 was Score and line 32 was score. If you make them both exactly the same (score, score or Score, Score), it should work. It did for me, but if you try it and it still isn’t working, let me know and I will investigate further.

thanks!

Mike

I tried that again and I get the same error when I get to line 22 that tells me that score is not a function.

https://studio.code.org/projects/gamelab/9UVXzvA8cy2fII9XM1Y_hfrAN18wRDdINqhqkxNCs9w

Ok… @langilla1,

There is also something else going on here … you have both score and Score in your program already.

score, you declared to be a variable to track the score.

Then, you made the function Score (to figure out when to add a point).

The key is to look at every time you use the word score and see if it is referring to the points (score) or the function to track the points (Score).

Here’s a link that works when I looked at every use of the word and made sure they were all referring to the correct object. Game Lab - Code.org

To avoid confusion, you could rename one of them, so you use points instead of score or rename the function to something like “updateScore” instead of Score.

Good luck!

Mike