Tips
Choose a point on the X axis, to the left of the player. We can use the collision detection that we discussed in the previous tutorial to check whether a rock exists in that place or not. Being behind the player means that the Teddy bear successfully jumped over it, otherwise it would have been destroyed.
Another implementation would be to count how many iterations of act()
have occurred. This would give you an idea of how long the player has survived.