summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortomsmeding <hallo@tomsmeding.nl>2015-09-09 09:19:51 +0200
committertomsmeding <hallo@tomsmeding.nl>2015-09-09 09:19:51 +0200
commit22b84da031e21041a15584a8982c4c4c7b7f68ff (patch)
tree6c746a05cd573e2cbf11ef249113af7b1088ac3f
parent7664be1f418bd87eddca4bab17292ecf2d862a4a (diff)
WIP
-rw-r--r--tetris/blocks.prn14
-rw-r--r--tetris/io.prn12
2 files changed, 17 insertions, 9 deletions
diff --git a/tetris/blocks.prn b/tetris/blocks.prn
index 3147b41..bc37cb9 100644
--- a/tetris/blocks.prn
+++ b/tetris/blocks.prn
@@ -2,13 +2,13 @@
7 "b_nblocks" store
-15 "b_block1" store #I
-23 "b_block2" store #L
-71 "b_block3" store #J
-51 "b_block4" store #O
-54 "b_block5" store #S
-99 "b_block6" store #Z
-114 "b_block7" store #T
+15 "b_block1" store 6 "b_block1c" store #I: cyan
+23 "b_block2" store 3 "b_block2c" store #L: orange
+71 "b_block3" store 4 "b_block3c" store #J: blue
+51 "b_block4" store 7 "b_block4c" store #O: yellow (ish)
+54 "b_block5" store 2 "b_block5c" store #S: lime
+99 "b_block6" store 1 "b_block6c" store #Z: red
+114 "b_block7" store 5 "b_block7c" store #T: purple
@defun "b_getblock" { #arg: block idx [1..7]
"b_block" swap + get
diff --git a/tetris/io.prn b/tetris/io.prn
index 7b2c704..0d18c44 100644
--- a/tetris/io.prn
+++ b/tetris/io.prn
@@ -96,10 +96,18 @@
"+--+" print
}
-@defun "io_gsquare" { #args: x y
+@defun "io_pos_square" { #args: x y
swap
tile_sizex * padding_x +
swap
tile_sizey * padding_y +
- io_square
+}
+
+@defun "io_gsquare" { #args: x y
+ io_pos_square io_square
+}
+
+
+@defun "io_setcolour" { #args: coloridx [0..7]
+ "\x1B[3" swap + "m" + print
}