Improved controls

This commit is contained in:
neauoire 2022-09-11 11:13:04 -07:00
parent 2292238044
commit 9e0933e5c9
1 changed files with 13 additions and 16 deletions

View File

@ -53,32 +53,29 @@ BRK
POP #00 ,&rate STR POP #00 ,&rate STR
.Controller/button DEI .Controller/button DEI
DUP #10 NEQ ,&no-u JCN DUP #10 AND #00 EQU ,&no-u JCN
.player/r LDZ2 #0008 ;raycast JSR2 .player/r LDZ2 #0006 ;raycast JSR2
.player/y STZ2 .player/y STZ2
.player/x STZ2 .player/x STZ2
;update JSR2
&no-u &no-u
DUP #20 NEQ ,&no-d JCN DUP #20 AND #00 EQU ,&no-d JCN
.player/y LDZ2k #0001 ADD2 ROT STZ2 .player/y LDZ2k #0001 ADD2 ROT STZ2
;update JSR2
&no-d &no-d
DUP #40 NEQ ,&no-l JCN DUP #40 AND #00 EQU ,&no-l JCN
.player/x LDZ2k #0001 SUB2 ROT STZ2 .player/x LDZ2k #0001 SUB2 ROT STZ2
;update JSR2
&no-l &no-l
DUP #80 NEQ ,&no-r JCN DUP #80 AND #00 EQU ,&no-r JCN
.player/x LDZ2k #0001 ADD2 ROT STZ2 .player/x LDZ2k #0001 ADD2 ROT STZ2
;update JSR2
&no-r &no-r
DUP #01 NEQ ,&no-a JCN DUP #01 AND #00 EQU ,&no-a JCN
.player/r LDZ2k #0010 SUB2 #03ff AND2 ROT STZ2 .player/r LDZ2k #0010 SUB2 #03ff AND2 ROT STZ2
;update JSR2
&no-a &no-a
DUP #02 NEQ ,&no-b JCN DUP #02 AND #00 EQU ,&no-b JCN
.player/r LDZ2k #0010 ADD2 #03ff AND2 ROT STZ2 .player/r LDZ2k #0010 ADD2 #03ff AND2 ROT STZ2
;update JSR2
&no-b &no-b
DUP #00 EQU ,&no-null JCN
;update JSR2
&no-null
POP POP
BRK BRK
@ -110,7 +107,7 @@ JMP2r
#00 .Screen/auto DEO #00 .Screen/auto DEO
#00c0 #0000 #00c0 #0000
&h &h
DUP2 #10 SFT2 #0090 ADD2 .Screen/x DEO2 DUP2 #0090 ADD2 .Screen/x DEO2
DUP2 .player/r LDZ2 #0060 SUB2 ADD2 #03ff AND2 DUP2 .player/r LDZ2 #0060 SUB2 ADD2 #03ff AND2
;ray-tile JSR2 ;draw-col JSR2 ;ray-tile JSR2 ;draw-col JSR2
INC2 GTH2k ,&h JCN INC2 GTH2k ,&h JCN
@ -198,7 +195,7 @@ JMP2r
,&angle STR2 ,&angle STR2
#0200 #0001 #0200 #0001
&r &r
DUP2 [ LIT2 &angle $2 ] SWP2 ;raycast JSR2 [ LIT2 &angle $2 ] OVR2 ;raycast JSR2
DUP2 ,&y STR2 DUP2 ,&y STR2
OVR2 ,&x STR2 OVR2 ,&x STR2
;get-tile JSR2 ,&end JCN ;get-tile JSR2 ,&end JCN
@ -215,7 +212,7 @@ JMP2r
#0200 #0001 #0200 #0001
&r &r
DUP2 ,&distance STR2 DUP2 ,&distance STR2
DUP2 [ LIT2 &angle $2 ] SWP2 ;raycast JSR2 [ LIT2 &angle $2 ] OVR2 ;raycast JSR2
;get-tile JSR2 ;get-tile JSR2
DUP ,&color STR DUP ,&color STR
,&end JCN ,&end JCN