Making a monster follow player

0 favourites
  • 5 posts
From the Asset Store
Make your own platformer for both the web and mobile easy with this Santas Platformer Template, FULLY DOCUMENTED
  • I have a few questions so I'll label them;

    1) How do I make monsters detect the player? Is this always done with the LOS behavior? Is there a "object is in range" event?

    2) What's the difference between making a bullet or 8direction monsters? Which one should I use? I want the monsters to wander around until noticing the player.

    3) How can I get a monster to follow player without changing the visual angle of the sprite. I want the sprite to stay same way constantly but follow the player.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 1. Here are a couple ways.. LOS is one. Running an event on your monsters that compares monsters X,Y position to players and if less than player.x+range, player.y+range then toggle an in range variable... or use an invisible "detection radius sprite pinned to player to trigger monsters (like I did here with "sound radius" (click the download arrow in the upper right of screen)

    2. Either way is fine but you have more control using bullet behavior. You will have to make events either way that determine when the monsters goes a certain way regardless. Making a monster wander is simply AI, make an action loop where monster randomly changes directions or actions every so often.

    3. You would be best using bullet behavior for movement then since it doesn't change sprite angle unless you tell it, the sprite angle should remain unchanged unless told to angle to direction of movement (which most behaviors do internally, so use bullet and make own movement events).

  • Thanks for the reply!

    About the 3rd question; how do I set the bullet's movement direction without changing the visual angle of the sprite?

  • I was daft on #3. My recommendation in your case would be to have a hidden control sprite that you pin the primary monster to. Then you can be free to use bullet angle changes without extra events. Just make sure to pin monster on position only and not position&angle.

  • So there's no way of moving the sprite (with bullet behavior) without changing the angle?

    With 8direction I am able to disable the angle changes. Could I move the monster sprite towards the player with 8direction while maintaining the 0 degree angle?

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