Multiple Families/Inheritance/Composition Patterns?

0 favourites
  • 1 posts
From the Asset Store
Be quick and choose the right answer for the shown equation.
  • Greetings! This is my first post and I'd like to start by pointing out how great this engine is!

    Coming from a heavy programming background, the idea of families is great and the magic that comes with it in the editor makes collection management a breeze.

    Is there a way to have families within families? For example, in Java, you can do multiple/horizontal inheritance (In PHP, this is known as Traits) that allow you to compose multiple classes together so an instances contains all of the properties, behaviors, and effects of that composed class. A conceptual example of that would be:

    Family: Gun has the following properties:

    Range

    RateOfFire

    Rounds

    MaxCapacity

    Family: Shotgun (treats Gun as a parent)

    SpreadAngle

    Family: Bazooka (treats Gun as a parent)

    ExplosiveRadius

    Family: PicatinnySystem (multiple inheritance/trait that can be added to anything that is a a Gun or has a Gun parent)

    NumberOfRailSlots

    If a Sprite was part of the Gun, Shotgun, and PicatinnySystem families, it would be spawned with the following properties:

    Range

    RateOfFire

    Rounds

    MaxCapacity

    SpreadAngle

    NumberOfRailSlots

    Does this already exist in Construct2? It would make organization and reusability much easier, thanks!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)