How do I make a game object flee or move away from another object?

0 favourites
  • 3 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • So I am puzzled on how to make a sprite flee from the player... I used the distance expression and that works as a trigger. However I want the responding object to move away from the object (player in this case). To complicate things I'm using a isometric grid movement system. So Move-to is used for most objects, Even TOP-DOWN. How can I tell the sprite to move on the grid away from the player?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hi

    You could probably use bounce if you want.

    The one that's meant to flee lets call it"a".

    The one that makes it flee lets call it"b".

    Umm you probably have to input-

    The behavior for "a"--Line of sight

    The event-

    On object-"a"-Line of sight x pixels from "b"

    The action-

    "a"Set angle away from "b"(if that is possible).

    I hope I've helped,

    SHIRATSUYU

  • Thanks,

    Got your idea working. With all 8 directions in an isometric layout, The system "Is within angle" worked for me. Trying to make it work with families now as Its going to be a pain to do all N,NE,E SE,S etc. for 20 or more object sprites.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)