I want something that will handle object grouping. For instance, I can have a body, a cannon, threads and a machinegun turret on my tank.
Then, I want to group all those objects as a single "tank" object, such that collisions to the cannon register collisions to the "tank", if I tell construct to destroy "tank", it should also destroy machinegun and cannon and threads.
Also, suppose cannon has these variables
- Turn Rate
- Hit Chance
- Critical hit chance
and threads have these:
- Maximum Speed
- Speed on asphalt
- Speed on land
and body has these:
- Armor Treshold
- Heat resistance
- Piercing resistance
- Explosive resistance
the whole tank can have attributes that none of the parts have, such as:
- Hit points
- Shields
- Multiplayer ID
- Player Name
I should have a way to access a tank's specific cannon variables, for instance, such as "when tank is hit, disable his cannon for one second".
Adding objects of more than one type to such group would also be interesting, so we could pair an array (just an example) for each object instance, so we could keep track of "items" or "powerups" for that tank without needing to serialize them.
Is that what families do?