How do I create a family that encompases compound objects.

Get help using Construct 2

Post » Wed Sep 03, 2014 10:55 pm

Okay folks... this might be an impossible question...

I want to create a compound family object.

Each character in my game has the following objects:

1. CharacterSprite (the animation object)
2. CharacterCollider (with physics behavior attached)
3. CharacterState (checks for collisions up, down, left, and right. Also checks what direction the character is going relative to the direction of gravity. Using all of this the object sets flags for such things as "inAir" "Onground" and "OnLeftWall"
4. CharacterCollect (an object used to test for collisions with collectables and powerups)
5. CharacterHitBox (an object to test for collisions with objects that can damage it)

I also have a few extra objects to manage the butload of variables and constants needed for functionality.

All of these objects have to communicate with each other, but regardless of what the character is (fish, turtle, or bird), the character state will always do the same thing, but I need to know what its state is before I can tell it to fly. Setting this stuff up for every character in a game with dozens is tedious, repetitive and time consuming.

I can also say that I could write this up in C# using OOP with no trouble but I can't figure out how to do it in construct without being able to derive objects from one another. any ideas?

I thought about just creating a family for each type of object in the compound object and another family to rule over them, but then I am still left with creating a bunch of objects manually.

Thanks,
Image
B
33
S
11
G
2
Posts: 564
Reputation: 5,163

Post » Wed Sep 03, 2014 11:18 pm

So your different characters (fish, turtle, bird) are different object types, or different instances of CharacterSprite?
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Thu Sep 04, 2014 1:06 am

@codah - they would be objects that inherit the behavior of the compound object
Image
B
33
S
11
G
2
Posts: 564
Reputation: 5,163

Post » Thu Sep 04, 2014 1:31 am

Gotcha, so having FishSprite which contains those objects in a container, and have it in a 'state' Family won't work for you? Perhaps you need to give us a diagram of how you 'picture' the object structure (whether or not it would be possible in C2).
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596


Return to How do I....?

Who is online

Users browsing this forum: dop2000 and 20 guests