2D Jumping Ball.

The Player will have 40 seconds to reach to the red bar on the top, the game will show WIN! if the ball makes contact with the red bar:

If no contact is made before the time reaches 0, the game will show GAME OVER.

I tried to use time-based movement first, but it will cause the sphere to go through the wall even with rigidbody and collider because it is “teleporting” the sphere rather than “moving” it with physics. So I change it into physics-based movement, bound with the sphere’s rigidbody.


I am using distance checking between the ball and the finishing line to determine the result of winning; If the ball reaches the finishing line before time runs out, there is a win, and the countdown stops, else if no contact was made and the countdown reaches 0, then there is a Game Over.
