gamvas.Class

Description

The basic class for inheritance

Use this to make objects that can be extended

Note

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

See

gamvas.Actor gamvas.ActorState gamvas.State

Example

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();
Summary
gamvas.ClassThe basic class for inheritance
Functions
extendExend a class

Functions

extend

Description

Exend a class

Parameters

A object defining the extending class

Returns

A new class to be used for instancing

Note

The special function ‘create’ is used as constructor.  If you overwriting ‘create’ you always should call ‘this._super(params)’ as first command in ‘create’

The actor class is the most important class in gamvas.
A class for actor states
Game state class, overwrite for own states
Close