[How do I] Enemy Ai2

0 favourites
From the Asset Store
Pixel Enemies for SHMUP consists of 45 enemy ship sprites to be used in your game.
  • Hello again guys, i got two problems

    • after the first enemy (yellow) spawns he is moving to my player and start attacking him if he is in range.. also

    i can jump over him and he turns to me, so far so good..

    but if the (purple) enemy is spawing, the yellow one stops looking in my direction, i can jump over him and he wont turn around.. (in the picture)

    and he is also the only one who can attack me, the (purple) enemy cannot attack as long as (yellow) is not dead

    if i jump over the (purple) one, both turn to me and if there would be a thrid one, ive to jump over him that both turn in my direction..

    what i need is a way how i can speak to each spawned zombie individually

    any idea?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It would be helpful if we could see your code snippet your are using currently.

  • It would be helpful if we could see your code snippet your are using currently.

    nothing special, thats what i got so far

  • Have you tried using a System- For Each Zombie, and then dropping in your distance check as a sub even to that?

  • Thanks the attacking part it is working!

    any solution for the other problem ?

  • Same thing, use the for each for your zombie moving events. I think that should fix it.

  • unfortunately not :/

    Should i do it all in one for each loop or two?

  • Can you post your CAPX file (File, save as single file) or email it too me at and I can take a look.

  • Can you post your CAPX file (File, save as single file) or email it too me at and I can take a look.

    I did

  • Seems to be working ok for me, or am I missing the problems?

    I do get a script error at the beginning, not sure what that's about.

    Here is a video of me testing it.

    http://screencast.com/t/5LFZcx6huME

  • Seems to be working ok for me, or am I missing the problems?

    I do get a script error at the beginning, not sure what that's about.

    Here is a video of me testing it.

    No its not, after two zombies spawned you jumped over the one with the hp and he didn't turn around

  • He does, but yeah, not immediately, I see what you mean.

    The second zombie does attack and kill me though, just tested that.

    OK, I'll look at the turn around thing.

  • The zombies do turn around, if you jump on the last spawned zombie his head

  • What's happening is the instructions to mirror is going to all zombies, but the comparison is only working the latest one put into play.

    Still looking at it.

  • Thanks sir

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