When you think it's the right time, press the up arrow key. If you touch the hoop, you earn a point, if you earn 20, you can stop and win or get a high score.
I was playing basketball and thought of this.