Skip to content

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

Open
@g--o

Description

@g--o

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions