How do I inheritence,polimorfizm

Get help using Construct 2

Post » Fri Jul 03, 2015 8:16 pm

I have 22 pieces of character.
These characters fighters and it is able to be struck by them because of this,to kick.
Since all 22 characters are capable of the hit, a kick because of this these may be an abstract class's parts.
The characters would inherit this though the class and would define onto their own kick, their hit.
In this program,how can be realised the programming one is used in languages inheritance,multiformity?
B
14
S
2
Posts: 66
Reputation: 776

Post » Fri Jul 03, 2015 8:25 pm

EXAMPLE:
Abstract class characters {
Virtual void kick()
Virtual void jump()
}

class MikeFighter: characters {
Void kick() { define Mike style kick}
Void jump { define Mike style jump}
}

class JoeFighter: characters {
Void kick() { define Joe style kick}
Void jump { define joe style jump}
}
B
14
S
2
Posts: 66
Reputation: 776

Post » Fri Jul 03, 2015 8:44 pm

Sounds like your looking for Families.
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,592

Post » Fri Jul 03, 2015 9:03 pm

Families are quasi classes. You can put an object in a family and it sort of treats them generically, so you can do things like have different ships and common code. It doesn't really do what you want though, it's a bit limited and it's not easy to change after the effect, but it can be useful.
My tutorial through development blog is at http://myconstruct2dev.blogspot.co.uk/
B
12
S
3
Posts: 221
Reputation: 1,328


Return to How do I....?

Who is online

Users browsing this forum: Akia410, katzin and 7 guests