Object Classes

Get help using Construct 2

Post » Wed Aug 01, 2012 5:00 pm

Dear all,

I would like to know how can i make a "parent" object class. For example instead to have an event for each type of collision ie "bullet - blue monster" i would like to have a "bullet- enemy" event and be able to have different kinds of enemies to be checked under the same event. In example:

Enemy class,
Health
Speed


Enemy Blue
Health = 5
Speed = 10
Sprite: X

Enemy Red
Health = 10
Speed = 20
Sprite: Y

But i would like to check for collisions with Enemy in general, not with Blue and Red specifically.

Best regards,



B
6
S
2
Posts: 30
Reputation: 1,127

Post » Wed Aug 01, 2012 5:03 pm

I'd either use different animations within the same object, or families.
Forgive me if I misunderstood what you wanted ;)
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,699

Post » Wed Aug 01, 2012 6:01 pm

Sounds like Families would solve this.
Scirra Founder
B
399
S
236
G
89
Posts: 24,546
Reputation: 195,436

Post » Wed Aug 01, 2012 6:06 pm

You could also use OR events!
but families is the obvious solution..
B
37
S
11
G
6
Posts: 962
Reputation: 11,259

Post » Mon Aug 06, 2012 7:52 pm

Families is the solution. Thank you all for your help.
B
6
S
2
Posts: 30
Reputation: 1,127


Return to How do I....?

Who is online

Users browsing this forum: warmty, Yahoo [Bot] and 18 guests