Trying to make a two hit kill enemy

  • Basically I already figured out the variables for this. ex. When Hits=2 destroy sprite.

    What I want to ask is how can I set it up so that way when I blast one of these sprites once it doesn't destroy another sprite of the same type when I hit that one for the first time?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The hits variable must be instance variables of the enemy.

    then you can have an event like

    Bullet on collision with another object(enemy) > Enemy , add to 'Hits' 1

    -(subevent) Enemy.hits >= 2 , Enemy > Destroy

    The collision event already picks the instance that has collided, so if you destroy the enemy inside that event, it will already destroy the right instance.

  • The hits variable must be instance variables of the enemy.

    then you can have an event like

    Bullet on collision with another object(enemy) > Enemy , add to 'Hits' 1

    -(subevent) Enemy.hits >= 2 , Enemy > Destroy

    The collision event already picks the instance that has collided, so if you destroy the enemy inside that event, it will already destroy the right instance.

    It works! Thank you!

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