From 63c89f3ce4bf1267e636060b8e64d563a28224b9 Mon Sep 17 00:00:00 2001 From: neauoire Date: Sat, 10 Sep 2022 15:41:41 -0700 Subject: [PATCH] Progress on drawing walls --- ray/src/ray.tal | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/ray/src/ray.tal b/ray/src/ray.tal index a3a6aba..6c32822 100644 --- a/ray/src/ray.tal +++ b/ray/src/ray.tal @@ -18,7 +18,7 @@ |0000 @player - &x $2 &y $2 &a $2 + &x $2 &y $2 &a $2 &r $2 @line &x $2 &y $2 &dx $2 &dy $2 &e1 $2 @@ -38,7 +38,7 @@ #0060 .player/x STZ2 #0070 .player/y STZ2 - #0032 .player/a STZ2 + #0000 .player/a STZ2 ;draw-map JSR2 @@ -66,6 +66,14 @@ BRK .player/x LDZ2k #0001 ADD2 ROT STZ2 ;update JSR2 &no-r + DUP #01 NEQ ,&no-a JCN + .player/r LDZ2k #0008 SUB2 ROT STZ2 + ;update JSR2 + &no-a + DUP #02 NEQ ,&no-b JCN + .player/r LDZ2k #0008 ADD2 ROT STZ2 + ;update JSR2 + &no-b POP BRK @@ -96,14 +104,16 @@ JMP2r @draw-viewport ( -- ) + .player/a LDZ2 #00 .Screen/auto DEO #0100 #0000 &h DUP2 #0090 ADD2 .Screen/x DEO2 - DUP2 .Mouse/x DEI2 ADD2 #0400 DIV2k MUL2 SUB2 .player/a STZ2 + DUP2 .player/r LDZ2 ADD2 #0400 DIV2k MUL2 SUB2 .player/a STZ2 ( get distance ) ;cast JSR2 ;draw-col JSR2 INC2 GTH2k ,&h JCN POP2 POP2 + .player/a STZ2 JMP2r @@ -136,8 +146,6 @@ JMP2r ;draw-map JSR2 - .Mouse/x DEI2 #0400 DIV2k MUL2 SUB2 .player/a STZ2 - .player/x LDZ2 .player/y LDZ2