How do I inheritence,polimorfizm

0 favourites
  • 4 posts
  • 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?

  • 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}

    }

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Sounds like your looking for Families.

  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)