Monster moving & facing toward Player (4.5.6 - MetroVania)

retroarcade

New member
Hi!

I'd like that my Monster moves and faces horizontally toward the player.
Right now when the player jumps over the monster this one follows his initial trajectory, which is quite unrealistic.
I've already two animations (LeftAnimation & RightAnimation) but I think that I have to modify some script.

Could you help me? Would it be possible to use some scripts from the brawler type of game?

Thanks!
 
Last edited:

retroarcade

New member
Code:
;;; aim towards player.
    TYA
    PHA
    TXA
    PHA
    STA tempx
    
        LDA Object_x_hi,x
        STA tempA
        ;LDA Object_y_hi,x
        ;STA tempB
        LDX player1_object
        LDA Object_x_hi,x
        STA tempC
        ;LDA Object_y_hi,x
        ;STA tempD
        
        LDX tempx
        
    MoveTowardsPoint tempA, tempC, tempB, tempD
    LDA Object_direction,x
    AND #%00000111
    ORA #%00001000
    STA Object_direction,x
    
    PLA
    TAX
    PLA
    TAY

I tried to modify the "MoveTowardsPlayer" script and now the monsters move only horizontally. But sometimes backwards...
 
Top Bottom