[4.5.9] Easy Creating a unique boss death animation (ModMetroidvania)

TalkingCat

Member
In my game, I want to create an animation of the death of a boss different from the death of an ordinary monster. I hope it will be useful to someone, because I spent a lot of time on it. I apologize in advance for the grammar, English is not my native language. So let's get started.
game.gifgame1.gif
1. After destroying the monster object, we add a screen type check to the hurtMonster_Platform Base.asm script. In my case, the screen type is 1.
2. Create a game object and call it BossDeath. In my case, he is number 8.
Code:
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
            LDA screenType
            CMP #1                ;Checking the screen type
            BNE notAbossRoom
            
                ;;;;;;;;;;;;;;;;;;;;;;;;Creating an object in place of a destroyed monster
                LDA Object_y_hi,x
                STA tempB
                LDA Object_x_hi,x
                STA tempA
                LDA Object_screen,x
                STA tempC
                TXA
                PHA
                CreateObjectOnScreen tempA, tempB, #$08, #$00, tempC  ;;<-- the game object #08  or any other object item you want to drop
                PlaySound #sfx_boom2
                PLA
                TAX
                ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
            
        notAbossRoom:
        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3. In the object settings, we set the action as GoToWarp if we want the player to move to the victory screen after the animation ends.

Video_230516183606.gif
I'm just starting to learn Newsmaker and Assembler. Suggestions for improving the code are only welcome)
My code hurtMonster_Platform Base.asm:
Code:
    TXA
    STA temp
    GetActionStep temp
    CMP #$07 ;; we will use action step 7 for hurt.
    BNE +doNotSkipHurtingThisObject ;; if he is hurt, he can't be hurt again.
        JMP +doSkipHurtingThisObject
+doNotSkipHurtingThisObject:
        ChangeActionStep temp, #$07
        LDA #$01 
        STA Object_action_timer,x
        DEC Object_health,x
        PlaySound #sfx_vector
        LDA Object_health,x
        BEQ +doNotSkipHurtingThisObject
            JMP +doSkipHurtingThisObject
+doNotSkipHurtingThisObject:
        
            LDA Object_x_hi,x
            CLC
            ADC #$05
            STA tempA
            LDA Object_screen,x
            ADC #$00
            STA tempD
            LDA Object_y_hi,x
             CLC
            ADC #$04
            STA tempB
            LDA Object_direction,x
            AND #%00000111
            STA tempC
            
            DestroyObject
            
            CreateObjectOnScreen tempA, tempB, #$0C, #$00, tempD
            
            PlaySound #sfx_boom
                                
      
        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
            LDA screenType
            CMP #1                ;Checking the screen type
            BNE notAbossRoom
            
                ;;;;;;;;;;;;;;;;;;;;;;;;Creating an object in place of a destroyed monster
                LDA Object_y_hi,x
                STA tempB
                LDA Object_x_hi,x
                STA tempA
                LDA Object_screen,x
                STA tempC
                TXA
                PHA
                CreateObjectOnScreen tempA, tempB, #$08, #$00, tempC  ;;<-- the game object #08  or any other object item you want to drop
                PlaySound #sfx_boom2
                PLA
                TAX
                ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
            
        notAbossRoom:
        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
            
            +notZeroCount
    +doSkipHurtingThisObject
 
Gave this a go. Using 4.5.9 metroidvania. Screen type one works great for Bosses! ,but nothing happens with regular monsters. I set the monster action step up and and object I wanted but no go.
 
Top Bottom