Collision detection is working

This commit is contained in:
Devine Lu Linvega 2023-05-22 16:44:50 -07:00
parent f01eee7482
commit f7123322fd
1 changed files with 11 additions and 2 deletions

View File

@ -53,15 +53,23 @@ BRK
@pick ( x y -- <block>* )
( clamp )
DUP #04 GTH ?&bounds
OVR #03 GTH ?&bounds
,&t STR2
#0900
&l
#00 OVR #0006 MUL2 ;game ADD2 [ LIT2 &t $2 ] is-at ?&found
INC GTHk ?&l
&end
POP2
#ffff
JMP2r
&bounds ( bounds* -- 0* )
POP2 #0000
JMP2r
&found ( bounds* -- block* )
NIP #00 SWP #0006 MUL2 ;game ADD2
JMP2r
@ -77,8 +85,9 @@ JMP2r
@try-move ( x y -- )
pick DUP2 #ffff EQU2 ?&blank
OVR2 phex #0a18 DEO
pick
DUP2 #ffff EQU2 ?&blank
DUP2 #0000 EQU2 ?&blank
( up )
DUP2 #00ff can-move phex/b #0a18 DEO
( right )