How do I make different AI for same sprites?

0 favourites
  • 3 posts
From the Asset Store
Adjusting the game screen for different resolutions (Letterbox scale)
  • Well, as the title says, I want to know how to make different AI for each enemy, I have the AI, the problem is that all enemies that are the same sprite move always together, I mean, the AI is simple, its just like "choose(Move left, Move Right)" and then, "Wait (1, 2, 3, 4, etc... seconds)" and then "choose(Move Left, Move Right)" again, its like a loop, the problem is that all enemies move the same direction and they all wait the exact same time, what I want is to have same sprites but they have their own pattern.

    PS: Srry if you dont understand at all, Im not english :p

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Just a few quick thoughts

    You have a lot of different options.

    e.g. give the enemies an instance variable like enemyAItype

    or all enemys have a unique UID - you could ask for that number and for every number multiple of 3 (modula) use this AI

    or move slower faster with random generated number

    or don't spawn them on the same time

  • Well, as the title says, I want to know how to make different AI for each enemy, I have the AI, the problem is that all enemies that are the same sprite move always together, I mean, the AI is simple, its just like "choose(Move left, Move Right)" and then, "Wait (1, 2, 3, 4, etc... seconds)" and then "choose(Move Left, Move Right)" again, its like a loop, the problem is that all enemies move the same direction and they all wait the exact same time, what I want is to have same sprites but they have their own pattern.

    PS: Srry if you dont understand at all, Im not english :p

    You are missing a "For each Enemy" some where.

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