find out what object of a family is Active

0 favourites
  • 9 posts
From the Asset Store
A collection of various zombie characters sprites for creating a 2D platformer or sidescroller game
  • Hello,

    Im wondering how can i find out what Object from the family is "active"?

    is there a function that can retrieve "object_name"?

    Thank you

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • What does "Active" means?

  • I mean for example,

    Familie1 contains x amount of objects:

    ObjectA (not in family) collides with familie1

    Active would be the object from family1 that objectA colided with....

  • If you do something like

    ObjectA: On collision with family1
      -> family1: destroy

    The only object that will be destroyed it the object in family1 that collides with ObjectA

    Condition does picking.

  • Ok so in my code i have like x amount of Objects in a family

    On colision event the following code is exactly the same for all x objects however with 1 diference

    Each object has an amount of points that it adds to score

    My question is how do i pass the correct score?

    i dont know if this makes any sence to you, if not i will post the events when i get home....

  • Add a family variable called 'point' which hold the amount of point for each object in the family and then

    Global number score = 0
    ObjectA: On collision with family1
      -> System: add family1.point to score
      -> family1: destroy
  • Lets try again :)

    Family1 contains:

    Enemy1 (add 20 points on kill)

    enemy2 (add 10 points on kill)

    Enemyx (add x points on kill)

    what im asking is a way where i can do 1 collision event instead of 1 for each of my enemies..

    but if i do Collision with Family1 how do i know what point amount to pass to score?

    What you suggest is to divide enemies in categories per families like

    family1 (20 points) family2 (10 points)

    However this does not work since i only have 1 object per score but several scores..

    Hope its clear now, sorry if its complicated :)

  • no you didn't understand my point so I think I'll make a capx 'cause we will run in circle.

    Hop! familyOfEnemies.capx

  • thank you!

    I did not see that every object gains a variable from the family..

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