Moving logic to detect whether the ball has hit the top of the play area
into dedicated function