Increase score not working

Hi, everyone:

I’m a very novice coding teacher, trying to help my students resolve an issue in which the score in only intermittently increasing. The score will only increase when the player sprite is at the bottom edge of the screen. Even then, it only works intermittently.

I’ve tried searching the forums, but nothing I’ve found has helped solve this problem. Thanks in advance for any guidance you can offer.

Best regards,

Señor Cook

Could you change the visibility access, so we can see the project?

Hey, Pluto:

Thanks for your prompt reply. I’m such a novice that it took me a bit of time to even figure that out. You should now have access to the game.

Thanks again for your attention.

Best regards,

Señor Cook

I don’t know what your exact issue is, but I think you want the score to go up whenever the player touches the falling sprites. It’s a simple fix.

All you have to do is move the collectItems() function below scorePoints(). The reasoning behind this is because collectItems() changes the position of the falling sprites. If it’s before scorePoints(), it’ll move first, which means the player will never actually touch the falling sprites in scorePoints(), therefore no points will be added.

scorePoints(); //scores point if touching, first priority
collectItems(); //moves falling sprite, second priority

Thanks, Pluto. Your explanation was easy to follow and solved my issue straight away! Best regards to all!