How do I explain the difference between Family and Object Type in this example?

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

    I'm studying the Falling blocks example in construct 3.

    Why does the top right part fall when I replace Block.x and Block.y with Family1.x and Family1.y

    in this condition (see the attached image).

    Thanks in advance,

  • This is a common trick which allows to refer to two instances of the same object in one event.

    Event #6 picks one block instance with specific UID. Event #7 checks if that instance is falling.

    Now you need to find if there are any other instances of block overlapping your picked block, but you can't do that because block inside this event refers to only one instance with that UID.

    So the trick is to use the family. Family acts like a different object, so you can pick different family instances in the same event.

  • Thanks for the answer!

    But I don't understand how we can use Block.x in the event while manipulating Family.

    I mean, we could have something unrelated to Block which is a subtype of Family.

    Is construct allowing "Block.x" use because the parent event explicitly filters for "Block" ?

    Sorry for the delay

  • Is construct allowing "Block.x" use because the parent event explicitly filters for "Block" ?


    Conditions "filters" the number of instances picked and to which the actions are applied.

    As dop2000 was explaining, one instance of block is picked in event 6 and 7.

    So in event 8, checking the coordinates of "Block" is only done against the coordinates of the single picked instance.

    On the other hand, the family "Family1" is considered as its "own object type" in this instance, so it has no instances picked before the conditions of event 8.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Alright Thanks!

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