mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
non working layers
This commit is contained in:
parent
57135f3acc
commit
222fd09f3f
7 changed files with 58 additions and 30 deletions
|
|
@ -1,13 +1,15 @@
|
|||
define([
|
||||
"Game/Core/GameObjects/Tile",
|
||||
"Game/Config/Settings",
|
||||
"Lib/Utilities/NotificationCenter"
|
||||
"Lib/Utilities/NotificationCenter",
|
||||
"Game/Client/View/Abstract/Layer"
|
||||
],
|
||||
|
||||
function (Parent, Settings, Nc) {
|
||||
function (Parent, Settings, Nc, Layer) {
|
||||
|
||||
function Tile(physicsEngine, uid, options) {
|
||||
Parent.call(this, physicsEngine, uid, options);
|
||||
this.layerId = Layer.ID.TILE;
|
||||
}
|
||||
|
||||
Tile.prototype = Object.create(Parent.prototype);
|
||||
|
|
@ -27,10 +29,11 @@ function (Parent, Settings, Nc) {
|
|||
|
||||
var callback = function(mesh) {
|
||||
self.mesh = mesh;
|
||||
Nc.trigger(Nc.ns.client.view.mesh.add, mesh);
|
||||
Nc.trigger(Nc.ns.client.view.mesh.add, self.layerId, mesh);
|
||||
}
|
||||
|
||||
Nc.trigger(Nc.ns.client.view.mesh.create,
|
||||
this.layerId,
|
||||
texturePath,
|
||||
callback,
|
||||
{
|
||||
|
|
@ -45,13 +48,14 @@ function (Parent, Settings, Nc) {
|
|||
};
|
||||
|
||||
Tile.prototype.destroy = function() {
|
||||
Nc.trigger(Nc.ns.client.view.mesh.remove, this.mesh);
|
||||
Nc.trigger(Nc.ns.client.view.mesh.remove, this.layerId, this.mesh);
|
||||
Parent.prototype.destroy.call(this);
|
||||
};
|
||||
|
||||
Tile.prototype.render = function() {
|
||||
|
||||
Nc.trigger(Nc.ns.client.view.mesh.update,
|
||||
this.layerId,
|
||||
this.mesh,
|
||||
{
|
||||
x: this.body.GetPosition().x * Settings.RATIO,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue