Trying to make a two hit kill enemy

0 favourites
  • 3 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported
  • 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?

  • 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.

  • 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.

    It works! Thank you!

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