AllDarnDavey
Active member
This tutorial will go over adding custom death animations to players and enemies in the brawler module.
The first step is to make a custom death animations for your enemy, and assign that animation to action06 using these settings:
Assign a new copy of hurtMonster_BralerBase with a different name like hurtMonster_BrawlerBase_deathAnim.asm. Give it the code below:
Code:
LDA gameHandler
AND #%10000000
BEQ +canHurtPlayer
JMP +skipHurt
+canHurtPlayer:
TXA
STA temp
GetActionStep temp ;;skip if already in either death or hurt state
CMP #$06 ;; hurt state.
BCC +notAlreadyInHurtState
JMP +skipHurt
+notAlreadyInHurtState
LDA Object_health,x
SEC
SBC #$01
BEQ +healthBelowZero
BMI +healthBelowZero
STA Object_health,x
ChangeActionStep temp, #$07
JMP +skipHurt
+healthBelowZero
;;;; if this is set to a right edge
;;;; flip the bit so that scrolling can continue
;;;; if all bad guys are gone.
CountObjects #%00001000
CMP #$02
BCC +notZeroCount
LDA scrollByte
ORA #%00000010
STA scrollByte
;;; if there are no more monsters left, we want to disable
;;; the edge check for scrolling.
LDA ScreenFlags00
AND #%11101111
STA ScreenFlags00
ChangeActionStep temp, #$06
+notZeroCount:
ChangeActionStep temp, #$06
+skipHurt
That'll make action06 the enemy death animation, which will delete the enemy once the death animation is over.
Last edited: