Use the Left and Right arrow keys to move the ball. The up key stops the ball. Feel free to copy the script, or remix, and turn it into your project.
Credit to JS_Coder, as this would not be possible without them.