Graphic JavaScript


Back to index
Ball Control

Your browser does not support the HTML5 canvas tag.

ASSIGNMENT:

The only thing the jquery script provides is a way for the JavaScript interpreter to make sense of the dollar sign which references the host page. Otherwise there's a way to rewrite the script so that the dollar sign is not necessary.

Your job is to find a way to speed up and slow down the ball. Also add the capacity for diagonal movement and to restart ball movement in whatever direction it was going before it was stopped. This will require that you activate five more keys and provide instructions to carry out these actions. Actually you could double purpose the space bar so that it starts when stopped and stops when the ball is moving.