From f7123322fdff7b2939b743e8f5561b35a8cb6e9b Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Mon, 22 May 2023 16:44:50 -0700 Subject: [PATCH] Collision detection is working --- gui/dads/dads.tal | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/gui/dads/dads.tal b/gui/dads/dads.tal index 4ec7866..d34033c 100644 --- a/gui/dads/dads.tal +++ b/gui/dads/dads.tal @@ -53,15 +53,23 @@ BRK @pick ( x y -- * ) + ( 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 )