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
1
Posts: 30
Reputation: 977

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
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Wed Aug 01, 2012 6:01 pm

Sounds like Families would solve this.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,518

Post » Wed Aug 01, 2012 6:06 pm

You could also use OR events!
but families is the obvious solution..
B
36
S
10
G
6
Posts: 948
Reputation: 11,101

Post » Mon Aug 06, 2012 7:52 pm

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


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, Braus, dingalingboy and 4 guests