diff options
Diffstat (limited to 'tetris/io.prn')
-rw-r--r-- | tetris/io.prn | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/tetris/io.prn b/tetris/io.prn index 8c6a320..539cbee 100644 --- a/tetris/io.prn +++ b/tetris/io.prn @@ -59,6 +59,7 @@ "-" print 1 + dup w < end + pop "+" print #1000000 sleep @@ -71,6 +72,7 @@ "|\x1B[D\x1B[B" print #bar, left, down 1 + dup h 1 - < end + pop #1000000 sleep x w + 1 + y 1 + io_goto @@ -79,6 +81,7 @@ "|\x1B[D\x1B[B" print #bar, left, down 1 + dup h 1 - < end + pop #1000000 sleep } @@ -86,15 +89,16 @@ io_pos_windowstart io_pos_windowend io_pos_windowstart diff2 io_box } -@defun "io_square" { #args: x y (equivalent to x y 3 2 io_box) +@defun "io_square" { #args: x y "y" store "x" store x y io_goto - "+--+" print - x y 1 + io_goto - "| |" print - x y 2 + io_goto - "+--+" print + #"+--+" print + #x y 1 + io_goto + #"| |" print + #x y 2 + io_goto + #"+--+" print + "xxx\x1B[3D\x1B[Bxxx" print } @defun "io_pos_square" { #args: x y @@ -104,11 +108,18 @@ tile_sizey * padding_y + } -@defun "io_gsquare" { #args: x y +@defun "io_gsquare" { #args: x y blockidx + "b_blockclrs" swapoutvar swap arridx swap "b_blockclrs" gstore + io_setcolour io_pos_square io_square + io_resetcolour } @defun "io_setcolour" { #args: coloridx [0..7] "\x1B[3" swap + "m" + print } + +@defun "io_resetcolour" { + "\x1B[0m" print +} |