[4.5.6] Duplicate Monster Fix

9Panzer

Well-known member
I tried inserting your code into my death routine and the player object now doesn't go to step 6 of the death animation. Can you tell me what I'm doing wrong?

View attachment 7535

Code:
playerDeath:

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

        LDX #TOTAL_MAX_OBJECTS
        LDA #0
        -
        CPX player1_object
        BEQ +skipMe

        STA Object_x_hi,x

        DestroyObject
        +skipMe
        ;; etc
        DEX
        BPL -  
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    StopSound
    PlaySound #sfx_Lose

    ;; STOP the scrolling V2
        LDA scrollByte
        AND #%11111101
        STA scrollByte
        LDA ScreenFlags00
        ORA #%00110000
        STA ScreenFlags00
       
       
        LDA #$00
        STA Object_h_speed_lo,x
        STA Object_h_speed_hi,x
        STA Object_v_speed_lo,x
        STA Object_v_speed_hi,x
        LDA Object_direction,x
        AND #%00000111
        STA Object_direction,x
       
       
         ChangeActionStep player1_object, #$06
 
        Dec myLives
        LDA myLives  
     
      BEQ +livesZero
        JMP +livesNotZero
    +livesZero
   
   
        LDA #%11000010
        LDA #$FE            ;; the screen number you want to warp to
        STA warpToScreen
        LDA #$00                ;; the map to warp to (0:overworld / 1:underworld)
        STA warpMap
        WarpToScreen warpMap, warpToScreen, #$01
        LDA #$FE
        STA gameState
       
       
    +livesNotZero

   
    RTS

It looks like you are baking it all into the same routine. Try using that snippet as an AI action in action step 06 rather then running it before and see if that works. When Panzer dies he has an animation that plays that gives the routine a second to run so it might just be that you are trying to cram too much into one cycle.
 
Top Bottom