fix goriya left right movement velocity and animation starting frame

This commit is contained in:
scawful
2024-06-27 09:06:35 -04:00
parent 5bf0424913
commit c8d9bd1f3a

View File

@@ -96,6 +96,7 @@ Sprite_Goriya_Main:
Goriya_WalkingLeft: Goriya_WalkingLeft:
{ {
%StartOnFrame(4)
%PlayAnimation(4, 5, 10) %PlayAnimation(4, 5, 10)
JSR Sprite_Goriya_Move JSR Sprite_Goriya_Move
RTS RTS
@@ -103,6 +104,7 @@ Sprite_Goriya_Main:
Goriya_WalkingRight: Goriya_WalkingRight:
{ {
%StartOnFrame(6)
%PlayAnimation(6, 7, 10) %PlayAnimation(6, 7, 10)
JSR Sprite_Goriya_Move JSR Sprite_Goriya_Move
RTS RTS
@@ -221,7 +223,7 @@ Sprite_Goriya_Move:
Goriya_MoveLeft: Goriya_MoveLeft:
{ {
STZ.w SprYSpeed, X STZ.w SprYSpeed, X
LDA.b #GoriyaMovementSpeed : STA.w SprXSpeed, X LDA.b #-GoriyaMovementSpeed : STA.w SprXSpeed, X
%GotoAction(2) %GotoAction(2)
LDA.b #$02 : STA.w SprMiscE, X LDA.b #$02 : STA.w SprMiscE, X
RTS RTS
@@ -230,7 +232,7 @@ Sprite_Goriya_Move:
Goriya_MoveRight: Goriya_MoveRight:
{ {
STZ.w SprYSpeed, X STZ.w SprYSpeed, X
LDA.b #-GoriyaMovementSpeed : STA.w SprXSpeed, X LDA.b #GoriyaMovementSpeed : STA.w SprXSpeed, X
%GotoAction(3) %GotoAction(3)
LDA.b #$03 : STA.w SprMiscE, X LDA.b #$03 : STA.w SprMiscE, X
RTS RTS
@@ -323,6 +325,7 @@ Sprite_Goriya_Draw:
dw 0, -9 dw 0, -9
dw -1, -10 dw -1, -10
.chr .chr
; Body Head
db $E4, $C0 db $E4, $C0
db $E4, $C0 db $E4, $C0
db $C6, $C2 db $C6, $C2
@@ -344,73 +347,73 @@ Sprite_Goriya_Draw:
Sprite_Boomerang_Draw: Sprite_Boomerang_Draw:
{ {
JSL Sprite_PrepOamCoord JSL Sprite_PrepOamCoord
JSL Sprite_OAM_AllocateDeferToPlayer JSL Sprite_OAM_AllocateDeferToPlayer
LDA $0DC0, X : CLC : ADC $0D90, X : TAY;Animation Frame LDA $0DC0, X : CLC : ADC $0D90, X : TAY;Animation Frame
LDA .start_index, Y : STA $06 LDA .start_index, Y : STA $06
PHX PHX
LDX .nbr_of_tiles, Y ;amount of tiles -1 LDX .nbr_of_tiles, Y ;amount of tiles -1
LDY.b #$00 LDY.b #$00
.nextTile .nextTile
PHX ; Save current Tile Index? PHX ; Save current Tile Index?
TXA : CLC : ADC $06 ; Add Animation Index Offset TXA : CLC : ADC $06 ; Add Animation Index Offset
PHA ; Keep the value with animation index offset? PHA ; Keep the value with animation index offset?
ASL A : TAX ASL A : TAX
REP #$20 REP #$20
LDA $00 : STA ($90), Y LDA $00 : STA ($90), Y
AND.w #$0100 : STA $0E AND.w #$0100 : STA $0E
INY INY
LDA $02 : STA ($90), Y LDA $02 : STA ($90), Y
CLC : ADC #$0010 : CMP.w #$0100 CLC : ADC #$0010 : CMP.w #$0100
SEP #$20 SEP #$20
BCC .on_screen_y BCC .on_screen_y
LDA.b #$F0 : STA ($90), Y ;Put the sprite out of the way LDA.b #$F0 : STA ($90), Y ;Put the sprite out of the way
STA $0E STA $0E
.on_screen_y .on_screen_y
PLX ; Pullback Animation Index Offset (without the *2 not 16bit anymore) PLX ; Pullback Animation Index Offset (without the *2 not 16bit anymore)
INY INY
LDA .chr, X : STA ($90), Y LDA .chr, X : STA ($90), Y
INY INY
LDA .properties, X : STA ($90), Y LDA .properties, X : STA ($90), Y
PHY PHY
TYA : LSR #2 : TAY TYA : LSR #2 : TAY
LDA #$02 : ORA $0F : STA ($92), Y ; store size in oam buffer LDA #$02 : ORA $0F : STA ($92), Y ; store size in oam buffer
PLY : INY PLY : INY
PLX : DEX : BPL .nextTile PLX : DEX : BPL .nextTile
PLX PLX
RTS RTS
.start_index .start_index
db $00, $01, $02, $03 db $00, $01, $02, $03
.nbr_of_tiles .nbr_of_tiles
db 0, 0, 0, 0 db 0, 0, 0, 0
.chr .chr
db $26 db $26
db $26 db $26
db $26 db $26
db $26 db $26
.properties .properties
db $32 db $32
db $B2 db $B2
db $F2 db $F2
db $72 db $72
} }