Last active
May 26, 2018 07:15
-
-
Save movii/ec360767f40da3ab1a4ea85ff3fea06b to your computer and use it in GitHub Desktop.
This file contains 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
const loop = () => { | |
ctx.clearRect(0, 0, $canvas.width, $canvas.height); | |
let x = 125 + Math.cos(angle) * 100 | |
let y = 125 + Math.sin(angle) * 100 | |
ctx.fillStyle = "hotpink"; | |
ctx.beginPath(); | |
ctx.arc(x, y, 10, 0, getRads(360)); | |
ctx.closePath(); | |
ctx.fill(); | |
angle = angle >= 360 | |
? 0 | |
: angle + velocity | |
requestAnimationFrame(loop) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment