Multiple Families/Inheritance/Composition Patterns?

Discussion and feedback on Construct 2

Post » Thu Aug 25, 2016 11:28 am

Greetings! This is my first post and I'd like to start by pointing out how great this engine is! :D

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!
B
11
S
4
G
3
Posts: 1
Reputation: 1,802

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 10 guests