Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Considering inheritance: Components, Sprites, Point2d+Vector #8

Open
g--o opened this issue Jul 27, 2018 · 0 comments
Open

Considering inheritance: Components, Sprites, Point2d+Vector #8

g--o opened this issue Jul 27, 2018 · 0 comments

Comments

@g--o
Copy link
Owner

g--o commented Jul 27, 2018

Basically using a paradigm of inheritance via:

function child_ctor(...) {
    parent_constructor.call(this, ...);

    // actual initiator
    this.init = function() { ... };

    //...

    this.init();
}

The problems considering this option are:

  • Breaks the getComponent related methods somehow
  • Different sprites want to override update/render while retaining parent's update/render as seperate method.
  • For point2d: inherits methods that don't really apply to points as a concept like dot product
@g--o g--o changed the title Considering inheritance on: Components, Sprites, Point2d+Vector Considering inheritance: Components, Sprites, Point2d+Vector Jul 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant