summaryrefslogtreecommitdiff
path: root/tetris/blocks.prn
diff options
context:
space:
mode:
authortomsmeding <hallo@tomsmeding.nl>2015-09-10 19:57:06 +0200
committertomsmeding <hallo@tomsmeding.nl>2015-09-10 19:57:06 +0200
commit0a2c7d3ccb5621150d827643bc2c196f7f8db664 (patch)
treeeb928c6fdad79253e02898b5daba1da08dc3cef1 /tetris/blocks.prn
parent3e22583f8596fd8bb2b1e8f651c38f5a898a6155 (diff)
More tetris wip
Diffstat (limited to 'tetris/blocks.prn')
-rw-r--r--tetris/blocks.prn22
1 files changed, 7 insertions, 15 deletions
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