cleanup pols voice, alloc more oam for shadow

This commit is contained in:
scawful
2024-06-26 23:43:16 -04:00
parent 5f7bb05039
commit 2e1e2e1f24

View File

@@ -1,6 +1,6 @@
!SPRID = $A4 ; The sprite ID you are overwriting (HEX) !SPRID = $A4 ; The sprite ID you are overwriting (HEX)
!NbrTiles = 02 ; 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 = 00 ; 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 = 10 ; Number of Health the sprite have !Health = 10 ; Number of Health the sprite have
@@ -51,9 +51,9 @@ Sprite_PolsVoice_Prep:
{ {
PHB : PHK : PLB PHB : PHK : PLB
LDA #$80 : STA SprTimerA, X LDA.b #$80 : STA.w SprTimerA, X
LDA #$00 : STA $0CAA, X LDA.b #$00 : STA.w SprDefl, X
LDA #$00 : STA $0B6B, X LDA.b #$00 : STA.w SprTileDie, X
PLB PLB
RTL RTL
@@ -62,12 +62,12 @@ Sprite_PolsVoice_Prep:
; ========================================================= ; =========================================================
Sprite_PolsVoice_Main: Sprite_PolsVoice_Main:
{ {
LDA.w SprAction, X; Load the SprAction LDA.w SprAction, X
JSL UseImplicitRegIndexedLocalJumpTable; Goto the SprAction we are currently in JSL UseImplicitRegIndexedLocalJumpTable
dw PolsVoice_MoveAround dw PolsVoice_MoveAround
dw PolsVoice_HopAround dw PolsVoice_HopAround
PolsVoice_MoveAround: PolsVoice_MoveAround:
{ {
%StartOnFrame(0) %StartOnFrame(0)
@@ -83,27 +83,24 @@ Sprite_PolsVoice_Main:
%DoDamageToPlayerSameLayerOnContact() %DoDamageToPlayerSameLayerOnContact()
JSL GetRandomInt : AND #$3F : BNE .not_done JSL GetRandomInt : AND #$3F : BNE .not_done
LDA #$04 : STA SprTimerA, X LDA #$04 : STA SprTimerA, X
%GotoAction(1) %GotoAction(1)
.not_done .not_done
JSL Sprite_CheckDamageFromPlayerLong JSL Sprite_CheckDamageFromPlayerLong : BCC .no_damage
BCC .no_damage
; Get the direction to recoil from the player
;Sprite_DirectionToFacePlayer LONG
; \return $0E is low byte of player_y_pos - sprite_y_pos
; \return $0F is low byte of player_x_pos - sprite_x_pos
JSL Sprite_DirectionToFacePlayer JSL Sprite_DirectionToFacePlayer
; Apply the speed positive or negative speed ; Apply the speed positive or negative speed
LDA $0E : BPL .not_up LDA $0E : BPL .not_up
LDA #$20 : STA.w SprYSpeed, X : BRA .not_down LDA #$20 : STA.w SprYSpeed, X
BRA .not_down
.not_up .not_up
LDA #$E0 : STA.w SprYSpeed, X LDA #$E0 : STA.w SprYSpeed, X
.not_down .not_down
LDA $0F : BPL .not_right LDA $0F : BPL .not_right
LDA #$20 : STA.w SprXSpeed, X : BRA .not_left LDA #$20 : STA.w SprXSpeed, X
BRA .not_left
.not_right .not_right
LDA #$E0 : STA SprXSpeed, X LDA #$E0 : STA SprXSpeed, X
.not_left .not_left
@@ -125,11 +122,9 @@ Sprite_PolsVoice_Main:
%DoDamageToPlayerSameLayerOnContact() %DoDamageToPlayerSameLayerOnContact()
LDA SprTimerA, X : BNE .not_done LDA SprTimerA, X : BNE .not_done
%GotoAction(0) %GotoAction(0)
.not_done .not_done
JSL Sprite_CheckDamageFromPlayerLong JSL Sprite_CheckDamageFromPlayerLong : BCC .no_damage
BCC .no_damage
.no_damage .no_damage
RTS RTS
@@ -198,7 +193,7 @@ Sprite_PolsVoice_Draw:
RTS RTS
; ========================================================= ; =======================================================
.start_index .start_index
db $00, $01, $02, $03, $04 db $00, $01, $02, $03, $04