Moving is working

This commit is contained in:
Devine Lu Linvega 2023-05-22 17:12:43 -07:00
parent c241ee4ae4
commit 878f606081
1 changed files with 17 additions and 9 deletions

View File

@ -43,7 +43,7 @@ BRK
.Mouse/x DEI2 #0008 SUB2 NIP #18 DIV .Mouse/x DEI2 #0008 SUB2 NIP #18 DIV
.Mouse/y DEI2 #0008 SUB2 NIP #18 DIV .Mouse/y DEI2 #0008 SUB2 NIP #18 DIV
try-move ;try-move ;try-move/cc .Mouse/state DEI #01 GTH JMP SWP2 POP2 JSR2
#00 .Mouse/state DEO #00 .Mouse/state DEO
BRK BRK
@ -82,20 +82,28 @@ JMP2r
@try-move ( x y -- ) @try-move ( x y -- )
#01 phex/b #2018 DEO
pick pick
DUP2 #ffff EQU2 ?&blank DUP2 #ffff EQU2 ?&blank
DUP2 #0000 EQU2 ?&blank DUP2 #0000 EQU2 ?&blank
( up ) ( up ) #00ff OVR2 OVR2 can-move ?&move POP2
#00ff OVR2 OVR2 can-move ?&move POP2 ( down ) #0100 OVR2 OVR2 can-move ?&move POP2
( right ) ( left ) #ff00 OVR2 OVR2 can-move ?&move POP2
#0001 OVR2 OVR2 can-move ?&move POP2 ( right ) #0001 OVR2 OVR2 can-move ?&move POP2
( down )
#0100 OVR2 OVR2 can-move ?&move POP2
( left )
#ff00 OVR2 OVR2 can-move ?&move POP2
POP2 POP2
JMP2r JMP2r
&cc ( x y -- )
#00 phex/b #2018 DEO
pick
DUP2 #ffff EQU2 ?&blank
DUP2 #0000 EQU2 ?&blank
( right ) #0001 OVR2 OVR2 can-move ?&move POP2
( left ) #ff00 OVR2 OVR2 can-move ?&move POP2
( down ) #0100 OVR2 OVR2 can-move ?&move POP2
( up ) #00ff OVR2 OVR2 can-move ?&move POP2
POP2
JMP2r
&move ( block* xy -- ) &move ( block* xy -- )
SWP2 STH2k clear-block SWP2 STH2k clear-block
INC2r INC2r INC2r INC2r