cleanup sprite movement functions lib
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
;=================================================================
|
||||
;==========================================================
|
||||
;Long function, return Carry Set if Active
|
||||
;=================================================================
|
||||
;==========================================================
|
||||
|
||||
Sprite_CheckActive:
|
||||
{
|
||||
; Deactivates the sprite in certain situations
|
||||
@@ -27,6 +28,7 @@ Sprite_CheckActive:
|
||||
; make the sprite move X axis
|
||||
;==========================================================
|
||||
Sprite_MoveHoriz:
|
||||
{
|
||||
LDA.w $0D50, X : BEQ .no_velocity
|
||||
ASL : ASL : ASL : ASL
|
||||
CLC : ADC.w $0D70,X : STA.w $0D70,X
|
||||
@@ -44,20 +46,25 @@ Sprite_MoveHoriz:
|
||||
|
||||
.no_velocity
|
||||
RTL
|
||||
}
|
||||
|
||||
;==========================================================
|
||||
|
||||
;===================================================================================================
|
||||
; make the sprite move both directions (also height)
|
||||
;===================================================================================================
|
||||
;==========================================================
|
||||
|
||||
Sprite_MoveXyz:
|
||||
JSL Sprite_MoveAltitude
|
||||
Sprite_Move:
|
||||
JSL Sprite_MoveHoriz
|
||||
; no RTL, just continue into Sprite_MoveVert
|
||||
|
||||
;===================================================================================================
|
||||
;==========================================================
|
||||
; make the sprite move Y axis
|
||||
;===================================================================================================
|
||||
;==========================================================
|
||||
|
||||
Sprite_MoveVert:
|
||||
{
|
||||
LDA.w $0D40, X : BEQ .no_velocity
|
||||
ASL : ASL : ASL : ASL
|
||||
CLC : ADC.w $0D60,X : STA.w $0D60,X
|
||||
@@ -75,12 +82,15 @@ Sprite_MoveVert:
|
||||
|
||||
.no_velocity
|
||||
RTL
|
||||
}
|
||||
|
||||
;===================================================================================================
|
||||
;==========================================================
|
||||
; make the sprite move Z axis (height)
|
||||
;===================================================================================================
|
||||
;==========================================================
|
||||
|
||||
Sprite_MoveZ:
|
||||
Sprite_MoveAltitude:
|
||||
{
|
||||
LDA.w $0F80, X : ASL : ASL : ASL : ASL
|
||||
CLC : ADC.w $0F90,X : STA.w $0F90,X
|
||||
|
||||
@@ -94,14 +104,17 @@ Sprite_MoveAltitude:
|
||||
ADC.w $0F70,X : STA.w $0F70,X
|
||||
|
||||
RTL
|
||||
}
|
||||
|
||||
|
||||
;===================================================================================================
|
||||
;==========================================================
|
||||
; make the sprite bounce toward player (like vitreous)
|
||||
; Movement, Collision are handled by this function (height:20 = vitreous)
|
||||
; $09 = speed, $08 = max height
|
||||
;===================================================================================================
|
||||
;==========================================================
|
||||
|
||||
Sprite_BounceTowardPlayer:
|
||||
{
|
||||
JSL Sprite_MoveAltitude
|
||||
|
||||
DEC.w $0F80,X : DEC.w $0F80,X
|
||||
@@ -126,8 +139,10 @@ Sprite_BounceTowardPlayer:
|
||||
|
||||
.dontmove
|
||||
RTL
|
||||
}
|
||||
|
||||
Sprite_BounceFromTileCollision:
|
||||
{
|
||||
JSL Sprite_CheckTileCollision : AND.b #$03 : BEQ ++
|
||||
LDA.w $0D50,X : EOR.b #$FF : INC : STA.w $0D50,X
|
||||
INC.w $0ED0, X
|
||||
@@ -137,8 +152,7 @@ Sprite_BounceFromTileCollision:
|
||||
INC.w $0ED0, X
|
||||
|
||||
++ RTL
|
||||
|
||||
; ==============================================================================
|
||||
}
|
||||
|
||||
Intro_Dungeon_Main:
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user