From 0a2c7d3ccb5621150d827643bc2c196f7f8db664 Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Thu, 10 Sep 2015 19:57:06 +0200 Subject: More tetris wip --- tetris/blocks.prn | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'tetris/blocks.prn') diff --git a/tetris/blocks.prn b/tetris/blocks.prn index 021a9b5..0eb91f5 100644 --- a/tetris/blocks.prn +++ b/tetris/blocks.prn @@ -1,26 +1,18 @@ -@includeonce "io.prn" - 7 "b_nblocks" store 15 23 71 51 54 99 114 b_nblocks mkarrayp "b_blocks" store -6 3 4 7 2 1 5 + 6 3 4 7 2 1 5 b_nblocks mkarrayp "b_blockclrs" store -@defun "b_getblock" { #arg: block idx [1..7] - "b_blocks" - swapoutvar - swap - arridx - swap - "b_blocks" - gstore +@defun "b_getblock" { #arg: block idx [0..(b_nblocks-1)] + "b_blocks" swapoutvar swap arridx swap "b_blocks" gstore } @defun "b_drawblock" { #args: x y blockidx - b_getblock - "blockbits" store + dup "blockidx" store + b_getblock "blockbits" store "y" store "x" store @@ -30,7 +22,7 @@ b_nblocks mkarrayp "b_blockclrs" store x "xx" store row1 while row1 2 % if - xx y io_gsquare + xx y blockidx io_gsquare end xx 1 + "xx" store row1 2 / "row1" store @@ -41,7 +33,7 @@ b_nblocks mkarrayp "b_blockclrs" store x "xx" store row2 while row2 2 % if - xx y io_gsquare + xx y blockidx io_gsquare end xx 1 + "xx" store row2 2 / "row2" store -- cgit v1.2.3-70-g09d2