Different variable for each family member?

0 favourites
  • 3 posts
From the Asset Store
A collection of various zombie characters sprites for creating a 2D platformer or sidescroller game
  • So I want to make a way to damage my enemies, but I have ( for now ) 3 different guys.

    I know how to make them receive damage, but I want to make it in a way so I dont have to write conditions for every enemy.

    The way to do it are families.

    And that is not hard but can I make that every enemy in my family has different amount of health.

    For example:

    FamilyEnemy on collision with sword = FamilyEnemy subtract 10 from EnemyHealth

    So EnemyHealth is family instance variable and its set to 100. But I need all 3 different enemies to have different amounts of health(50, 100, 150 ).

    Is there a way I can make every enemy have different amount of health, but still being in the family

  • Any instance variable affects that instance. This is the same for families. Each enemy's value is separate.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • OOOOooohhh check that out AHAHAHAh thanks man should have looked better.

    Thanks man.

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