Implemented block picking

This commit is contained in:
Devine Lu Linvega 2023-05-22 11:43:47 -07:00
parent 3e100de392
commit 6dff921cde
1 changed files with 31 additions and 1 deletions

View File

@ -48,9 +48,38 @@ BRK
BRK BRK
(
@|core )
@pick ( x y -- <block>* )
,&t STR2
#0900
&l
#00 OVR #0006 MUL2 ;game ADD2 [ LIT2 &t $2 ] is-at ?&found
INC GTHk ?&l
POP2
#ffff
JMP2r
&found ( bounds* -- block* )
NIP #00 SWP #0006 MUL2 ;game ADD2
JMP2r
@is-at ( block* x y -- f )
OVR2 LDA2 STH2
SWP2 INC2 INC2 LDA2 SUB2
STHr LTH
SWP STHr LTH AND
JMP2r
@move ( x y -- ) @move ( x y -- )
phex #0a18 DEO pick phex #0a18 DEO
JMP2r JMP2r
@ -75,6 +104,7 @@ JMP2r
#00 OVR draw-block #00 OVR draw-block
INC GTHk ?&l INC GTHk ?&l
POP2 POP2
JMP2r JMP2r
@draw-block ( id* -- ) @draw-block ( id* -- )