add Sprite_FloatAwayFromPlayer

This commit is contained in:
scawful
2024-06-21 19:26:14 -04:00
parent 26a668d147
commit 25d6905148
2 changed files with 28 additions and 14 deletions

View File

@@ -44,6 +44,15 @@ SprState = $0DD0 ; This tells if the sprite is alive, dead, frozen, etc...
SprNbrOAM = $0E40 SprNbrOAM = $0E40
SprHealth = $0E50 SprHealth = $0E50
; Mostly controls graphics
; nios pppt
; n - if set, don't draw extra death anim
; i - impervious to attacks and collision? TODO
; o - shadow size (0: normal | 1: small)
; s - shadow (0: no shadow | 1: shadow)
; p - palette used for OAM props
; t - name table used for OAM props
SprGfxProps = $0E60 SprGfxProps = $0E60
; Direction of sprite collision with wall ; Direction of sprite collision with wall

View File

@@ -1,6 +1,5 @@
;========================================================== ; =========================================================
;Long function, return Carry Set if Active ;Long function, return Carry Set if Active
;==========================================================
Sprite_CheckActive: Sprite_CheckActive:
{ {
@@ -24,9 +23,9 @@ Sprite_CheckActive:
RTL RTL
} }
; =========================================================
; make the sprite move X axis ; make the sprite move X axis
;==========================================================
Sprite_MoveHoriz: Sprite_MoveHoriz:
{ {
LDA.w $0D50, X : BEQ .no_velocity LDA.w $0D50, X : BEQ .no_velocity
@@ -48,10 +47,8 @@ Sprite_MoveHoriz:
RTL RTL
} }
;========================================================== ; =========================================================
; make the sprite move both directions (also height) ; make the sprite move both directions (also height)
;==========================================================
Sprite_MoveXyz: Sprite_MoveXyz:
JSL Sprite_MoveAltitude JSL Sprite_MoveAltitude
@@ -59,9 +56,8 @@ Sprite_Move:
JSL Sprite_MoveHoriz JSL Sprite_MoveHoriz
; no RTL, just continue into Sprite_MoveVert ; no RTL, just continue into Sprite_MoveVert
;========================================================== ; =========================================================
; make the sprite move Y axis ; make the sprite move Y axis
;==========================================================
Sprite_MoveVert: Sprite_MoveVert:
{ {
@@ -84,9 +80,8 @@ Sprite_MoveVert:
RTL RTL
} }
;========================================================== ; =========================================================
; make the sprite move Z axis (height) ; make the sprite move Z axis (height)
;==========================================================
Sprite_MoveZ: Sprite_MoveZ:
Sprite_MoveAltitude: Sprite_MoveAltitude:
@@ -107,11 +102,11 @@ Sprite_MoveAltitude:
} }
;========================================================== ; =========================================================
; make the sprite bounce toward player (like vitreous) ; make the sprite bounce toward player (like vitreous)
; Movement, Collision are handled by this function (height:20 = vitreous) ; Movement, Collision are handled by this function (height:20 = vitreous)
; $09 = speed, $08 = max height ; $09 = speed, $08 = max height
;==========================================================
Sprite_BounceTowardPlayer: Sprite_BounceTowardPlayer:
{ {
@@ -130,7 +125,7 @@ Sprite_BounceTowardPlayer:
JSL Sprite_ApplySpeedTowardsPlayer JSL Sprite_ApplySpeedTowardsPlayer
LDA.b #$21 : JSL Sound_SetSfx2PanLong ; LDA.b #$21 : JSL Sound_SetSfx2PanLong
.aloft .aloft
LDA.w $0F70, X : BEQ .dontmove LDA.w $0F70, X : BEQ .dontmove
@@ -163,6 +158,16 @@ Sprite_FloatTowardPlayer:
RTL RTL
} }
Sprite_FloatAwayFromPlayer:
{
LDA $0D50, X : EOR.b #$FF : INC : STA $0D50, X
LDA $0D40, X : EOR.b #$FF : INC : STA $0D40, X
JSL Sprite_MoveAltitude
RTL
}
Sprite_BounceFromTileCollision: Sprite_BounceFromTileCollision:
{ {
JSL Sprite_CheckTileCollision : AND.b #$03 : BEQ ++ JSL Sprite_CheckTileCollision : AND.b #$03 : BEQ ++