update village dog sprite

This commit is contained in:
scawful
2024-05-27 19:52:46 -04:00
parent 5715271b60
commit 3d62fc3449

View File

@@ -90,7 +90,7 @@ Sprite_VillageDog_Main:
.walk_right .walk_right
%GotoAction(2) %GotoAction(2)
.lifting .lifting
JSL Sprite_CheckIfLifted JSL Sprite_CheckIfLifted
JSL Sprite_Move JSL Sprite_Move
RTS RTS
@@ -100,8 +100,8 @@ Sprite_VillageDog_Main:
Dog_LookLeftAtLink: Dog_LookLeftAtLink:
{ {
%PlayAnimation(9,9,8) %PlayAnimation(9,9,8)
JSR HandleTossedDog JSR HandleTossedDog
LDA.w SprTimerD, X : BNE + LDA.w SprTimerD, X : BNE +
; Load the timer for the run ; Load the timer for the run
LDA #$60 : STA.w SprTimerD, X LDA #$60 : STA.w SprTimerD, X
%GotoAction(3) %GotoAction(3)
@@ -113,8 +113,8 @@ Sprite_VillageDog_Main:
Dog_LookRightAtLink: Dog_LookRightAtLink:
{ {
%PlayAnimation(10,10,8) %PlayAnimation(10,10,8)
JSR HandleTossedDog JSR HandleTossedDog
LDA.w SprTimerD, X : BNE + LDA.w SprTimerD, X : BNE +
; Load the timer for the run ; Load the timer for the run
LDA #$60 : STA.w SprTimerD, X LDA #$60 : STA.w SprTimerD, X
%GotoAction(4) %GotoAction(4)
@@ -126,7 +126,7 @@ Sprite_VillageDog_Main:
Dog_MoveLeftTowardsLink: Dog_MoveLeftTowardsLink:
{ {
%PlayAnimation(2,4,6) %PlayAnimation(2,4,6)
JSR HandleTossedDog JSR HandleTossedDog
; Check if the dog is near link, then wag the tail ; Check if the dog is near link, then wag the tail
JSR CheckIfPlayerIsNearby : BCC + JSR CheckIfPlayerIsNearby : BCC +
%GotoAction(5) %GotoAction(5)
@@ -138,16 +138,15 @@ Sprite_VillageDog_Main:
%GotoAction(0) %GotoAction(0)
.no_collision .no_collision
LDA.b #$0A ; Speed LDA.b #$0A
JSL Sprite_ApplySpeedTowardsPlayer JSL Sprite_ApplySpeedTowardsPlayer
STZ $06 : STZ $07 STZ $06 : STZ $07
JSL Sprite_MoveLong JSL Sprite_MoveLong
JSL Sprite_CheckIfLifted JSL Sprite_CheckIfLifted
LDA.w SprTimerD, X : BNE + LDA.w SprTimerD, X : BNE +
%GotoAction(0)
%GotoAction(0) +
+
RTS RTS
} }
@@ -155,7 +154,7 @@ Sprite_VillageDog_Main:
Dog_MoveRightTowardsLink: Dog_MoveRightTowardsLink:
{ {
%PlayAnimation(5,7,6) %PlayAnimation(5,7,6)
JSR HandleTossedDog JSR HandleTossedDog
JSR CheckIfPlayerIsNearby : BCC + JSR CheckIfPlayerIsNearby : BCC +
%GotoAction(6) %GotoAction(6)
+ +
@@ -166,7 +165,7 @@ Sprite_VillageDog_Main:
%GotoAction(0) %GotoAction(0)
.no_collision .no_collision
LDA.b #$0A ; Speed LDA.b #$0A
JSL Sprite_ApplySpeedTowardsPlayer JSL Sprite_ApplySpeedTowardsPlayer
STZ $06 : STZ $07 STZ $06 : STZ $07
JSL Sprite_MoveLong JSL Sprite_MoveLong
@@ -184,7 +183,7 @@ Sprite_VillageDog_Main:
%PlayAnimation(0,1, 8) %PlayAnimation(0,1, 8)
JSR ShowMessageIfMinish JSR ShowMessageIfMinish
JSL Sprite_CheckIfLifted JSL Sprite_CheckIfLifted
JSR HandleTossedDog JSR HandleTossedDog
LDA.w SprTimerD, X : BNE + LDA.w SprTimerD, X : BNE +
%GotoAction(0) %GotoAction(0)
+ +
@@ -197,7 +196,7 @@ Sprite_VillageDog_Main:
%PlayAnimation(11,12,8) %PlayAnimation(11,12,8)
JSR ShowMessageIfMinish JSR ShowMessageIfMinish
JSL Sprite_CheckIfLifted JSL Sprite_CheckIfLifted
JSR HandleTossedDog JSR HandleTossedDog
LDA.w SprTimerD, X : BNE + LDA.w SprTimerD, X : BNE +
%GotoAction(0) %GotoAction(0)
+ +
@@ -208,32 +207,27 @@ Sprite_VillageDog_Main:
CheckIfPlayerIsNearby: CheckIfPlayerIsNearby:
{ {
REP #$20 REP #$20
LDA $22 : CLC : ADC #$0012 : CMP $0FD8 : BCC .left LDA $22 : CLC : ADC #$0012 : CMP $0FD8 : BCC .out
LDA $22 : SEC : SBC #$0012 : CMP $0FD8 : BCS .right LDA $22 : SEC : SBC #$0012 : CMP $0FD8 : BCS .out
LDA $20 : CLC : ADC #$001A : CMP $0FDA : BCC .out
LDA $20 : SEC : SBC #$001A : CMP $0FDA : BCS .out
SEP #$21
RTS ; Return with carry set
LDA $20 : CLC : ADC #$001A : CMP $0FDA : BCC .up .out
LDA $20 : SEC : SBC #$001A : CMP $0FDA : BCS .down SEP #$20
CLC
SEP #$21 : RTS ; Return with carry set RTS ; Return with carry cleared
.left
.right
.up
.down
SEP #$20
CLC : RTS ; Return with carry cleared
} }
ShowMessageIfMinish: ShowMessageIfMinish:
{ {
LDA $02B2 : CMP.b #$05 : BNE .not_minish LDA $02B2 : CMP.b #$05 : BNE .not_minish
%ShowSolicitedMessage($18) : JMP .continue %ShowSolicitedMessage($18) : JMP .continue
.not_minish .not_minish
%ShowSolicitedMessage($1B) %ShowSolicitedMessage($1B)
.continue .continue
RTS RTS
} }
@@ -242,12 +236,12 @@ Sprite_VillageDog_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