Getting Score to Work

My students are trying to get their score to change when they move the black meteor to move. This is kind of like the Defend the Cake game. If the rock falls below the bottom of the screen, then the player loses 5 points. If the spaceship moves the black meteor off to the left or right of the screen then they gain 5 points. Here is their code:
Thanks from a first year CS Discoveries teacher. :slight_smile:


What I think is happening is that the code is resetting the asteroids before it is giving the points. I might suggest moving the scorecount function above the asdestroyed function inside the draw loop to see if that helps. It might even be better to put the scorecount function inside the asdestroyed function at a strategic location so right before it resets the asteroid, it scores the points.

Hope that helps!