Skip to content

Instantly share code, notes, and snippets.

@JohnnyTseng
Created October 7, 2015 11:55
Show Gist options
  • Save JohnnyTseng/d77196f55a6c539474d7 to your computer and use it in GitHub Desktop.
Save JohnnyTseng/d77196f55a6c539474d7 to your computer and use it in GitHub Desktop.
function draeEverything(){
console.log(ballx);
canvasContext.fillStyle = 'black';
canvasContext.fillRect(0,0,canvas.width,canvas.height);
canvasContext.fillStyle = 'while';
canvasContext.beginPath();
canvasContext.arc(ballx,bally,10,0,Math.PI*2,true);
canvasContext.fill();
}
function moveEverything() {
if (ballx<0 || ballx>canvas.width )
ballSpeedx = ballSpeedx *-1;
ballx += ballSpeedx
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment