Skip to content

Instantly share code, notes, and snippets.

@nekonesse
Last active April 16, 2020 01:35
Show Gist options
  • Save nekonesse/7d31591275d5e48ccc24b15909252f70 to your computer and use it in GitHub Desktop.
Save nekonesse/7d31591275d5e48ccc24b15909252f70 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 / 5
}
draw = (state) => {
clear()
const { angle } = state
const halfSide = 8 * i / 2
const topLeft = [64 - halfSide, 64 - halfSide]
const topRight = [64 + halfSide, 64 - halfSide]
const bottomRight = [64 + halfSide, 64 + halfSide]
const bottomLeft = [64 - halfSide, 64 + halfSide]
const middletop = [64 - halfSide, 64 - halfSide]
const middlebottom = [64, 64 ]
const color = i % 7
polyStroke([topLeft, topRight, bottomRight, bottomLeft, middletop, middlebottom], angle, color)
}
}
{
"iframeVersion": "0.1.280",
"lines": [
22,
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