This is a SCRIPT-8 cassette.
Created
July 23, 2020 11:32
-
-
Save thykka/39fc9020aeb19c0a38436227e285e17f to your computer and use it in GitHub Desktop.
SCRIPT-8
This file contains hidden or 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 hidden or 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 = S => { | |
| S.t = 0 | |
| } | |
| update = (S, input, elapsed) => { | |
| S.t += elapsed / 1000 | |
| } | |
| draw = S => { | |
| clear(0) | |
| const spokes = 24 | |
| let slant = 0 | |
| for (let spoke = 0; spoke < spokes; spoke++) { | |
| const pos = spoke / spokes | |
| let lastX = 64; | |
| let lastY = 64; | |
| let c = 0 | |
| for(let dist = 8; dist <= 128; dist += 16) { | |
| c++ | |
| slant += c % 2 === 0 ? 1 / 10 : -1 / 10 | |
| const x1 = 64 + Math.sin(S.t + (pos + slant) * Math.PI * 2) * dist | |
| const y1 = 64 + Math.cos(S.t + (pos + slant) * Math.PI * 2) * dist | |
| line(lastX, lastY, x1, y1, 7) | |
| lastX = x1 | |
| lastY = y1 | |
| } | |
| } | |
| } |
This file contains hidden or 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 hidden or 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": [ | |
| 29, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0 | |
| ] | |
| } |
This file contains hidden or 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 hidden or 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 hidden or 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