How do I make some enemy AI?

0 favourites
  • 2 posts
From the Asset Store
Enemy turtles pack including fifteen fully animated variations
  • Hello, I am making a top-down shooter game and I'm having some trouble making some enemy AI. I'm using a state machine and I the enemy to have 3 stages:

    An idle stage where the enemy roams around the map

    An attack stage where the enemy turns to the player or the players teammate (Whoever is in the enemies line of sight) and shoots at them

    A chase stage where the enemy goes to its target's last seen position once the target breaks the line of sight.

    The player is accompanied by teammates that are also targets for the enemy.

    Any help is greatly appreciated!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • What exactly are you having trouble with? It will be unlikely anyone is going to put together the whole thing for you.

    So you've defined your states. Use an instance variable to keep track of the state.

    Then define the conditions under which you want to change the state.

    Then define the actions you want to take in each state.

    You should then have your AI basically complete. Make adjustments as needed if anything behaves outside expectations after testing. Ask if you can't figure out how to implement a specific thing to your liking.

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