Last active
October 3, 2022 00:20
-
-
Save rahji/49ec40aba93a89eb1f3604a9f7176b1a 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
ctx = Graphics.two() | |
let x = 0 | |
onframe = function(timestamp) { | |
const w = Graphics.canvas.width, h = Graphics.canvas.height | |
ctx.strokeStyle = 'green' | |
ctx.clearRect( 0,0,w,h ) | |
const size = 300 | |
ctx.save() | |
ctx.setTransform(1,0,0,1,Math.random()*100+300,Math.random()*100+300) | |
ctx.rotate(x) | |
ctx.strokeRect( -size/2, -size/2, size, size) | |
ctx.restore() | |
x += .01 | |
requestAnimationFrame( onframe ) | |
} | |
onframe() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment