02 - Moving the Ball/script.js
//main loop that runs around 60 times per second

main loop that runs around 60 times per second
main loop that runs around 60 times per second
function mainLoop() {
    ctx.clearRect(0, 0, 640, 480);
    move();
    drawBall(x, y, 20);
    requestAnimationFrame(mainLoop);
}
function mainLoop ( ) { ctx . clearRect ( 0 , 0 , 640 , 480 ) ; move ( ) ; drawBall ( x , y , 20 ) ; requestAnimationFrame ( mainLoop ) ; }
main loop that runs around 60 times per second
main loop that runs around 60 times per second