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
///////////////////////////////////////////////////////////////////////////// | |
// int2 is similar to Vector2, but with integers instead of floats | |
// Useful for various grid related things. | |
// | |
// - Swizzle operators xx/xy/yx/yy | |
// - Extended arithmetic operators similar to shader data types | |
// A few examples: | |
// int2(8,4) / int2(2,4) -> int2(4,1) | |
// 16 / int2(2,4) -> int2(8,4) | |
// int2(2,3) * int2(4,5) -> int2(8,15) |
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
function _draw() | |
cls(8) | |
srand(5) | |
-- Iterate every 8 square pixels of the screen. | |
-- The `.5` is to make sure the points are at the center of each pixel. | |
-- We'll draw one wall of the maze in each square. | |
for y=.5,129,8 do | |
for x=.5,129,8 do | |
-- Progress in the rotation cycle. One rotation is [0..1] |