Implemented block picking
This commit is contained in:
parent
3e100de392
commit
6dff921cde
|
@ -48,9 +48,38 @@ 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 -- )
|
||||
|
||||
phex #0a18 DEO
|
||||
pick phex #0a18 DEO
|
||||
|
||||
JMP2r
|
||||
|
||||
|
@ -75,6 +104,7 @@ JMP2r
|
|||
#00 OVR draw-block
|
||||
INC GTHk ?&l
|
||||
POP2
|
||||
|
||||
JMP2r
|
||||
|
||||
@draw-block ( id* -- )
|
||||
|
|
Loading…
Reference in New Issue