Skip to content

Instantly share code, notes, and snippets.

@nekonesse
Last active April 20, 2020 03:44
Show Gist options
  • Save nekonesse/88dbc941ca06894b8db2c46e4cf81d0e to your computer and use it in GitHub Desktop.
Save nekonesse/88dbc941ca06894b8db2c46e4cf81d0e to your computer and use it in GitHub Desktop.
SCRIPT-8
init = state => {
state.angle = 0 // the rotation angle
}
update = (state, input, elapsed) => {
state.angle = state.angle + elapsed / 5000000000
}
draw = (state) => {
clear()
const { angle } = state
const topLeft = [36, 36]
const topRight = [70, 36]
const bottomRight = [70, 91]
const bottomLeft = [36, 91]
const topleft = [35, 90]
const downleft = [20, 63]
const topright = [84, 63]
const downright = [84, 63]
polyStroke([topLeft, topRight,topright,downright, bottomRight, bottomLeft, topleft, downleft,], angle, 1)
}
{
"iframeVersion": "0.1.280",
"lines": [
21,
0,
0,
0,
0,
0,
0,
0
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment