The score in the game continued to increase because the player kept coming into contact with the object and the object didn't disappear after doing so. So, the score increased every time the player collided with the object.
We can fix the problem simply by telling the code to get rid of the object upon contact with the player and only increasing the score by 1 after doing so.
That is exactly the same thing I did.
ReplyDelete