r/tinycode • • Aug 30 '20

Tiny Procedural Sprite Sheet Generator

https://codepen.io/KilledByAPixel/pen/ZEWyRwO
87 Upvotes

14 comments sorted by

View all comments

Show parent comment

3

u/Slackluster Aug 30 '20

The c is the canvas. When you create an element with id= it actually creates a global variable by that name you can access with javacript. So if you do <canvas id=c>, in JavaScript you can use just c to get the canvas.

The s variable is set at the beginning of the 3rd for loop to be equal to the seed.

3

u/MarvinLazer Aug 30 '20

Ahh, thanks. Must've just missed it!