Enemy AI 8-Movement?

0 favourites
  • 6 posts
From the Asset Store
Enemy turtles pack including fifteen fully animated variations
  • Hello!

    In my game, I have a fence where a spider will be moving in a box-shaped pattern. I've decided to use the 8-Movement behavior on it, but ran into a few issues.

    My initial set up was four invisible triggers that when hit, the spider would change direction to create a box, but the spider wouldn't move using 'on start of layout'

    So I used 'Every Tick' to get the spider to move, and it worked, but it wouldn't collide with the directional triggers. I assumed it was the every tick overriding any other input.

    Am I doing this the hard way? Is there a better way to do this? Or am I just over-thinking this?

    Thanks so much in advance for helping out! : ]

  • Would need a link to the .capx file to assist.

  • Yeah, we'd need the .capx file to help out, try uploading it to dropbox or something.

  • Sorry about that--It took a while since the original project file is HUGE. Here's a snippet of the bigger file containing what I need fixed (the spider is stand-in art)

    dropbox.com/s/tdr8cmulzdg6gqk/Spider_assistance.capx

    Thanks for the quick reply! : ]

  • Simulate move direction will only move the spider a tiny amount, you have to loop it. You could do that by setting variables when each corner is hit.

    I would structure the logic in a different way though : MoveToward Spider_Down, WhenOverlapping Spider_Down > MoveToward Spider_Left etc etc

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • or why not try the Pathfinding behaviour as well ..then you can enable or disable it as required and call movements to exact screen positions ..Pathfinding is pretty neat for that..if you need to control the path finding motion you could also add in CUSTOM (not necessarily solids) avoidance blocks that funnel the spider sprite to the correct location...These Block Sprites can be invisible :)

    The Pathfinding Behaviour has many other uses..than what you would think...like many of the prefab behaviours..

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