Limit animatio

This commit is contained in:
neauoire 2022-09-11 10:49:12 -07:00
parent ac4450885f
commit 2292238044
1 changed files with 18 additions and 13 deletions

View File

@ -36,8 +36,8 @@
;on-mouse .Mouse/vector DEO2 ;on-mouse .Mouse/vector DEO2
;on-button .Controller/vector DEO2 ;on-button .Controller/vector DEO2
#0060 #10 SFT2 .player/x STZ2 #0060 ( scale ) #10 SFT2 .player/x STZ2
#0070 #10 SFT2 .player/y STZ2 #0070 ( scale ) #10 SFT2 .player/y STZ2
;update JSR2 ;update JSR2
@ -48,9 +48,13 @@ BRK
@on-frame ( -> ) @on-frame ( -> )
[ LIT &rate $1 ] INC DUP #03 EQU ,&go JCN
,&rate STR BRK &go
POP #00 ,&rate STR
.Controller/button DEI .Controller/button DEI
DUP #10 NEQ ,&no-u JCN DUP #10 NEQ ,&no-u JCN
.player/r LDZ2 #0004 ;raycast JSR2 .player/r LDZ2 #0008 ;raycast JSR2
.player/y STZ2 .player/y STZ2
.player/x STZ2 .player/x STZ2
;update JSR2 ;update JSR2
@ -68,11 +72,11 @@ BRK
;update JSR2 ;update JSR2
&no-r &no-r
DUP #01 NEQ ,&no-a JCN DUP #01 NEQ ,&no-a JCN
.player/r LDZ2k #0004 SUB2 #03ff AND2 ROT STZ2 .player/r LDZ2k #0010 SUB2 #03ff AND2 ROT STZ2
;update JSR2 ;update JSR2
&no-a &no-a
DUP #02 NEQ ,&no-b JCN DUP #02 NEQ ,&no-b JCN
.player/r LDZ2k #0004 ADD2 #03ff AND2 ROT STZ2 .player/r LDZ2k #0010 ADD2 #03ff AND2 ROT STZ2
;update JSR2 ;update JSR2
&no-b &no-b
POP POP
@ -104,10 +108,10 @@ JMP2r
@draw-viewport ( -- ) @draw-viewport ( -- )
#00 .Screen/auto DEO #00 .Screen/auto DEO
#0080 #0000 #00c0 #0000
&h &h
DUP2 #10 SFT2 #0090 ADD2 .Screen/x DEO2 DUP2 #10 SFT2 #0090 ADD2 .Screen/x DEO2
DUP2 .player/r LDZ2 #0040 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
POP2 POP2 POP2 POP2
@ -117,7 +121,7 @@ JMP2r
@draw-col ( distance* color -- ) @draw-col ( distance* color -- )
#04 SFT ,&color STR #04 SFT ,&color STR
#01 SFT2 NIP ( scale ) #01 SFT2 NIP
STH STH
#8000 #8000
&l &l
@ -163,8 +167,8 @@ JMP2r
( draw player ) ( draw player )
.player/x LDZ2 #01 SFT2 #0003 SUB2 .Screen/x DEO2 .player/x LDZ2 ( scale ) #01 SFT2 #0003 SUB2 .Screen/x DEO2
.player/y LDZ2 #01 SFT2 #0003 SUB2 .Screen/y DEO2 .player/y LDZ2 ( scale ) #01 SFT2 #0003 SUB2 .Screen/y DEO2
;player-icn .Screen/addr DEO2 ;player-icn .Screen/addr DEO2
#05 .Screen/sprite DEO #05 .Screen/sprite DEO
@ -173,18 +177,19 @@ JMP2r
#01 ;draw-line JSR2 #01 ;draw-line JSR2
.player/x LDZ2 .player/y LDZ2 ;to-scale JSR2 .player/x LDZ2 .player/y LDZ2 ;to-scale JSR2
.player/r LDZ2 #0040 SUB2 #03ff AND2 ;ray-pos JSR2 ;to-scale JSR2 .player/r LDZ2 #0060 SUB2 #03ff AND2 ;ray-pos JSR2 ;to-scale JSR2
#02 ;draw-line JSR2 #02 ;draw-line JSR2
.player/x LDZ2 .player/y LDZ2 ;to-scale JSR2 .player/x LDZ2 .player/y LDZ2 ;to-scale JSR2
.player/r LDZ2 #0040 ADD2 #03ff AND2 ;ray-pos JSR2 ;to-scale JSR2 .player/r LDZ2 #0060 ADD2 #03ff AND2 ;ray-pos JSR2 ;to-scale JSR2
#02 ;draw-line JSR2 #02 ;draw-line JSR2
JMP2r JMP2r
@to-scale ( x* y* -- x* y* ) @to-scale ( x* y* -- x* y* )
SWP2 #01 SFT2 SWP2 #01 SFT2 ( scale ) SWP2 #01 SFT2
( scale ) SWP2 #01 SFT2
JMP2r JMP2r