HTML and CSS Reference
In-Depth Information
context = canvas.getContext('2d'),
ball = new Ball(),
start_time = new Date().getTime(),
time = getTimer(),
vx = 300,
vy = -300,
bounce = -0.7;
ball.x = canvas.width * Math.random();
ball.y = canvas.height / 2;
function getTimer () {
return (new Date().getTime() - start_time); //milliseconds
}
(function drawFrame () {
window.requestAnimationFrame(drawFrame, canvas);
context.clearRect(0, 0, canvas.width, canvas.height);
var elapsed = getTimer() - time,
left = 0,
right = canvas.width,
top = 0,
bottom = canvas.height;
time = getTimer();
Search WWH ::




Custom Search