This is a SCRIPT-8 cassette.
Created
April 16, 2020 02:16
-
-
Save nekonesse/fd36e8b89bbf37cd43e844b830863a4f to your computer and use it in GitHub Desktop.
SCRIPT-8
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
{} |
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
init = state => { | |
state.angle = 5 // the rotation angle | |
} | |
update = (state, input, elapsed) => { | |
state.angle = state.angle + elapsed / 10 | |
} | |
draw = (state) => { | |
clear() | |
const { angle } = state | |
range(8).forEach(i => { | |
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 color = i % 7 | |
polyStroke([topLeft, topRight, bottomRight, bottomLeft], angle, color) | |
}) | |
} |
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
[] |
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
{ | |
"iframeVersion": "0.1.280", | |
"lines": [ | |
21, | |
0, | |
0, | |
0, | |
0, | |
0, | |
0, | |
0 | |
] | |
} |
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
{} |
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
{} |
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
{} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment