ronin1011
Member
Thanks. I was able to get monster death animation working with this codeI mean new game object. You get the players X&Y position and then spawn in the death VFX game object using those X&Y values. You could combine several different deathVFX into a single game object (so long as they all fit into the same size rectangle), by putting a different deathVFX into each action slot of one game object, set the end action as "destroy me" and after spawning in that new game object use ChangActionState to set the specific the deathVFX you want by forcing it into that action state.
Code:
;;;; play vfx
;;;; destroy this object
TXA ;; Store X in stack
PHA
TAX
LDA Object_x_hi,x ;; Get this object's origin location
CLC
ADC self_center_x
STA tempA
LDA Object_y_hi,x ;; Get this object's origin location
CLC
ADC self_center_y
STA tempB
LDA Object_screen,x
CLC
ADC #$00
STA tempD
DestroyObject
CreateObjectOnScreen tempA, tempB, #$08, #$00, tempD
PLA ;; Restore X from stack
TAX
RTS
Then setting the game object in 08 like this: