How do I made different AI for a single sprite

0 favourites
  • 6 posts
From the Asset Store
Adjusting the game screen for different resolutions (Letterbox scale)
  • Hello, I'm actually new on construct and i'm working on my first game who is a Top-Down Shooter. I created my player, my test enemy with a working AI ( I used pathfinding & FOV, if you want the .capx no problem i don't know how to describe it ) but now i want to duplicate this enemy but there is a problem, the AI doesn't work, some enemies don't recognize the player, please help...

  • if they are two different sprites then copying the code and just changing the enemy sprite in the code to the second enemy sprite.

    If the enemies are similar in attributes, how they are killed, then you might want to have the enemy sprite that already works have the second enemy as another animation. Then you just set the animation of the enemy of your choice when it spawns.

  • Well, i only have one sprite & 1 code for an enemy, (i want it to spawn multiples times) but some enemies can't see the player :/

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ok, I found where was the problem...

    But now I have another one, I need to add a "for each loop" BUT when I add it, it says that :

    That's my script:

  • Triggers happen outside of the main engine loop. You can't bury them in a for loop (as warned). "On start of layout" only happens once when the layout is loaded.

    Just move your "On pathfinding" out to the top and that should work. Same for "On start..", unless you create Enemies on the fly, then you just do that code at that time.

  • Triggers happen outside of the main engine loop. You can't bury them in a for loop (as warned). "On start of layout" only happens once when the layout is loaded.

    Just move your "On pathfinding" out to the top and that should work. Same for "On start..", unless you create Enemies on the fly, then you just do that code at that time.

    Thanks for your help, i will try it another day, I don't have time anymore :/

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