Pre-Christmas update - family fun

I just deployed a new update, v0.1.1058, containing a single new feature: Object Families.

“What are object families?” you might ask, or “why did you add this instead of [insert your favorite feature idea here]?”. Those are great questions, so let me explain:

Object families are relationships between object types to allow for grouping and organization, and is intended to help cut down on the number and complexity of behaviors needed in your games. In the “properties” settings of each object type, there is a dropdown to select a “parent” object type. An object can have one parent, but any number of children.

When an object has a parent:

  1. The parent’s behaviors are run first, then the child’s behaviors are run
  2. Collision (or Proximity) behaviors that trigger on a parent will also trigger on their children
  3. Messages sent to a parent will also be received by their children

How this can help simplify your games:

  1. Fewer duplicate behaviors: to add common behaviors to many object types, add the behaviors to a parent type and the children will inherit that logic
  2. Fewer message behaviors: to send a message to many different object types, give them a common parent and target the message at the parent type
  3. Fewer collision/proximity triggers: to handle collisions (proximity) against many object types the same way, give them a common parent, and trigger against the parent

Here’s a simple example:

object type “Enemy” has movement logic, and can be damaged by the player
object type “Blob” has parent “Enemy”, so it will move and take damage with no new logic
object type “Alien” has parent “Enemy”, so it will move and take damage with no new logic, but maybe it has additional logic to drop items
object type “Boss Alien” has parent “Alien”, so it inherits all the same behaviors, but could add additional logic to go to the next level when destroyed

Now the player can add collisions for just the “Enemy” type, and be able to react to all types of enemies. The player can easily deliver messages to all enemy types by just sending a message to objects of the “Enemy” type.

Other ideas:

  • Make a single “Player” parent type, and make different player object types with no additional behaviors needed
  • Make user interface objects (button or menu objects) without piles of duplicated behaviors
  • ???

Keep in mind that this is a brand new feature, so please let me know if you find cases where it doesn’t behave the way you expect.

Questions? Comments? Let me know :slight_smile:

That means I could make different types of player ships.

That’s a pretty nice update… I needed this but I never noticed I need it ',:confused:

Thanks Grazer! You’re awesome!
Flowlab is my favorite thing! :smiley:

we need it to where you can modify the original behavior for the child, that way you could have the exact same thing but different trigger settings and such

@grazer families do not work on desktop builds

@jngthree - I have updated the windows build server to the latest code, so it has the new update now. The android build server won’t get updated to the latest until tomorrow, probably.


Why this happens on parents?

:open_mouth: thxs so much!! Awesome @grazer … keep w/ good work!

@grazer how would we make it To where we can mod the logic so it drops something when it dies- when the logic doesn’t show up