You have a golf ball that you want to move with keyboard keys.You are given a Start Button that begins the game. To move the ball, appropriately update state variable ballPosition
. Ball should be positioned absolute.
Acceptance Criteria
- Ball should have className as
ball
- When Start button is clicked, the button should not be rendered and a ball should be rendered.
- When Right Arrow key is clicked on the keyboard, move the ball to the right by 5 pixel
- EventListener should handle keydown event with options {key:ArrowRight, keyCode:39}.