Help! One enemy in different positions?

  • Say in one layout, i add multiple instances of the same enemy (i.e. one enemy and different IDs). I have pinned those with boxes for animation purposes.

    The problem is that all of the instances of that enemy dies when i kill one of it. PLUS all of those behave in a similar way too (e.g all will turn left and right simultaneously depending upon the first instance of the sprite).

    Any HELP PLEASE!~!!!!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi,

    it's hard to tell without knowing your capx

    but I try it anyway:

    lets say you want to subtract 1 life on touch then it is important not just say "on touch" (here it would affect all enemies). You have to take "on touched object"

    with the walk left/right I have no idea what went wrong - so here a solution that works

    in this example you have to give the enemy a bullet behaviour, an instance variable "WalkingLeft" to false (if they start to the right), and an object they can collide with

    obj_Enemy > on collision with obj_Wall

    subevent: obj_enemy | is WalkingLeft || obj_enemy | bullet speed = -100; obj_enemy || set WalkingLeft to true

    subevent: obj_enemy | is NOT WalkingLeft || obj_enemy | bullet speed = 100; obj_enemy || set WalkingLeft to false

    hope this helps

  • i might not have explained it properly.

    Let me try again. The problem i am facing is that:

    I've added an enemy and made clone (copied it) in different locations of the layout (game stage). Now:

    -: all of my similar enemies die at once when only one of them is dead.

    -: All enemies behave depending upon the first one,

    Here's an example capx link: goo.gl/on69zO

  • The boxes work great - they behave perfectly like you planned it.

    The problem ist that you pinned all your enemies to the first box. And so, of course, the destroy behaviour is on this one first box.

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