Add tingle head tracking logic

This commit is contained in:
scawful
2024-10-10 21:18:54 -04:00
parent fef595ef2e
commit 251fb9bb50

View File

@@ -1,7 +1,8 @@
; Tingle Sprite
!SPRID = $22 ; The sprite ID you are overwriting (HEX) !SPRID = $22 ; The sprite ID you are overwriting (HEX)
!NbrTiles = 00 ; Number of tiles used in a frame !NbrTiles = 03 ; Number of tiles used in a frame
!Harmless = 00 ; 00 = Sprite is Harmful, 01 = Sprite is Harmless !Harmless = 01 ; 00 = Sprite is Harmful, 01 = Sprite is Harmless
!HVelocity = 00 ; Is your sprite going super fast? put 01 if it is !HVelocity = 00 ; Is your sprite going super fast? put 01 if it is
!Health = 00 ; Number of Health the sprite have !Health = 00 ; Number of Health the sprite have
!Damage = 00 ; (08 is a whole heart), 04 is half heart !Damage = 00 ; (08 is a whole heart), 04 is half heart
@@ -33,6 +34,7 @@ Sprite_Tingle_Long:
{ {
PHB : PHK : PLB PHB : PHK : PLB
JSR Sprite_Tingle_Draw JSR Sprite_Tingle_Draw
JSL Sprite_DrawShadow
JSL Sprite_CheckActive : BCC .SpriteIsNotActive JSL Sprite_CheckActive : BCC .SpriteIsNotActive
JSR Sprite_Tingle_Main JSR Sprite_Tingle_Main
.SpriteIsNotActive .SpriteIsNotActive
@@ -50,6 +52,19 @@ Sprite_Tingle_Prep:
Sprite_Tingle_Main: Sprite_Tingle_Main:
{ {
JSL Sprite_PlayerCantPassThrough
JSL Sprite_IsBelowPlayer : TYA : BEQ .below
JSL Sprite_IsToRightOfPlayer : TYA : BNE .right
LDA.b #$02 : STA.w SprAction, X
JMP +
.right
LDA.b #$01 : STA.w SprAction, X
JMP +
.below
STZ.w SprAction, X
+
LDA.w SprAction, X LDA.w SprAction, X
JSL UseImplicitRegIndexedLocalJumpTable JSL UseImplicitRegIndexedLocalJumpTable
@@ -59,19 +74,19 @@ Sprite_Tingle_Main:
Tingle_Forward: Tingle_Forward:
{ {
%PlayAnimation(0,1,10) %PlayAnimation(0,0,10)
RTS RTS
} }
Tingle_Right: Tingle_Right:
{ {
%PlayAnimation(0,1,10) %PlayAnimation(1,1,10)
RTS RTS
} }
Tingle_Left: Tingle_Left:
{ {
%PlayAnimation(0,1,10) %PlayAnimation(2,2,10)
RTS RTS
} }
} }