The basic class for inheritance
Use this to make objects that can be extended
Compared to classic JavaScript inheritance, this method is a very user friendly but performance costly way, so gamvas uses this class only for objects that you are supposed to overwrite and that are not created on a per frame basis, and so should you
gamvas.Actor gamvas.ActorState gamvas.State
myExtendableObject = gamvas.Class.extend({ create: function(param) { // call super constructor this._super(param); // do our constructor stuff this._par = param; }, debug: function() { console.log(this._par); } }); var obj = new myExtendableObject('test'); obj.debug();
gamvas. | The basic class for inheritance |
Functions | |
extend | Exend a class |