# Increase score debug help

**URL:** <https://forum.code.org/t/increase-score-debug-help/34784>\
**Category:** Coding and Debugging Help\
**Tags:** csd-unit-3\
**Created:** [June 3, 2021, 4:38pm UTC](https://forum.code.org/t/increase-score-debug-help/34784 "2021-06-03T16:38:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![GordonBrune](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/gordonbrune/32/4752_2.png) [@GordonBrune](https://forum.code.org/u/GordonBrune)\
**Post date:** [June 3, 2021, 4:38pm UTC](https://forum.code.org/t/increase-score-debug-help/34784/1 "2021-06-03T16:38:09Z")

</div>

Newbie CS teacher debug help AGAIN!  
Anyone help with a student’s problem with this game.

> [Code.org](https://studio.code.org/projects/gamelab/_FYrF3SNmNzqAzB71WS66owvFhrDr4NC06W8uKWmT_Q/edit)

The score does not increase for any player when the ball leaves the screen. In lines 33 & 42 he has two IF conditionals so when the ball’s X position is more than 400 or less than 0 the score should increase. But the score does not increase.  
Any ideas?  
Thank you in advance!

---

<div class="post-metadata">

**Author:** ![letti42](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@letti42](https://forum.code.org/u/letti42)\
**Post date:** [June 4, 2021, 2:36am UTC](https://forum.code.org/t/increase-score-debug-help/34784/2 "2021-06-04T02:36:42Z")

</div>

Hello, @GordonBrune -  
I’d love to help, however it seems your link redirects to [studio.code.org](http://studio.code.org) instead of a project!

---

<div class="post-metadata">

**Author:** ![mwood](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/mwood/32/4941_2.png) [@mwood](https://forum.code.org/u/mwood)\
**Post date:** [June 4, 2021, 5:32am UTC](https://forum.code.org/t/increase-score-debug-help/34784/3 "2021-06-04T05:32:00Z")

</div>

@GordonBrune

A few issues I see …

line 34 … a variable is being declared with var for a 2nd time. It should only be declared once.

I turned on the watchers and the ball position never gets below 0 or above 400, so the score changes are never happening. When I change it to less than 2 or more than 390, I can get it to work.

Lastly, your scores on the screen are not displaying the actual score, but rather just the text “0”, so even when I got the scores to work in the watcher, the display wasn’t changing because it is hard coded to display 0.

Hopefully this gives you some ideas to start with.

Good luck!

Mike
