diff --git a/app/Game/Channel/Channel.js b/app/Game/Channel/Channel.js index d9628a9..bc9c124 100755 --- a/app/Game/Channel/Channel.js +++ b/app/Game/Channel/Channel.js @@ -50,7 +50,7 @@ var self = this; if(!this.gameController.level || !this.gameController.level.isLoaded) { - var token = Nc.on("game/level/loaded", function() { + var token = Nc.on(Nc.ns.core.game.events.level.loaded, function() { self.sendJoinSuccess(options); Nc.off(token); }); @@ -82,14 +82,14 @@ //Nc.trigger('user/' + user.id + "/joinSuccess", options); user.sendControlCommand("joinSuccess", options); - Nc.trigger('user/joined', user); + Nc.trigger(Nc.ns.channel.events.user.joined, user); this.broadcastControlCommandExcept("userJoined", user.options, user); }; Channel.prototype.onReleaseUser = function (userId) { var user = this.users[userId]; - Nc.trigger('user/left', userId); + Nc.trigger(Nc.ns.channel.events.user.left, userId); delete this.users[userId]; this.broadcastControlCommand("userLeft", userId); diff --git a/app/Game/Channel/GameController.js b/app/Game/Channel/GameController.js index 9131742..e59c8af 100755 --- a/app/Game/Channel/GameController.js +++ b/app/Game/Channel/GameController.js @@ -20,8 +20,8 @@ function (Parent, PhysicsEngine, Settings, PlayerController, requestAnimFrame, N Parent.call(this); - Nc.on('user/joined', this.onUserJoined, this); - Nc.on('user/left', this.onUserLeft, this); + Nc.on(Nc.ns.channel.events.user.joined, this.onUserJoined, this); + Nc.on(Nc.ns.channel.events.user.left, this.onUserLeft, this); Nc.on('user/resetLevel', this.onResetLevel, this); Nc.on('user/clientReady', this.onClientReady, this); Nc.on('player/killed', this.onPlayerKilled, this); diff --git a/app/Game/Channel/PipeToServer.js b/app/Game/Channel/PipeToServer.js index 113ceca..506403a 100755 --- a/app/Game/Channel/PipeToServer.js +++ b/app/Game/Channel/PipeToServer.js @@ -37,7 +37,7 @@ function (Nc, Channel) { }; PipeToServer.prototype.onMessage = function (message) { - Nc.trigger(message.recipient + '/controlCommand', message); + Nc.trigger(Nc.ns.channel.events.controlCommand + recipient, message); } PipeToServer.prototype.destroy = function() { diff --git a/app/Game/Client/Control/Input/MouseInput.js b/app/Game/Client/Control/Input/MouseInput.js index 7b9798d..ee66551 100755 --- a/app/Game/Client/Control/Input/MouseInput.js +++ b/app/Game/Client/Control/Input/MouseInput.js @@ -37,7 +37,7 @@ function (Parent, DomController, Settings, Nc) { var x = (((e.clientX - this.offsetLeft) / Settings.STAGE_WIDTH) * 2) - 1; var y = (((Settings.STAGE_HEIGHT - (e.clientY - this.offsetTop)) / Settings.STAGE_HEIGHT) * 2) -1; - Nc.trigger("input/onHandActionRequest", x, y); + Nc.trigger(Nc.ns.client.input.handAction.request, x, y); } }; diff --git a/app/Game/Client/Control/Input/XyInput.js b/app/Game/Client/Control/Input/XyInput.js index 9eba326..47864d4 100755 --- a/app/Game/Client/Control/Input/XyInput.js +++ b/app/Game/Client/Control/Input/XyInput.js @@ -12,7 +12,7 @@ function (Nc) { XyInput.prototype.onXyChange = function(x, y) { this.x = x; this.y = y; - Nc.trigger('input/onXyChange', x, y); + Nc.trigger(Nc.ns.client.input.xy.change, x, y); } return XyInput; diff --git a/app/Game/Client/Control/PlayerController.js b/app/Game/Client/Control/PlayerController.js index 5a08be2..b1ec7de 100755 --- a/app/Game/Client/Control/PlayerController.js +++ b/app/Game/Client/Control/PlayerController.js @@ -14,8 +14,8 @@ function (Parent, KeyboardInput, MouseInput, Nc) { this.keyboardInput = new KeyboardInput(this); this.xyInput = new MouseInput(this); - Nc.on("input/onXyChange", this.setXY, this); - Nc.on("input/onHandActionRequest", this.handActionRequest, this); + Nc.on(Nc.ns.client.input.xy.change, this.setXY, this); + Nc.on(Nc.ns.client.input.handAction.request, this.handActionRequest, this); var keys = { w:87, @@ -64,33 +64,33 @@ function (Parent, KeyboardInput, MouseInput, Nc) { PlayerController.prototype.moveLeft = function () { Parent.prototype.moveLeft.call(this); - Nc.trigger('sendGameCommand', 'moveLeft'); + Nc.trigger(Nc.ns.client.to.server.gameCommand.send, 'moveLeft'); } PlayerController.prototype.moveRight = function () { Parent.prototype.moveRight.call(this); - Nc.trigger('sendGameCommand', 'moveRight'); + Nc.trigger(Nc.ns.client.to.server.gameCommand.send, 'moveRight'); } PlayerController.prototype.stop = function () { Parent.prototype.stop.call(this); - Nc.trigger('sendGameCommand', 'stop'); + Nc.trigger(Nc.ns.client.to.server.gameCommand.send, 'stop'); } PlayerController.prototype.jump = function () { Parent.prototype.jump.call(this); - Nc.trigger('sendGameCommand', 'jump'); + Nc.trigger(Nc.ns.client.to.server.gameCommand.send, 'jump'); } PlayerController.prototype.jumpStop = function () { Parent.prototype.jumpStop.call(this); - Nc.trigger('sendGameCommand', 'jumpStop'); + Nc.trigger(Nc.ns.client.to.server.gameCommand.send, 'jumpStop'); } PlayerController.prototype.setXY = function(x, y) { var options = {x:x, y:y}; Parent.prototype.lookAt.call(this, options); - Nc.trigger('sendGameCommand', 'lookAt', options); + Nc.trigger(Nc.ns.client.to.server.gameCommand.send, 'lookAt', options); }; PlayerController.prototype.handActionLeft = function() { @@ -102,20 +102,20 @@ function (Parent, KeyboardInput, MouseInput, Nc) { }; PlayerController.prototype.suicide = function() { - Nc.trigger("sendGameCommand", "suicide"); + Nc.trigger(Nc.ns.client.to.server.gameCommand.send, "suicide"); }; PlayerController.prototype.handActionRequest = function(x, y) { var options = {x:x, y:y}; - Nc.trigger("sendGameCommand", "handActionRequest", options); + Nc.trigger(Nc.ns.client.to.server.gameCommand.send, "handActionRequest", options); }; PlayerController.prototype.showInfo = function() { - Nc.trigger("game/toggleInfo", true); + Nc.trigger(Nc.ns.client.view.gameInfo.toggle, true); }; PlayerController.prototype.hideInfo = function() { - Nc.trigger("game/toggleInfo", false); + Nc.trigger(Nc.ns.client.view.gameInfo.toggle, false); }; diff --git a/app/Game/Client/GameController.js b/app/Game/Client/GameController.js index f1e1c6e..a830b6d 100755 --- a/app/Game/Client/GameController.js +++ b/app/Game/Client/GameController.js @@ -18,7 +18,7 @@ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Nc, reque this.view = ViewManager.createView(); this.me = null; - Nc.on("game/toggleInfo", this.toggleInfo, this); + Nc.on(Nc.ns.client.view.gameInfo.toggle, this.toggleInfo, this); Parent.call(this); } diff --git a/app/Game/Client/GameObjects/Doll.js b/app/Game/Client/GameObjects/Doll.js index 970d185..baf0e60 100755 --- a/app/Game/Client/GameObjects/Doll.js +++ b/app/Game/Client/GameObjects/Doll.js @@ -35,12 +35,12 @@ function (Parent, Settings, Nc, Exception) { if(!state) throw new Exception("action state is undefined"); if(this.animatedMeshes[this.actionState]) { - Nc.trigger("view/updateMesh", this.animatedMeshes[this.actionState], { visible: false }); + Nc.trigger(Nc.ns.client.view.mesh.update, this.animatedMeshes[this.actionState], { visible: false }); } Parent.prototype.setActionState.call(this, state); - Nc.trigger("view/updateMesh", this.animatedMeshes[this.actionState], { visible: true }); + Nc.trigger(Nc.ns.client.view.mesh.update, this.animatedMeshes[this.actionState], { visible: true }); } Doll.prototype.createMesh = function() { @@ -74,7 +74,7 @@ function (Parent, Settings, Nc, Exception) { var callback = function(mesh) { self.animatedMeshes[key] = mesh; - Nc.trigger("view/addMesh", mesh); + Nc.trigger(Nc.ns.client.view.mesh.add, mesh); }; Nc.trigger("view/createAnimatedMesh", texturePaths, callback, { @@ -93,7 +93,7 @@ function (Parent, Settings, Nc, Exception) { var texturePath = Settings.GRAPHICS_PATH + "Characters/Chuck/head.png"; var callback = function (mesh) { self.headMesh = mesh; - Nc.trigger("view/addMesh", mesh); + Nc.trigger(Nc.ns.client.view.mesh.add, mesh); } Nc.trigger("view/createMesh", texturePath, callback, { pivot: { @@ -113,7 +113,7 @@ function (Parent, Settings, Nc, Exception) { if(oldLookDirection != this.lookDirection) { for(var key in this.animatedMeshes) { - Nc.trigger("view/updateMesh", + Nc.trigger(Nc.ns.client.view.mesh.update, this.animatedMeshes[key], { xScale: this.lookDirection @@ -124,7 +124,7 @@ function (Parent, Settings, Nc, Exception) { var angle = Math.atan2(this.lookAtXY.x, this.lookAtXY.y) / 2 - 0.7855 * this.lookDirection; // 0.7855 = 45° - Nc.trigger("view/updateMesh", + Nc.trigger(Nc.ns.client.view.mesh.update, this.headMesh, { xScale: this.lookDirection, @@ -136,17 +136,17 @@ function (Parent, Settings, Nc, Exception) { Doll.prototype.destroy = function () { for (var key in this.animatedMeshes) { - Nc.trigger("view/removeMesh", this.animatedMeshes[key]); + Nc.trigger(Nc.ns.client.view.mesh.remove, this.animatedMeshes[key]); } - Nc.trigger("view/removeMesh", this.headMesh); + Nc.trigger(Nc.ns.client.view.mesh.remove, this.headMesh); Parent.prototype.destroy.call(this); } Doll.prototype.render = function() { if(this.actionState) { - Nc.trigger("view/updateMesh", + Nc.trigger(Nc.ns.client.view.mesh.update, this.animatedMeshes[this.actionState], { x: this.body.GetPosition().x * Settings.RATIO, @@ -155,7 +155,7 @@ function (Parent, Settings, Nc, Exception) { } ); - Nc.trigger("view/updateMesh", + Nc.trigger(Nc.ns.client.view.mesh.update, this.headMesh, { x: this.body.GetPosition().x * Settings.RATIO, diff --git a/app/Game/Client/GameObjects/Item.js b/app/Game/Client/GameObjects/Item.js index 55d0a1c..81abaf8 100755 --- a/app/Game/Client/GameObjects/Item.js +++ b/app/Game/Client/GameObjects/Item.js @@ -22,7 +22,7 @@ function (Parent, Settings, Nc) { var callback = function(mesh) { self.mesh = mesh; - Nc.trigger("view/addMesh", mesh); + Nc.trigger(Nc.ns.client.view.mesh.add, mesh); } Nc.trigger("view/createMesh", @@ -40,13 +40,13 @@ function (Parent, Settings, Nc) { }; Item.prototype.destroy = function() { - Nc.trigger("view/removeMesh", this.mesh); + Nc.trigger(Nc.ns.client.view.mesh.remove, this.mesh); Parent.prototype.destroy.call(this); }; Item.prototype.render = function() { - Nc.trigger("view/updateMesh", + Nc.trigger(Nc.ns.client.view.mesh.update, this.mesh, { x: this.body.GetPosition().x * Settings.RATIO, @@ -62,7 +62,7 @@ function (Parent, Settings, Nc) { Parent.prototype.flip.call(this, direction); if(oldFlipDirection != direction) { - Nc.trigger("view/updateMesh", + Nc.trigger(Nc.ns.client.view.mesh.update, this.mesh, { xScale: direction diff --git a/app/Game/Client/GameObjects/Items/RagDoll.js b/app/Game/Client/GameObjects/Items/RagDoll.js index 3249705..c31b004 100644 --- a/app/Game/Client/GameObjects/Items/RagDoll.js +++ b/app/Game/Client/GameObjects/Items/RagDoll.js @@ -37,7 +37,7 @@ function (Parent, CoreItem, Settings, Nc) { self.limbMeshes[name] = mesh; } - Nc.trigger("view/addMesh", mesh); + Nc.trigger(Nc.ns.client.view.mesh.add, mesh); } Nc.trigger("view/createMesh", @@ -60,7 +60,7 @@ function (Parent, CoreItem, Settings, Nc) { if(this.limbs) { for(var name in this.limbMeshes) { if(this.limbs[name]) { - Nc.trigger("view/updateMesh", + Nc.trigger(Nc.ns.client.view.mesh.update, this.limbMeshes[name], { x: this.limbs[name].GetPosition().x * Settings.RATIO, @@ -80,7 +80,7 @@ function (Parent, CoreItem, Settings, Nc) { CoreItem.prototype.flip.call(this, direction); if(oldFlipDirection != direction) { - Nc.trigger("view/updateMesh", + Nc.trigger(Nc.ns.client.view.mesh.update, this.mesh, { xScale: direction @@ -88,7 +88,7 @@ function (Parent, CoreItem, Settings, Nc) { ); for (var name in this.limbMeshes) { - Nc.trigger("view/updateMesh", + Nc.trigger(Nc.ns.client.view.mesh.update, this.limbMeshes[name], { xScale: direction @@ -100,7 +100,7 @@ function (Parent, CoreItem, Settings, Nc) { RagDoll.prototype.destroy = function() { for (var name in this.limbMeshes) { - Nc.trigger("view/removeMesh", this.limbMeshes[name]); + Nc.trigger(Nc.ns.client.view.mesh.remove, this.limbMeshes[name]); }; Parent.prototype.destroy.call(this); diff --git a/app/Game/Client/GameObjects/Tile.js b/app/Game/Client/GameObjects/Tile.js index f278154..c599576 100755 --- a/app/Game/Client/GameObjects/Tile.js +++ b/app/Game/Client/GameObjects/Tile.js @@ -27,7 +27,7 @@ function (Parent, Settings, Nc) { var callback = function(mesh) { self.mesh = mesh; - Nc.trigger("view/addMesh", mesh); + Nc.trigger(Nc.ns.client.view.mesh.add, mesh); } Nc.trigger("view/createMesh", @@ -45,13 +45,13 @@ function (Parent, Settings, Nc) { }; Tile.prototype.destroy = function() { - Nc.trigger("view/removeMesh", this.mesh); + Nc.trigger(Nc.ns.client.view.mesh.remove, this.mesh); Parent.prototype.destroy.call(this); }; Tile.prototype.render = function() { - Nc.trigger("view/updateMesh", + Nc.trigger(Nc.ns.client.view.mesh.update, this.mesh, { x: this.body.GetPosition().x * Settings.RATIO, diff --git a/app/Game/Client/Loader/Level.js b/app/Game/Client/Loader/Level.js index 65a17eb..f732196 100755 --- a/app/Game/Client/Loader/Level.js +++ b/app/Game/Client/Loader/Level.js @@ -39,7 +39,7 @@ function (Parent, Settings, Nc, PIXI) { loader.onComplete = function() { callback(levelData); }; loader.onProgress = function() { var progress = parseInt(100 / numPaths * ++count, 10) + 1; - Nc.trigger("view/updateLoader", progress); + Nc.trigger(Nc.ns.client.view.preloadBar.update, progress); } loader.load(); }; diff --git a/app/Game/Client/Networker.js b/app/Game/Client/Networker.js index 3608a5c..0bf9258 100755 --- a/app/Game/Client/Networker.js +++ b/app/Game/Client/Networker.js @@ -26,8 +26,8 @@ function (ProtocolHelper, GameController, User, Nc, Settings, DomController) { ProtocolHelper.applyCommand(message, self); }); - Nc.on("sendGameCommand", this.sendGameCommand, this); - Nc.on("game/level/loaded", this.onLevelLoaded, this); + Nc.on(Nc.ns.client.to.server.gameCommand.send, this.sendGameCommand, this); + Nc.on(Nc.ns.core.game.events.level.loaded, this.onLevelLoaded, this); } // Socket callbacks diff --git a/app/Game/Client/Physics/Engine.js b/app/Game/Client/Physics/Engine.js index 839e609..b368571 100755 --- a/app/Game/Client/Physics/Engine.js +++ b/app/Game/Client/Physics/Engine.js @@ -13,7 +13,7 @@ function (Parent, Settings, DomController, Box2D, Nc) { this.debugMode = false; - Nc.on("view/toggleDebugMode", this.onToggleDebugMode, this); + Nc.on(Nc.ns.client.view.debugMode.toggle, this.onToggleDebugMode, this); } Engine.prototype = Object.create(Parent.prototype); diff --git a/app/Game/Client/Player.js b/app/Game/Client/Player.js index b21171c..3863274 100755 --- a/app/Game/Client/Player.js +++ b/app/Game/Client/Player.js @@ -102,7 +102,7 @@ function (Parent, Nc, Settings) { Player.prototype.destroy = function() { Parent.prototype.destroy.call(this); - Nc.trigger("view/removePlayerInfo", this.playerInfoView); + Nc.trigger(Nc.ns.client.view.playerInfo.remove, this.playerInfoView); }; return Player; diff --git a/app/Game/Client/View/DomController.js b/app/Game/Client/View/DomController.js index fb0a054..cf28622 100755 --- a/app/Game/Client/View/DomController.js +++ b/app/Game/Client/View/DomController.js @@ -13,7 +13,7 @@ function (Settings, Nc, Stats, Screenfull) { this.stats = null; this.ping = null; - Nc.on("view/ready", this.initDevTools, this); + Nc.on(Nc.ns.client.view.events.ready, this.initDevTools, this); } DomController.prototype.initDevTools = function() { @@ -39,7 +39,7 @@ function (Settings, Nc, Stats, Screenfull) { window.onresize = function() { if(Screenfull.enabled) { - Nc.trigger("view/fullscreenChange", Screenfull.isFullscreen); + Nc.trigger("Nc.ns.client.view.fullscreen.change", Screenfull.isFullscreen); } } @@ -71,7 +71,7 @@ function (Settings, Nc, Stats, Screenfull) { var checkbox = document.createElement("input"); checkbox.type = "checkbox"; checkbox.onclick = function(e) { - Nc.trigger("view/toggleDebugMode", e.target.checked); + Nc.trigger(Nc.ns.client.view.debugMode.toggle, e.target.checked); self.getDebugCanvas().style.display = e.target.checked ? "" : "none"; } label.appendChild(checkbox); diff --git a/app/Game/Client/View/ViewManager.js b/app/Game/Client/View/ViewManager.js index a71f1fd..3e3da85 100755 --- a/app/Game/Client/View/ViewManager.js +++ b/app/Game/Client/View/ViewManager.js @@ -36,7 +36,7 @@ function (Settings, Exception, AbstractView, PixiView, Nc) { throw new Exception("In the view", Settings.VIEW_CONTROLLER + 'View', "this.setCanvas(canvas) has not been called with a valid HTMLCanvasElement!"); } - Nc.trigger("view/ready", view); + Nc.trigger(Nc.ns.client.view.events.ready, view); return view; } diff --git a/app/Game/Client/View/Views/AbstractView.js b/app/Game/Client/View/Views/AbstractView.js index 32cc69d..8497e51 100755 --- a/app/Game/Client/View/Views/AbstractView.js +++ b/app/Game/Client/View/Views/AbstractView.js @@ -14,20 +14,20 @@ function (DomController, Settings, Exception, Nc) { Nc.on("view/createMesh", this.createMesh, this); Nc.on("view/createAnimatedMesh", this.createAnimatedMesh, this); - Nc.on("view/addMesh", this.addMesh, this); - Nc.on("view/removeMesh", this.removeMesh, this); - Nc.on("view/updateMesh", this.updateMesh, this); + Nc.on(Nc.ns.client.view.mesh.add, this.addMesh, this); + Nc.on(Nc.ns.client.view.mesh.remove, this.removeMesh, this); + Nc.on(Nc.ns.client.view.mesh.update, this.updateMesh, this); - Nc.on("view/fullscreenChange", this.onFullscreenChange, this); - Nc.on("view/toggleDebugMode", this.onToggleDebugMode, this); + Nc.on("Nc.ns.client.view.fullscreen.change", this.onFullscreenChange, this); + Nc.on(Nc.ns.client.view.debugMode.toggle, this.onToggleDebugMode, this); Nc.on("view/toggleInfo", this.onToggleInfo, this); Nc.on("view/createAndAddPlayerInfo", this.onCreateAndAddPlayerInfo, this); Nc.on("view/updatePlayerInfo", this.onUpdatePlayerInfo, this); - Nc.on("view/removePlayerInfo", this.onRemovePlayerInfo, this); + Nc.on(Nc.ns.client.view.playerInfo.remove, this.onRemovePlayerInfo, this); - Nc.on("view/updateLoader", this.onUpdateLoader, this); + Nc.on(Nc.ns.client.view.preloadBar.update, this.onUpdateLoader, this); } AbstractView.prototype.isWebGlEnabled = function () { diff --git a/app/Game/Config/Settings.js b/app/Game/Config/Settings.js index 04a5dae..9922ab4 100755 --- a/app/Game/Config/Settings.js +++ b/app/Game/Config/Settings.js @@ -18,7 +18,7 @@ define(function() { GRAPHICS_SUBPATH_CHARACTERS: 'Characters/', GRAPHICS_SUBPATH_TILES: 'Tiles/', MAPS_PATH: 'static/maps/tiled/', - DEFAULT_LEVELS: ['stones2', 'debug'], + DEFAULT_LEVELS: ['debug', 'stones2', 'debug'], RATIO: 21, //35 // original tile size is 25 but we want it to resize to 20 diff --git a/app/Game/Core/GameController.js b/app/Game/Core/GameController.js index 1579d68..2fac437 100755 --- a/app/Game/Core/GameController.js +++ b/app/Game/Core/GameController.js @@ -16,10 +16,10 @@ function (PhysicsEngine, TiledLevel, Player, Nc) { this.physicsEngine = new PhysicsEngine(); this.physicsEngine.setCollisionDetector(); - Nc.on("game/level/loaded", this.onLevelLoaded, this); + Nc.on(Nc.ns.core.game.events.level.loaded, this.onLevelLoaded, this); - Nc.on("game/object/add", this.onGameObjectAdd, this); - Nc.on("game/object/remove", this.onGameObjectRemove, this); + Nc.on(Nc.ns.core.game.gameObject.add, this.onGameObjectAdd, this); + Nc.on(Nc.ns.core.game.gameObject.remove, this.onGameObjectRemove, this); this.update(); } diff --git a/app/Game/Core/GameObjects/Items/RagDoll.js b/app/Game/Core/GameObjects/Items/RagDoll.js index c13317a..03130e3 100644 --- a/app/Game/Core/GameObjects/Items/RagDoll.js +++ b/app/Game/Core/GameObjects/Items/RagDoll.js @@ -163,7 +163,7 @@ function (Parent, Box2D, Settings, Nc) { ); - Nc.trigger("game/object/add", 'animated', this); + Nc.trigger(Nc.ns.core.game.gameObject.add, 'animated', this); } RagDoll.prototype = Object.create(Parent.prototype); @@ -362,7 +362,7 @@ function (Parent, Box2D, Settings, Nc) { }; RagDoll.prototype.destroy = function() { - Nc.trigger("game/object/remove", 'animated', this); + Nc.trigger(Nc.ns.core.game.gameObject.remove, 'animated', this); var world = this.body.GetWorld(); Parent.prototype.destroy.call(this); diff --git a/app/Game/Core/Loader/Level.js b/app/Game/Core/Loader/Level.js index e718682..68a67e0 100755 --- a/app/Game/Core/Loader/Level.js +++ b/app/Game/Core/Loader/Level.js @@ -28,7 +28,7 @@ define([ self.createTiles(); self.createItems(); self.isLoaded = true; - Nc.trigger("game/level/loaded"); + Nc.trigger(Nc.ns.core.game.events.level.loaded); }); } diff --git a/app/Game/Core/Player.js b/app/Game/Core/Player.js index 7209806..d0c0254 100755 --- a/app/Game/Core/Player.js +++ b/app/Game/Core/Player.js @@ -40,7 +40,7 @@ function (Doll, Settings, Nc, Exception, SpectatorDoll, RagDoll) { this.doll = new Doll(this.physicsEngine, "doll-" + this.id, this); this.doll.spawn(x, y); this.isSpawned = true; - Nc.trigger("game/object/add", 'animated', this.doll); + Nc.trigger(Nc.ns.core.game.gameObject.add, 'animated', this.doll); } Player.prototype.getPosition = function () { @@ -120,7 +120,7 @@ function (Doll, Settings, Nc, Exception, SpectatorDoll, RagDoll) { this.isSpawned = false; - Nc.trigger("game/object/remove", 'animated', this.doll); + Nc.trigger(Nc.ns.core.game.gameObject.remove, 'animated', this.doll); this.doll.destroy(); this.doll = null; diff --git a/lab/Worker.js b/lab/Worker.js index c4e1962..62483bb 100755 --- a/lab/Worker.js +++ b/lab/Worker.js @@ -40,7 +40,7 @@ function (Parent, ProtocolHelper, GameController, User, Nc) { } }, this); - Nc.on("sendGameCommand", this.sendGameCommand, this); + Nc.on(Nc.ns.client.to.server.gameCommand.send, this.sendGameCommand, this); } Worker.prototype.sendCommand = function (command, options) {