Created
October 7, 2015 11:55
-
-
Save JohnnyTseng/d77196f55a6c539474d7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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