Collision detection is working
This commit is contained in:
parent
f01eee7482
commit
f7123322fd
|
@ -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 )
|
||||
|
|
Loading…
Reference in New Issue