mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
moved some classes, added layer manager
This commit is contained in:
parent
1d3ad16a07
commit
b5c70687d8
11 changed files with 292 additions and 177 deletions
33
app/Game/Client/View/Abstract/Layer.js
Normal file
33
app/Game/Client/View/Abstract/Layer.js
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
define([
|
||||
"Lib/Utilities/Abstract",
|
||||
],
|
||||
|
||||
function (Abstract) {
|
||||
|
||||
function Layer(name, z, parallaxSpeed) {
|
||||
this.name = name;
|
||||
this.parallaxSpeed = parallaxSpeed;
|
||||
}
|
||||
|
||||
Object.defineProperty(Layer, 'ID', {
|
||||
value: {
|
||||
TILE: 'tile',
|
||||
ITEM: 'item',
|
||||
SPAWN: 'spawn'
|
||||
}
|
||||
});
|
||||
|
||||
Abstract.prototype.addMethod.call(Layer, 'show');
|
||||
Abstract.prototype.addMethod.call(Layer, 'hide');
|
||||
Abstract.prototype.addMethod.call(Layer, 'createMesh', ['texturePath', 'callback', 'options']);
|
||||
Abstract.prototype.addMethod.call(Layer, 'createAnimatedMesh', ['texturePaths', 'callback', 'options']);
|
||||
Abstract.prototype.addMethod.call(Layer, 'addMesh', ['mesh']);
|
||||
Abstract.prototype.addMethod.call(Layer, 'removeMesh', ['mesh']);
|
||||
Abstract.prototype.addMethod.call(Layer, 'updateMesh', ['mesh', 'options']);
|
||||
|
||||
Layer.prototype.getName = function() {
|
||||
return this.name;
|
||||
};
|
||||
|
||||
return Layer;
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue