diff --git a/app/Game/Channel/Channel.js b/app/Game/Channel/Channel.js index 856ba8a..12f192b 100755 --- a/app/Game/Channel/Channel.js +++ b/app/Game/Channel/Channel.js @@ -7,7 +7,7 @@ "Game/Config/Settings" ], - function (GameController, Nc, User, ProtocolHelper, Options, Settings) { + function (GameController, nc, User, ProtocolHelper, Options, Settings) { "use strict"; @@ -26,14 +26,14 @@ }); // Notification Center - Nc.on(Nc.ns.channel.events.round.end, this.onEndRound, this); - Nc.on(Nc.ns.channel.events.controlCommand.channel, function (message) { + nc.on(nc.ns.channel.events.round.end, this.onEndRound, this); + nc.on(nc.ns.channel.events.controlCommand.channel, function (message) { ProtocolHelper.applyCommand(message.data, self); }); - Nc.on(Nc.ns.channel.to.client.gameCommand.broadcast, this.broadcastGameCommand, this); - Nc.on(Nc.ns.channel.to.client.controlCommand.broadcast, this.broadcastControlCommand, this); - //Nc.on(Nc.ns.channel.to.client.gameCommand.broadcastExcept, this.broadcastGameCommandExcept, this); - //Nc.on(Nc.ns.channel.to.client.controlCommand.broadcastExcept, this.broadcastControlCommandExcept, this); + nc.on(nc.ns.channel.to.client.gameCommand.broadcast, this.broadcastGameCommand, this); + nc.on(nc.ns.channel.to.client.controlCommand.broadcast, this.broadcastControlCommand, this); + //nc.on(nc.ns.channel.to.client.gameCommand.broadcastExcept, this.broadcastGameCommandExcept, this); + //nc.on(nc.ns.channel.to.client.controlCommand.broadcastExcept, this.broadcastControlCommandExcept, this); this.beginRound(); @@ -103,10 +103,10 @@ }; if(!this.gameController.level || !this.gameController.level.isLoaded) { - var token = Nc.on(Nc.ns.core.game.events.level.loaded, function() { + var token = nc.on(nc.ns.core.game.events.level.loaded, function() { self.sendJoinSuccess(options); self.users[options.id].sendControlCommand("beginRound", clientGameControllerOptions); - Nc.off(token); + nc.off(token); }); } else { this.sendJoinSuccess(options); @@ -135,16 +135,16 @@ levelUid: levelUid }; - //Nc.trigger("user/" + user.id + "/joinSuccess", options); + //nc.trigger("user/" + user.id + "/joinSuccess", options); user.sendControlCommand("joinSuccess", options); - Nc.trigger(Nc.ns.channel.events.user.joined, user); + nc.trigger(nc.ns.channel.events.user.joined, user); this.broadcastControlCommandExcept("userJoined", user.options, user); }; Channel.prototype.onReleaseUser = function (userId) { var self = this; - Nc.trigger(Nc.ns.channel.events.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/Control/PlayerController.js b/app/Game/Channel/Control/PlayerController.js index b84b42e..c9e55d3 100755 --- a/app/Game/Channel/Control/PlayerController.js +++ b/app/Game/Channel/Control/PlayerController.js @@ -5,7 +5,7 @@ define([ "Game/Config/Settings" ], -function(Parent, Nc, Parser, Settings) { +function(Parent, nc, Parser, Settings) { "use strict"; @@ -71,7 +71,7 @@ function(Parent, Nc, Parser, Settings) { lv: body.GetLinearVelocity() }; - Nc.trigger(Nc.ns.channel.to.client.user.gameCommand.send + this.player.id, "positionStateReset", options); + nc.trigger(nc.ns.channel.to.client.user.gameCommand.send + this.player.id, "positionStateReset", options); } }; diff --git a/app/Game/Channel/GameController.js b/app/Game/Channel/GameController.js index 4e85302..4f5f5b5 100755 --- a/app/Game/Channel/GameController.js +++ b/app/Game/Channel/GameController.js @@ -11,7 +11,7 @@ define([ "Game/Channel/GameObjects/Items/RubeDoll" ], -function (Parent, PhysicsEngine, Settings, requestAnimFrame, Nc, Box2D, Player, GameObject, Doll, RubeDoll) { +function (Parent, PhysicsEngine, Settings, requestAnimFrame, nc, Box2D, Player, GameObject, Doll, RubeDoll) { "use strict"; @@ -25,12 +25,12 @@ function (Parent, PhysicsEngine, Settings, requestAnimFrame, Nc, Box2D, Player, Parent.call(this, options); this.ncTokens = this.ncTokens.concat([ - Nc.on(Nc.ns.channel.events.user.joined, this.onUserJoined, this), - Nc.on(Nc.ns.channel.events.user.left, this.onUserLeft, this), - Nc.on(Nc.ns.channel.events.user.level.reset, this.onResetLevel, this), - Nc.on(Nc.ns.channel.events.user.client.ready, this.onClientReady, this), - Nc.on(Nc.ns.core.game.events.level.loaded, this.onLevelLoaded, this), - Nc.on(Nc.ns.channel.events.game.player.killed, this.onPlayerKilled, 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(nc.ns.channel.events.user.level.reset, this.onResetLevel, this), + nc.on(nc.ns.channel.events.user.client.ready, this.onClientReady, this), + nc.on(nc.ns.core.game.events.level.loaded, this.onLevelLoaded, this), + nc.on(nc.ns.channel.events.game.player.killed, this.onPlayerKilled, this), ]); console.checkpoint('starting game controller for channel (' + options.channelName + ')'); @@ -65,7 +65,7 @@ function (Parent, PhysicsEngine, Settings, requestAnimFrame, Nc, Box2D, Player, }; GameController.prototype.clearItemsOfPlayerFingerPrints = function(player) { - Nc.trigger(Nc.ns.channel.events.game.player.clearFingerPrints, player); + nc.trigger(nc.ns.channel.events.game.player.clearFingerPrints, player); }; GameController.prototype.createPlayer = function(user) { @@ -79,7 +79,7 @@ function (Parent, PhysicsEngine, Settings, requestAnimFrame, Nc, Box2D, Player, GameController.prototype.onPlayerKilled = function(player, killedByPlayer) { if(killedByPlayer.stats.score >= this.options.scoreLimit) { - Nc.trigger(Nc.ns.channel.events.round.end); + nc.trigger(nc.ns.channel.events.round.end); } else { this.spawnPlayer(player, Settings.RESPAWN_TIME); } @@ -102,7 +102,7 @@ function (Parent, PhysicsEngine, Settings, requestAnimFrame, Nc, Box2D, Player, y: spawnPoint.y }; - Nc.trigger(Nc.ns.channel.to.client.gameCommand.broadcast, "spawnPlayer", options); + nc.trigger(nc.ns.channel.to.client.gameCommand.broadcast, "spawnPlayer", options); var i = self.spawnTimeouts.indexOf(spawnTimeout); self.spawnTimeouts.splice(i, 1); @@ -117,7 +117,7 @@ function (Parent, PhysicsEngine, Settings, requestAnimFrame, Nc, Box2D, Player, var update = this.getWorldUpdateObject(false); if(Object.getOwnPropertyNames(update).length > 0) { - Nc.trigger(Nc.ns.channel.to.client.gameCommand.broadcast, "worldUpdate", update); + nc.trigger(nc.ns.channel.to.client.gameCommand.broadcast, "worldUpdate", update); } this.worldUpdateTimeout = setTimeout(this.updateWorld.bind(this), Settings.NETWORK_UPDATE_INTERVAL); @@ -232,7 +232,7 @@ function (Parent, PhysicsEngine, Settings, requestAnimFrame, Nc, Box2D, Player, userId: userId }; - Nc.trigger(Nc.ns.channel.to.client.user.gameCommand.send + userId, "clientReadyResponse", options); + nc.trigger(nc.ns.channel.to.client.user.gameCommand.send + userId, "clientReadyResponse", options); this.spawnPlayer(player, 0); }; @@ -255,7 +255,7 @@ function (Parent, PhysicsEngine, Settings, requestAnimFrame, Nc, Box2D, Player, console.log('OH NO!!! ON RESET LEVEL IS CALLED AND RESPAWNES PLAYERS'); Parent.prototype.onResetLevel.call(this); - Nc.trigger(Nc.ns.channel.to.client.gameCommand.broadcast, "resetLevel", true); + nc.trigger(nc.ns.channel.to.client.gameCommand.broadcast, "resetLevel", true); for (var key in this.players) { this.spawnPlayer(this.players[key]); } diff --git a/app/Game/Channel/GameObjects/Doll.js b/app/Game/Channel/GameObjects/Doll.js index 10516ba..572beac 100755 --- a/app/Game/Channel/GameObjects/Doll.js +++ b/app/Game/Channel/GameObjects/Doll.js @@ -6,7 +6,7 @@ define([ "Lib/Utilities/Assert" ], -function (Parent, Item, Box2D, Nc, Assert) { +function (Parent, Item, Box2D, nc, Assert) { "use strict"; @@ -80,7 +80,7 @@ function (Parent, Item, Box2D, Nc, Assert) { self.player.addDamage(damage, lastMovedPlayer, item); }; - Nc.trigger(Nc.ns.channel.engine.worldQueue.add, callback); + nc.trigger(nc.ns.channel.engine.worldQueue.add, callback); } } diff --git a/app/Game/Channel/GameObjects/Item.js b/app/Game/Channel/GameObjects/Item.js index c335182..0bdb334 100755 --- a/app/Game/Channel/GameObjects/Item.js +++ b/app/Game/Channel/GameObjects/Item.js @@ -3,7 +3,7 @@ define([ "Lib/Utilities/NotificationCenter", ], -function (Parent, Nc) { +function (Parent, nc) { "use strict"; @@ -13,7 +13,7 @@ function (Parent, Nc) { this.lastMoved = null; this.ncTokens = (this.ncTokens || []).concat([ - Nc.on(Nc.ns.channel.events.game.player.clearFingerPrints, this.clearOfPlayerFingerPrints, this) + nc.on(nc.ns.channel.events.game.player.clearFingerPrints, this.clearOfPlayerFingerPrints, this) ]); } diff --git a/app/Game/Channel/GameObjects/Items/RagDoll.js b/app/Game/Channel/GameObjects/Items/RagDoll.js index 9576a73..1c02792 100644 --- a/app/Game/Channel/GameObjects/Items/RagDoll.js +++ b/app/Game/Channel/GameObjects/Items/RagDoll.js @@ -4,7 +4,7 @@ define([ "Lib/Utilities/NotificationCenter" ], -function (Parent, Settings, Nc) { +function (Parent, Settings, nc) { "use strict"; @@ -35,7 +35,7 @@ function (Parent, Settings, Nc) { var self = this; this.scheduledForDestruction = true; this.destructionTimeout = setTimeout(function() { - Nc.trigger(Nc.ns.channel.to.client.gameCommand.broadcast, 'removeGameObject', { + nc.trigger(nc.ns.channel.to.client.gameCommand.broadcast, 'removeGameObject', { type: 'animated', uid: self.uid }); diff --git a/app/Game/Channel/GameObjects/Items/RubeDoll.js b/app/Game/Channel/GameObjects/Items/RubeDoll.js index def8c0e..c03199e 100644 --- a/app/Game/Channel/GameObjects/Items/RubeDoll.js +++ b/app/Game/Channel/GameObjects/Items/RubeDoll.js @@ -4,7 +4,7 @@ define([ "Lib/Utilities/NotificationCenter" ], -function (Parent, Settings, Nc) { +function (Parent, Settings, nc) { "use strict"; @@ -35,7 +35,7 @@ function (Parent, Settings, Nc) { var self = this; this.scheduledForDestruction = true; this.destructionTimeout = setTimeout(function() { - Nc.trigger(Nc.ns.channel.to.client.gameCommand.broadcast, 'removeGameObject', { + nc.trigger(nc.ns.channel.to.client.gameCommand.broadcast, 'removeGameObject', { type: 'animated', uid: self.uid }); diff --git a/app/Game/Channel/PipeToServer.js b/app/Game/Channel/PipeToServer.js index 760a08b..c25e34d 100755 --- a/app/Game/Channel/PipeToServer.js +++ b/app/Game/Channel/PipeToServer.js @@ -5,7 +5,7 @@ define([ "fs" ], -function (Nc, Channel, Settings, fs) { +function (nc, Channel, Settings, fs) { "use strict"; @@ -14,7 +14,7 @@ function (Nc, Channel, Settings, fs) { this.process = process; this.recordingFileName = null; - Nc.on(Nc.ns.channel.to.server.controlCommand.send, this.send, this); + nc.on(nc.ns.channel.to.server.controlCommand.send, this.send, this); process.on("message", this.onProcessMessage.bind(this)); } @@ -82,10 +82,10 @@ function (Nc, Channel, Settings, fs) { PipeToServer.prototype.onMessage = function (message) { switch(message.recipient) { case "channel": - Nc.trigger(Nc.ns.channel.events.controlCommand.channel, message); + nc.trigger(nc.ns.channel.events.controlCommand.channel, message); break; default: - Nc.trigger(Nc.ns.channel.events.controlCommand.user + message.recipient, message); + nc.trigger(nc.ns.channel.events.controlCommand.user + message.recipient, message); break; } diff --git a/app/Game/Channel/Player.js b/app/Game/Channel/Player.js index e4f5846..7c32014 100755 --- a/app/Game/Channel/Player.js +++ b/app/Game/Channel/Player.js @@ -4,7 +4,7 @@ define([ "Game/Channel/Control/PlayerController" ], -function (Parent, Nc, PlayerController) { +function (Parent, nc, PlayerController) { "use strict"; @@ -44,7 +44,7 @@ function (Parent, Nc, PlayerController) { this.throw(options, item); options.action = "throw"; - Nc.trigger(Nc.ns.channel.to.client.gameCommand.broadcast, "handActionResponse", options); + nc.trigger(nc.ns.channel.to.client.gameCommand.broadcast, "handActionResponse", options); } } else { // grab @@ -52,7 +52,7 @@ function (Parent, Nc, PlayerController) { this.grab(item); options.action = "grab"; - Nc.trigger(Nc.ns.channel.to.client.gameCommand.broadcast, "handActionResponse", options); + nc.trigger(nc.ns.channel.to.client.gameCommand.broadcast, "handActionResponse", options); } } }; @@ -93,14 +93,14 @@ function (Parent, Nc, PlayerController) { var ragDollId = this.stats.deaths; Parent.prototype.kill.call(this, killedByPlayer, ragDollId); - Nc.trigger(Nc.ns.channel.to.client.gameCommand.broadcast, "playerKill", { + nc.trigger(nc.ns.channel.to.client.gameCommand.broadcast, "playerKill", { playerId: this.id, killedByPlayerId: killedByPlayer.id, ragDollId: ragDollId, item: byItem ? byItem.options.name : "Suicide" }); - Nc.trigger(Nc.ns.channel.events.game.player.killed, this, killedByPlayer); // sends endround + nc.trigger(nc.ns.channel.events.game.player.killed, this, killedByPlayer); // sends endround if(this.ragDoll) { this.ragDoll.delayedDestroy(); @@ -112,13 +112,13 @@ function (Parent, Nc, PlayerController) { }; Player.prototype.broadcastStats = function(enemy) { - Nc.trigger(Nc.ns.channel.to.client.gameCommand.broadcast, "updateStats", { + nc.trigger(nc.ns.channel.to.client.gameCommand.broadcast, "updateStats", { playerId: this.id, stats: this.stats }); if(enemy && enemy != this) { - Nc.trigger(Nc.ns.channel.to.client.gameCommand.broadcast, "updateStats", { + nc.trigger(nc.ns.channel.to.client.gameCommand.broadcast, "updateStats", { playerId: enemy.id, stats: enemy.stats }); diff --git a/app/Game/Channel/User.js b/app/Game/Channel/User.js index d8fcd78..fe8b56e 100755 --- a/app/Game/Channel/User.js +++ b/app/Game/Channel/User.js @@ -5,7 +5,7 @@ define([ "Lib/Utilities/Protocol/Parser", ], -function(Parent, Nc, ProtocolHelper, ProtocolParser) { +function(Parent, nc, ProtocolHelper, ProtocolParser) { function User(id, options) { Parent.call(this, id, options); @@ -14,15 +14,15 @@ function(Parent, Nc, ProtocolHelper, ProtocolParser) { this.isReady = false; var self = this; - Nc.on(Nc.ns.channel.to.client.user.controlCommand.joinSuccess + this.id, function(options) { + nc.on(nc.ns.channel.to.client.user.controlCommand.joinSuccess + this.id, function(options) { self.sendControlCommand("joinSuccess", options); }); - Nc.on(Nc.ns.channel.events.controlCommand.user + this.id, function(message) { + nc.on(nc.ns.channel.events.controlCommand.user + this.id, function(message) { ProtocolHelper.applyCommand(message.data, self); }); - Nc.on(Nc.ns.channel.to.client.user.gameCommand.send + this.id, function(command, options) { + nc.on(nc.ns.channel.to.client.user.gameCommand.send + this.id, function(command, options) { self.sendGameCommand(command, options); }); @@ -44,10 +44,10 @@ function(Parent, Nc, ProtocolHelper, ProtocolParser) { } // FIXME: move this to Protocol helper as a function if(command.hasOwnProperty("resetLevel")) { - Nc.trigger(Nc.ns.channel.events.user.level.reset, this.id); + nc.trigger(nc.ns.channel.events.user.level.reset, this.id); } else if(command.hasOwnProperty("clientReady")) { this.isReady = true; - Nc.trigger(Nc.ns.channel.events.user.client.ready, this.id); + nc.trigger(nc.ns.channel.events.user.client.ready, this.id); } else { this.player.playerController.applyCommand(command); } @@ -71,7 +71,7 @@ function(Parent, Nc, ProtocolHelper, ProtocolParser) { this.isReady = false; } - Nc.trigger(Nc.ns.channel.to.server.controlCommand.send, recipient, data); + nc.trigger(nc.ns.channel.to.server.controlCommand.send, recipient, data); }; User.prototype.sendGameCommand = function(command, options) { diff --git a/app/Game/Client/Control/Input.js b/app/Game/Client/Control/Input.js index 242a689..b163541 100755 --- a/app/Game/Client/Control/Input.js +++ b/app/Game/Client/Control/Input.js @@ -2,7 +2,7 @@ define([ "Lib/Utilities/NotificationCenter" ], -function (Nc) { +function (nc) { function Input(playerController) { this.playerController = playerController; diff --git a/app/Game/Client/Control/PlayerController.js b/app/Game/Client/Control/PlayerController.js index 5e8033f..e64f740 100755 --- a/app/Game/Client/Control/PlayerController.js +++ b/app/Game/Client/Control/PlayerController.js @@ -6,7 +6,7 @@ define([ "Game/Client/PointerLockManager" ], -function (Parent, Nc, KeyboardAndMouse, Gamepad, PointerLockManager) { +function (Parent, nc, KeyboardAndMouse, Gamepad, PointerLockManager) { "use strict"; @@ -29,85 +29,85 @@ function (Parent, Nc, KeyboardAndMouse, Gamepad, PointerLockManager) { PlayerController.prototype.moveLeft = function () { if (!this.isPlayerInputAllowed()) return; Parent.prototype.moveLeft.call(this); - Nc.trigger(Nc.ns.client.to.server.gameCommand.send, 'moveLeft'); + nc.trigger(nc.ns.client.to.server.gameCommand.send, 'moveLeft'); } PlayerController.prototype.moveRight = function () { if (!this.isPlayerInputAllowed()) return; Parent.prototype.moveRight.call(this); - Nc.trigger(Nc.ns.client.to.server.gameCommand.send, 'moveRight'); + nc.trigger(nc.ns.client.to.server.gameCommand.send, 'moveRight'); } // always allow to stop, to prevent endless running PlayerController.prototype.stop = function () { Parent.prototype.stop.call(this); - Nc.trigger(Nc.ns.client.to.server.gameCommand.send, 'stop'); + nc.trigger(nc.ns.client.to.server.gameCommand.send, 'stop'); } PlayerController.prototype.jump = function () { if (!this.isPlayerInputAllowed()) return; Parent.prototype.jump.call(this); - Nc.trigger(Nc.ns.client.to.server.gameCommand.send, 'jump'); + nc.trigger(nc.ns.client.to.server.gameCommand.send, 'jump'); } // always allow to stop. PlayerController.prototype.jumpStop = function () { Parent.prototype.jumpStop.call(this); - Nc.trigger(Nc.ns.client.to.server.gameCommand.send, 'jumpStop'); + nc.trigger(nc.ns.client.to.server.gameCommand.send, 'jumpStop'); } PlayerController.prototype.setXY = function(x, y) { if (!this.isPlayerInputAllowed()) return; var options = {x:x, y:y}; Parent.prototype.lookAt.call(this, options); - Nc.trigger(Nc.ns.client.to.server.gameCommand.send, 'lookAt', options); + nc.trigger(nc.ns.client.to.server.gameCommand.send, 'lookAt', options); }; PlayerController.prototype.suicide = function() { if (!this.isPlayerInputAllowed()) return; - Nc.trigger(Nc.ns.client.to.server.gameCommand.send, "suicide"); + nc.trigger(nc.ns.client.to.server.gameCommand.send, "suicide"); }; PlayerController.prototype.handActionRequest = function(options) { if (!this.isPlayerInputAllowed()) return; - Nc.trigger(Nc.ns.client.to.server.gameCommand.send, "handActionRequest", options); + nc.trigger(nc.ns.client.to.server.gameCommand.send, "handActionRequest", options); }; PlayerController.prototype.showInfo = function() { if (!this.isPlayerInputAllowed()) return; - Nc.trigger(Nc.ns.client.game.gameStats.toggle, true); + nc.trigger(nc.ns.client.game.gameStats.toggle, true); }; PlayerController.prototype.hideInfo = function() { if (!this.isPlayerInputAllowed()) return; - Nc.trigger(Nc.ns.client.game.gameStats.toggle, false); + nc.trigger(nc.ns.client.game.gameStats.toggle, false); }; PlayerController.prototype.zoomIn = function() { if (!this.isPlayerInputAllowed()) return; - Nc.trigger(Nc.ns.client.game.zoomIn, true); + nc.trigger(nc.ns.client.game.zoomIn, true); }; PlayerController.prototype.zoomOut = function() { if (!this.isPlayerInputAllowed()) return; - Nc.trigger(Nc.ns.client.game.zoomOut, false); + nc.trigger(nc.ns.client.game.zoomOut, false); }; PlayerController.prototype.zoomReset = function() { if (!this.isPlayerInputAllowed()) return; - Nc.trigger(Nc.ns.client.game.zoomReset, false); + nc.trigger(nc.ns.client.game.zoomReset, false); }; PlayerController.prototype.activateModifier = function() { if (!this.isPlayerInputAllowed()) return; Parent.prototype.activateModifier.call(this); - Nc.trigger(Nc.ns.client.to.server.gameCommand.send, "activateModifier"); + nc.trigger(nc.ns.client.to.server.gameCommand.send, "activateModifier"); }; PlayerController.prototype.deactivateModifier = function() { if (!this.isPlayerInputAllowed()) return; Parent.prototype.deactivateModifier.call(this); - Nc.trigger(Nc.ns.client.to.server.gameCommand.send, "deactivateModifier"); + nc.trigger(nc.ns.client.to.server.gameCommand.send, "deactivateModifier"); }; /* diff --git a/app/Game/Client/Control/Swiper.js b/app/Game/Client/Control/Swiper.js index 5017639..7e0909f 100644 --- a/app/Game/Client/Control/Swiper.js +++ b/app/Game/Client/Control/Swiper.js @@ -2,7 +2,7 @@ define([ "Lib/Utilities/NotificationCenter", ], -function (Nc) { +function (nc) { var MAX_LENGTH = 200; var MIN_LENGTH = 5; @@ -42,7 +42,7 @@ function (Nc) { } var i = points.length - 1; - Nc.trigger(Nc.ns.client.view.swiper.swipe, points[i].x, points[i].y); + nc.trigger(nc.ns.client.view.swiper.swipe, points[i].x, points[i].y); } Swiper.prototype.updateLengthSum = function(currentLength) { @@ -135,7 +135,7 @@ function (Nc) { var sumx = 0; var sumy = 0; - Nc.trigger(Nc.ns.client.view.swiper.end); + nc.trigger(nc.ns.client.view.swiper.end); for(var i=0, count = this.points.length; i < count; i++) { var p = this.points[i]; @@ -166,7 +166,7 @@ function (Nc) { Swiper.prototype.destroy = function() { for (var i = 0; i < this.ncTokens.length; i++) { - Nc.off(this.ncTokens[i]); + nc.off(this.ncTokens[i]); }; }; diff --git a/app/Game/Client/GameController.js b/app/Game/Client/GameController.js index dfb8165..a752cdd 100755 --- a/app/Game/Client/GameController.js +++ b/app/Game/Client/GameController.js @@ -18,7 +18,7 @@ define([ "Lib/Utilities/Exception" ], -function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Nc, requestAnimFrame, Settings, GameObject, Doll, domController, ProtocolHelper, Me, AudioPlayer, PointerLockManager, Assert, Exception) { +function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, nc, requestAnimFrame, Settings, GameObject, Doll, domController, ProtocolHelper, Me, AudioPlayer, PointerLockManager, Assert, Exception) { "use strict"; @@ -33,7 +33,7 @@ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Nc, reque Parent.call(this, options); this.ncTokens = this.ncTokens.concat([ - Nc.on(Nc.ns.client.game.gameStats.toggle, this.toggleGameStats, this) + nc.on(nc.ns.client.game.gameStats.toggle, this.toggleGameStats, this) ]); } @@ -55,7 +55,7 @@ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Nc, reque this.mePositionStateOverride(); } - Nc.trigger(Nc.ns.client.game.events.render); + nc.trigger(nc.ns.client.game.events.render); this.view.render(); domController.fpsStep(); @@ -63,8 +63,8 @@ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Nc, reque GameController.prototype.mePositionStateOverride = function() { if(this.me.isPositionStateOverrideNeeded()) { - Nc.trigger( - Nc.ns.client.to.server.gameCommand.send, + nc.trigger( + nc.ns.client.to.server.gameCommand.send, "mePositionStateOverride", this.me.getPositionStateOverride() ); @@ -214,7 +214,7 @@ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Nc, reque return 0; }); - Nc.trigger(Nc.ns.client.view.gameStats.update, sortedPlayers); + nc.trigger(nc.ns.client.view.gameStats.update, sortedPlayers); }; GameController.prototype.onPlayerKill = function(options) { @@ -222,7 +222,7 @@ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Nc, reque var killedByPlayer = this.players[options.killedByPlayerId]; player.kill(killedByPlayer, options.ragDollId); - Nc.trigger(Nc.ns.client.view.gameStats.kill, { + nc.trigger(nc.ns.client.view.gameStats.kill, { victim: { name: player.user.options.nickname, isMe: player === this.me @@ -248,7 +248,7 @@ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Nc, reque }; GameController.prototype.toggleGameStats = function(show) { - Nc.trigger(Nc.ns.client.view.gameStats.toggle, show); + nc.trigger(nc.ns.client.view.gameStats.toggle, show); }; GameController.prototype.beginRound = function() { diff --git a/app/Game/Client/GameObjects/Doll.js b/app/Game/Client/GameObjects/Doll.js index a617746..a5ea6b4 100755 --- a/app/Game/Client/GameObjects/Doll.js +++ b/app/Game/Client/GameObjects/Doll.js @@ -7,7 +7,7 @@ define([ "Game/Client/View/Abstract/Layer", ], -function (Parent, Settings, Nc, Exception, ColorConverter, Layer) { +function (Parent, Settings, nc, Exception, ColorConverter, Layer) { "use strict"; @@ -50,14 +50,14 @@ function (Parent, Settings, Nc, Exception, ColorConverter, Layer) { if(!state) throw new Exception("action state is undefined"); if(this.animatedMeshes[this.actionState]) { - Nc.trigger( - Nc.ns.client.view.mesh.update, + nc.trigger( + nc.ns.client.view.mesh.update, this.layerId, this.animatedMeshesContainer.withArms[this.actionState], { visible: false } ); - Nc.trigger( - Nc.ns.client.view.mesh.update, + nc.trigger( + nc.ns.client.view.mesh.update, this.layerId, this.animatedMeshesContainer.withoutArms[this.actionState], { visible: false } @@ -66,8 +66,8 @@ function (Parent, Settings, Nc, Exception, ColorConverter, Layer) { Parent.prototype.setActionState.call(this, state); - Nc.trigger( - Nc.ns.client.view.mesh.update, + nc.trigger( + nc.ns.client.view.mesh.update, this.layerId, this.animatedMeshes[this.actionState], { @@ -82,7 +82,7 @@ function (Parent, Settings, Nc, Exception, ColorConverter, Layer) { var self = this; var setShirtColor = function (mesh) { - Nc.trigger(Nc.ns.client.view.mesh.addFilter, self.layerId, mesh, 'colorRangeReplace', { + nc.trigger(nc.ns.client.view.mesh.addFilter, self.layerId, mesh, 'colorRangeReplace', { minColor: 0x3b4a31, maxColor: 0x657f54, newColor: self.primaryColor, @@ -131,12 +131,12 @@ function (Parent, Settings, Nc, Exception, ColorConverter, Layer) { var callback = function(mesh) { self.animatedMeshesContainer[arm][key] = mesh; - Nc.trigger(Nc.ns.client.view.mesh.add, self.layerId, mesh); + nc.trigger(nc.ns.client.view.mesh.add, self.layerId, mesh); setShirtColor(mesh); }; - Nc.trigger(Nc.ns.client.view.animatedMesh.create, this.layerId, texturePaths, callback, { + nc.trigger(nc.ns.client.view.animatedMesh.create, this.layerId, texturePaths, callback, { visible: false, pivot: { x: 0, @@ -159,9 +159,9 @@ function (Parent, Settings, Nc, Exception, ColorConverter, Layer) { var texturePath = Settings.GRAPHICS_PATH + "Characters/Chuck/head.png"; var callback = function (mesh) { self.headMesh = mesh; - Nc.trigger(Nc.ns.client.view.mesh.add, self.layerId, mesh); + nc.trigger(nc.ns.client.view.mesh.add, self.layerId, mesh); } - Nc.trigger(Nc.ns.client.view.mesh.create, this.layerId, texturePath, callback, { + nc.trigger(nc.ns.client.view.mesh.create, this.layerId, texturePath, callback, { pivot: { x: 5, y: 12 @@ -179,10 +179,10 @@ function (Parent, Settings, Nc, Exception, ColorConverter, Layer) { texturePath = Settings.GRAPHICS_PATH + "Characters/Chuck/holdingArm.png"; var callback = function (mesh) { self.holdingArmMesh = mesh; - Nc.trigger(Nc.ns.client.view.mesh.add, self.layerId, mesh); + nc.trigger(nc.ns.client.view.mesh.add, self.layerId, mesh); setShirtColor(mesh); } - Nc.trigger(Nc.ns.client.view.mesh.create, this.layerId, texturePath, callback, { + nc.trigger(nc.ns.client.view.mesh.create, this.layerId, texturePath, callback, { visible: false, pivot: { //x: 35/2 * 4, @@ -206,7 +206,7 @@ function (Parent, Settings, Nc, Exception, ColorConverter, Layer) { if(oldLookDirection != this.lookDirection) { for(var key in this.animatedMeshes) { - Nc.trigger(Nc.ns.client.view.mesh.update, + nc.trigger(nc.ns.client.view.mesh.update, this.layerId, this.animatedMeshes[key], { @@ -215,7 +215,7 @@ function (Parent, Settings, Nc, Exception, ColorConverter, Layer) { ); } - Nc.trigger(Nc.ns.client.view.mesh.update, + nc.trigger(nc.ns.client.view.mesh.update, this.layerId, this.holdingArmMesh, { @@ -226,7 +226,7 @@ function (Parent, Settings, Nc, Exception, ColorConverter, Layer) { var angle = Math.atan2(this.lookAtXY.x, this.lookAtXY.y) / 2 - 0.7855 * this.lookDirection; // 0.7855 = 45° - Nc.trigger(Nc.ns.client.view.mesh.update, + nc.trigger(nc.ns.client.view.mesh.update, this.layerId, this.headMesh, { @@ -240,22 +240,22 @@ function (Parent, Settings, Nc, Exception, ColorConverter, Layer) { Parent.prototype.grab.call(this, item); this.animatedMeshes = this.animatedMeshesContainer.withoutArms; this.setActionState(this.actionState, true); - Nc.trigger(Nc.ns.client.view.mesh.update, this.layerId, this.holdingArmMesh, { visible: true }); + nc.trigger(nc.ns.client.view.mesh.update, this.layerId, this.holdingArmMesh, { visible: true }); }; Doll.prototype.throw = function(item, options) { Parent.prototype.throw.call(this, item, options); this.animatedMeshes = this.animatedMeshesContainer.withArms; this.setActionState(this.actionState, true); - Nc.trigger(Nc.ns.client.view.mesh.update, this.layerId, this.holdingArmMesh, { visible: false }); + nc.trigger(nc.ns.client.view.mesh.update, this.layerId, this.holdingArmMesh, { visible: false }); }; Doll.prototype.destroy = function () { for (var key in this.animatedMeshes) { - Nc.trigger(Nc.ns.client.view.mesh.remove, this.layerId, this.animatedMeshes[key]); + nc.trigger(nc.ns.client.view.mesh.remove, this.layerId, this.animatedMeshes[key]); } - Nc.trigger(Nc.ns.client.view.mesh.remove, this.layerId, this.headMesh); + nc.trigger(nc.ns.client.view.mesh.remove, this.layerId, this.headMesh); Parent.prototype.destroy.call(this); } @@ -272,7 +272,7 @@ function (Parent, Settings, Nc, Exception, ColorConverter, Layer) { var factor = stepLength / 30; - Nc.trigger(Nc.ns.client.view.mesh.update, + nc.trigger(nc.ns.client.view.mesh.update, this.layerId, this.animatedMeshes[this.actionState], { @@ -283,7 +283,7 @@ function (Parent, Settings, Nc, Exception, ColorConverter, Layer) { } ); - Nc.trigger(Nc.ns.client.view.mesh.update, + nc.trigger(nc.ns.client.view.mesh.update, this.layerId, this.headMesh, { @@ -292,7 +292,7 @@ function (Parent, Settings, Nc, Exception, ColorConverter, Layer) { } ) - Nc.trigger(Nc.ns.client.view.mesh.update, + nc.trigger(nc.ns.client.view.mesh.update, this.layerId, this.holdingArmMesh, { diff --git a/app/Game/Client/GameObjects/GameObject.js b/app/Game/Client/GameObjects/GameObject.js index 4067b7e..f193bbc 100755 --- a/app/Game/Client/GameObjects/GameObject.js +++ b/app/Game/Client/GameObjects/GameObject.js @@ -4,7 +4,7 @@ define([ "Lib/Utilities/NotificationCenter" ], -function (Parent, Exception, Nc) { +function (Parent, Exception, nc) { "use strict"; diff --git a/app/Game/Client/GameObjects/Item.js b/app/Game/Client/GameObjects/Item.js index 3770dce..f798416 100755 --- a/app/Game/Client/GameObjects/Item.js +++ b/app/Game/Client/GameObjects/Item.js @@ -5,7 +5,7 @@ define([ "Game/Client/View/Abstract/Layer" ], -function (Parent, Settings, Nc, Layer) { +function (Parent, Settings, nc, Layer) { "use strict"; @@ -14,7 +14,7 @@ function (Parent, Settings, Nc, Layer) { Parent.call(this, physicsEngine, uid, options); this.ncTokens = this.ncTokens.concat([ - Nc.on(Nc.ns.client.game.events.render, this.render, this) + nc.on(nc.ns.client.game.events.render, this.render, this) ]); } @@ -30,10 +30,10 @@ function (Parent, Settings, Nc, Layer) { var callback = function(mesh) { self.mesh = mesh; - Nc.trigger(Nc.ns.client.view.mesh.add, self.layerId, mesh); + nc.trigger(nc.ns.client.view.mesh.add, self.layerId, mesh); } - Nc.trigger(Nc.ns.client.view.mesh.create, + nc.trigger(nc.ns.client.view.mesh.create, this.layerId, texturePath, callback, @@ -49,13 +49,13 @@ function (Parent, Settings, Nc, Layer) { }; Item.prototype.destroy = function() { - Nc.trigger(Nc.ns.client.view.mesh.remove, this.layerId, this.mesh); + nc.trigger(nc.ns.client.view.mesh.remove, this.layerId, this.mesh); Parent.prototype.destroy.call(this); }; Item.prototype.render = function() { - Nc.trigger(Nc.ns.client.view.mesh.update, + nc.trigger(nc.ns.client.view.mesh.update, this.layerId, this.mesh, { @@ -72,7 +72,7 @@ function (Parent, Settings, Nc, Layer) { Parent.prototype.flip.call(this, direction); if(oldFlipDirection != direction) { - Nc.trigger(Nc.ns.client.view.mesh.update, + nc.trigger(nc.ns.client.view.mesh.update, this.layerId, this.mesh, { diff --git a/app/Game/Client/GameObjects/Items/RagDoll.js b/app/Game/Client/GameObjects/Items/RagDoll.js index c5bf84a..73e0b83 100644 --- a/app/Game/Client/GameObjects/Items/RagDoll.js +++ b/app/Game/Client/GameObjects/Items/RagDoll.js @@ -6,7 +6,7 @@ define([ "Game/Client/View/Abstract/Layer" ], -function (Parent, CoreItem, Settings, Nc, Layer) { +function (Parent, CoreItem, Settings, nc, Layer) { "use strict"; @@ -40,10 +40,10 @@ function (Parent, CoreItem, Settings, Nc, Layer) { self.limbMeshes[name] = mesh; } - Nc.trigger(Nc.ns.client.view.mesh.add, self.layerId, mesh); + nc.trigger(nc.ns.client.view.mesh.add, self.layerId, mesh); } - Nc.trigger(Nc.ns.client.view.mesh.create, + nc.trigger(nc.ns.client.view.mesh.create, this.layerId, texturePath + name + ".png", callback, @@ -64,7 +64,7 @@ function (Parent, CoreItem, Settings, Nc, Layer) { if(this.limbs) { for(var name in this.limbMeshes) { if(this.limbs[name]) { - Nc.trigger(Nc.ns.client.view.mesh.update, + nc.trigger(nc.ns.client.view.mesh.update, this.layerId, this.limbMeshes[name], { @@ -85,7 +85,7 @@ function (Parent, CoreItem, Settings, Nc, Layer) { CoreItem.prototype.flip.call(this, direction); if(oldFlipDirection != direction) { - Nc.trigger(Nc.ns.client.view.mesh.update, + nc.trigger(nc.ns.client.view.mesh.update, this.layerId, this.mesh, { @@ -94,7 +94,7 @@ function (Parent, CoreItem, Settings, Nc, Layer) { ); for (var name in this.limbMeshes) { - Nc.trigger(Nc.ns.client.view.mesh.update, + nc.trigger(nc.ns.client.view.mesh.update, this.layerId, this.limbMeshes[name], { @@ -108,7 +108,7 @@ function (Parent, CoreItem, Settings, Nc, Layer) { RagDoll.prototype.destroy = function() { for (var name in this.limbMeshes) { - Nc.trigger(Nc.ns.client.view.mesh.remove, this.layerId, this.limbMeshes[name]); + nc.trigger(nc.ns.client.view.mesh.remove, this.layerId, this.limbMeshes[name]); }; Parent.prototype.destroy.call(this); diff --git a/app/Game/Client/GameObjects/Items/RubeDoll.js b/app/Game/Client/GameObjects/Items/RubeDoll.js index 6c848a2..6c6034b 100644 --- a/app/Game/Client/GameObjects/Items/RubeDoll.js +++ b/app/Game/Client/GameObjects/Items/RubeDoll.js @@ -5,7 +5,7 @@ define([ "Lib/Utilities/NotificationCenter", ], -function (Parent, Layer, Settings, Nc) { +function (Parent, Layer, Settings, nc) { "use strict"; @@ -131,10 +131,10 @@ function (Parent, Layer, Settings, Nc) { self.limbMeshes[name] = mesh; - Nc.trigger(Nc.ns.client.view.mesh.add, self.layerId, mesh); + nc.trigger(nc.ns.client.view.mesh.add, self.layerId, mesh); // setting shirt color - Nc.trigger(Nc.ns.client.view.mesh.addFilter, self.layerId, mesh, "colorRangeReplace", { + nc.trigger(nc.ns.client.view.mesh.addFilter, self.layerId, mesh, "colorRangeReplace", { minColor: 0x3b4a31, maxColor: 0x6d855d, newColor: self.primaryColor, @@ -142,7 +142,7 @@ function (Parent, Layer, Settings, Nc) { }); }; - Nc.trigger(Nc.ns.client.view.mesh.create, + nc.trigger(nc.ns.client.view.mesh.create, this.layerId, texturePath + name + ".png", callback, @@ -160,7 +160,7 @@ function (Parent, Layer, Settings, Nc) { RubeDoll.prototype.destroy = function() { for (var name in this.limbMeshes) { - Nc.trigger(Nc.ns.client.view.mesh.remove, this.layerId, this.limbMeshes[name]); + nc.trigger(nc.ns.client.view.mesh.remove, this.layerId, this.limbMeshes[name]); }; Parent.prototype.destroy.call(this); @@ -169,7 +169,7 @@ function (Parent, Layer, Settings, Nc) { RubeDoll.prototype.render = function() { //Parent.prototype.render.call(this); - Nc.trigger(Nc.ns.client.view.mesh.update, + nc.trigger(nc.ns.client.view.mesh.update, this.layerId, this.mesh, { @@ -182,7 +182,7 @@ function (Parent, Layer, Settings, Nc) { if(this.limbs) { for(var name in this.limbMeshes) { if(this.limbs[name]) { - Nc.trigger(Nc.ns.client.view.mesh.update, + nc.trigger(nc.ns.client.view.mesh.update, this.layerId, this.limbMeshes[name], { @@ -205,29 +205,29 @@ function (Parent, Layer, Settings, Nc) { this.lastFlipDirection = direction; - Nc.trigger(Nc.ns.client.view.mesh.swapMeshIndexes, + nc.trigger(nc.ns.client.view.mesh.swapMeshIndexes, this.layerId, this.limbMeshes["lowerRightLeg"], this.limbMeshes["lowerLeftLeg"] ); - Nc.trigger(Nc.ns.client.view.mesh.swapMeshIndexes, + nc.trigger(nc.ns.client.view.mesh.swapMeshIndexes, this.layerId, this.limbMeshes["upperRightLeg"], this.limbMeshes["upperLeftLeg"] ); - Nc.trigger(Nc.ns.client.view.mesh.swapMeshIndexes, + nc.trigger(nc.ns.client.view.mesh.swapMeshIndexes, this.layerId, this.limbMeshes["lowerRightArm"], this.limbMeshes["lowerLeftArm"] ); - Nc.trigger(Nc.ns.client.view.mesh.swapMeshIndexes, + nc.trigger(nc.ns.client.view.mesh.swapMeshIndexes, this.layerId, this.limbMeshes["upperRightArm"], this.limbMeshes["upperLeftArm"] ); // swap short images - Nc.trigger(Nc.ns.client.view.mesh.swapMeshes, + nc.trigger(nc.ns.client.view.mesh.swapMeshes, this.layerId, this.limbMeshes["upperRightLeg"], this.limbMeshes["upperLeftLeg"] @@ -238,7 +238,7 @@ function (Parent, Layer, Settings, Nc) { if(this.limbs) { for(var name in this.limbMeshes) { if(this.limbs[name]) { - Nc.trigger(Nc.ns.client.view.mesh.update, + nc.trigger(nc.ns.client.view.mesh.update, this.layerId, this.limbMeshes[name], { diff --git a/app/Game/Client/GameObjects/Tile.js b/app/Game/Client/GameObjects/Tile.js index a92d455..1ca9984 100755 --- a/app/Game/Client/GameObjects/Tile.js +++ b/app/Game/Client/GameObjects/Tile.js @@ -5,7 +5,7 @@ define([ "Game/Client/View/Abstract/Layer" ], -function (Parent, Settings, Nc, Layer) { +function (Parent, Settings, nc, Layer) { "use strict"; @@ -31,10 +31,10 @@ function (Parent, Settings, Nc, Layer) { var callback = function(mesh) { self.mesh = mesh; - Nc.trigger(Nc.ns.client.view.mesh.add, self.layerId, mesh); + nc.trigger(nc.ns.client.view.mesh.add, self.layerId, mesh); } - Nc.trigger(Nc.ns.client.view.mesh.create, + nc.trigger(nc.ns.client.view.mesh.create, this.layerId, texturePath, callback, @@ -50,13 +50,13 @@ function (Parent, Settings, Nc, Layer) { }; Tile.prototype.destroy = function() { - Nc.trigger(Nc.ns.client.view.mesh.remove, this.layerId, 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, + nc.trigger(nc.ns.client.view.mesh.update, this.layerId, this.mesh, { diff --git a/app/Game/Client/Loader/Level.js b/app/Game/Client/Loader/Level.js index e763d92..832d9f0 100755 --- a/app/Game/Client/Loader/Level.js +++ b/app/Game/Client/Loader/Level.js @@ -6,7 +6,7 @@ define([ "Game/Client/View/Abstract/Layer" ], -function (Parent, Settings, Nc, PIXI, AbstractLayer) { +function (Parent, Settings, nc, PIXI, AbstractLayer) { "use strict"; @@ -46,7 +46,7 @@ function (Parent, Settings, Nc, PIXI, AbstractLayer) { loader.onComplete = function() { callback(levelData); }; loader.onProgress = function() { var progress = parseInt(100 / numPaths * ++count, 10) + 1; - Nc.trigger(Nc.ns.client.view.preloadBar.update, progress); + nc.trigger(nc.ns.client.view.preloadBar.update, progress); } loader.load(); }; @@ -116,8 +116,8 @@ function (Parent, Settings, Nc, PIXI, AbstractLayer) { if (options.properties && options.properties.parallaxSpeed) { parallaxSpeed = parseFloat(options.properties.parallaxSpeed); } - Nc.trigger( - Nc.ns.client.view.layer.createAndInsert, + nc.trigger( + nc.ns.client.view.layer.createAndInsert, options.layerId, { parallaxSpeed: parallaxSpeed, diff --git a/app/Game/Client/Loader/TiledLevel.js b/app/Game/Client/Loader/TiledLevel.js index 5316245..df451d8 100644 --- a/app/Game/Client/Loader/TiledLevel.js +++ b/app/Game/Client/Loader/TiledLevel.js @@ -4,7 +4,7 @@ define([ "Lib/Utilities/NotificationCenter", ], -function (Parent, Settings, Nc) { +function (Parent, Settings, nc) { "use strict"; @@ -22,7 +22,7 @@ function (Parent, Settings, Nc) { height: tilesLayerData.height * Settings.TILE_SIZE }; - Nc.trigger(Nc.ns.client.view.layer.levelSizeUpdate, this.levelSize); + nc.trigger(nc.ns.client.view.layer.levelSizeUpdate, this.levelSize); Parent.prototype.setup.call(this, levelData); }; @@ -78,8 +78,8 @@ function (Parent, Settings, Nc) { var texturePath = Settings.MAPS_PATH + options.image; var callback = function(mesh) { - Nc.trigger(Nc.ns.client.view.mesh.add, options.layerId, mesh); - Nc.trigger(Nc.ns.client.view.mesh.update, options.layerId, mesh, { + nc.trigger(nc.ns.client.view.mesh.add, options.layerId, mesh); + nc.trigger(nc.ns.client.view.mesh.update, options.layerId, mesh, { x: 0,//self.levelData.width * Settings.TILE_SIZE / 2, y: 0,//self.levelData.height * Settings.TILE_SIZE / 2, pivot: { @@ -91,7 +91,7 @@ function (Parent, Settings, Nc) { }); } - Nc.trigger(Nc.ns.client.view.mesh.create, + nc.trigger(nc.ns.client.view.mesh.create, options.layerId, texturePath, callback, @@ -123,10 +123,10 @@ function (Parent, Settings, Nc) { var tileType = parts[parts.length - 1].split(".")[0].split("") var callback = function(mesh) { - Nc.trigger(Nc.ns.client.view.mesh.add, options.layerId, mesh); + nc.trigger(nc.ns.client.view.mesh.add, options.layerId, mesh); } - Nc.trigger(Nc.ns.client.view.mesh.create, + nc.trigger(nc.ns.client.view.mesh.create, options.layerId, Settings.MAPS_PATH + imagePath, callback, diff --git a/app/Game/Client/Me.js b/app/Game/Client/Me.js index f271f03..a904c04 100644 --- a/app/Game/Client/Me.js +++ b/app/Game/Client/Me.js @@ -6,7 +6,7 @@ define([ "Game/Client/Control/PlayerController", ], -function (Parent, Settings, Nc, Assert, PlayerController) { +function (Parent, Settings, nc, Assert, PlayerController) { "use strict"; @@ -108,7 +108,7 @@ function (Parent, Settings, Nc, Assert, PlayerController) { var callback = function(arrowMesh) { self.arrowMesh = arrowMesh; }; - Nc.trigger(Nc.ns.client.view.playerArrow.createAndAdd, callback, options); + nc.trigger(nc.ns.client.view.playerArrow.createAndAdd, callback, options); }; Me.prototype.render = function() { @@ -120,7 +120,7 @@ function (Parent, Settings, Nc, Assert, PlayerController) { x: position.x * Settings.RATIO, y: position.y * Settings.RATIO, }; - Nc.trigger(Nc.ns.client.view.playerArrow.update, this.arrowMesh, options); + nc.trigger(nc.ns.client.view.playerArrow.update, this.arrowMesh, options); }; return Me; diff --git a/app/Game/Client/Networker.js b/app/Game/Client/Networker.js index cc66ade..4e27382 100755 --- a/app/Game/Client/Networker.js +++ b/app/Game/Client/Networker.js @@ -7,7 +7,7 @@ define([ "Game/Client/View/DomController" ], -function (ProtocolHelper, GameController, User, Nc, Settings, domController) { +function (ProtocolHelper, GameController, User, nc, Settings, domController) { "use strict"; @@ -47,8 +47,8 @@ function (ProtocolHelper, GameController, User, Nc, Settings, domController) { ProtocolHelper.applyCommand(message, self); }); - Nc.on(Nc.ns.client.to.server.gameCommand.send, this.sendGameCommand, this); - Nc.on(Nc.ns.core.game.events.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); domController.setNick(nickname); } diff --git a/app/Game/Client/Physics/Engine.js b/app/Game/Client/Physics/Engine.js index 4b646c0..6e93609 100755 --- a/app/Game/Client/Physics/Engine.js +++ b/app/Game/Client/Physics/Engine.js @@ -8,7 +8,7 @@ define([ "Game/Client/View/Pixi/Layers/Debug" ], -function (Parent, Settings, domController, Box2D, Nc, DebugDraw, debugLayer) { +function (Parent, Settings, domController, Box2D, nc, DebugDraw, debugLayer) { "use strict"; @@ -17,7 +17,7 @@ function (Parent, Settings, domController, Box2D, Nc, DebugDraw, debugLayer) { this.debugMode = false; - Nc.on(Nc.ns.client.view.debugMode.toggle, 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 25d19c5..f7484cc 100755 --- a/app/Game/Client/Player.js +++ b/app/Game/Client/Player.js @@ -4,7 +4,7 @@ define([ "Game/Config/Settings" ], -function (Parent, Nc, Settings) { +function (Parent, nc, Settings) { "use strict"; @@ -17,7 +17,7 @@ function (Parent, Nc, Settings) { this.initHealthBar(); this.ncTokens = (this.ncTokens || []).concat([ - Nc.on(Nc.ns.client.game.events.render, this.render, this) + nc.on(nc.ns.client.game.events.render, this.render, this) ]); } @@ -47,7 +47,7 @@ function (Parent, Nc, Settings) { var callback = function(healthBarView) { self.healthBarView = healthBarView; } - Nc.trigger(Nc.ns.client.view.healthBar.createAndAdd, callback, options); + nc.trigger(nc.ns.client.view.healthBar.createAndAdd, callback, options); }; Player.prototype.onHealthChange = function() { @@ -75,15 +75,15 @@ function (Parent, Nc, Settings) { healthFactor: this.stats.health / 100, visible: this.healthBarViewVisible }; - Nc.trigger(Nc.ns.client.view.healthBar.update, this.healthBarView, options); + nc.trigger(nc.ns.client.view.healthBar.update, this.healthBarView, options); this.healthBarViewVisibleTimeout = setTimeout(function() { self.healthBarViewVisible = false; - Nc.trigger(Nc.ns.client.view.healthBar.update, self.healthBarView, {visible: self.healthBarViewVisible}); + nc.trigger(nc.ns.client.view.healthBar.update, self.healthBarView, {visible: self.healthBarViewVisible}); }, Settings.HEALTH_DISPLAY_TIME * 1000); } else { - Nc.trigger(Nc.ns.client.view.healthBar.update, this.healthBarView, {visible: this.healthBarViewVisible}); + nc.trigger(nc.ns.client.view.healthBar.update, this.healthBarView, {visible: this.healthBarViewVisible}); } }; @@ -100,7 +100,7 @@ function (Parent, Nc, Settings) { x: position.x * Settings.RATIO, y: position.y * Settings.RATIO, } - Nc.trigger(Nc.ns.client.view.healthBar.update, this.healthBarView, options); + nc.trigger(nc.ns.client.view.healthBar.update, this.healthBarView, options); } }; @@ -110,8 +110,8 @@ function (Parent, Nc, Settings) { Player.prototype.destroy = function() { clearTimeout(this.healthBarViewVisibleTimeout); - Nc.trigger(Nc.ns.client.view.healthBar.remove, this.healthBarView); - Nc.off(this.ncTokens); + nc.trigger(nc.ns.client.view.healthBar.remove, this.healthBarView); + nc.off(this.ncTokens); Parent.prototype.destroy.call(this); }; diff --git a/app/Game/Client/PointerLockManager.js b/app/Game/Client/PointerLockManager.js index 8959fad..dbe7c8b 100644 --- a/app/Game/Client/PointerLockManager.js +++ b/app/Game/Client/PointerLockManager.js @@ -3,7 +3,7 @@ define([ "Lib/Utilities/NotificationCenter" ], -function (Qs, Nc) { +function (Qs, nc) { "use strict"; @@ -21,7 +21,7 @@ function (Qs, Nc) { document.addEventListener('webkitpointerlockchange', this.update.bind(this), false); this.ncTokens = [ - Nc.on(Nc.ns.client.pointerLock.request, this.request, this) + nc.on(nc.ns.client.pointerLock.request, this.request, this) ]; } @@ -40,7 +40,7 @@ function (Qs, Nc) { // called by the browser event and others PointerLockManager.prototype.update = function(e, options) { options = options ? options : {}; - Nc.trigger(Nc.ns.client.pointerLock.change, this.isLocked(), options); + nc.trigger(nc.ns.client.pointerLock.change, this.isLocked(), options); }; PointerLockManager.prototype.isLocked = function() { diff --git a/app/Game/Client/View/Abstract/Layer.js b/app/Game/Client/View/Abstract/Layer.js index 435e3a3..5e1521e 100644 --- a/app/Game/Client/View/Abstract/Layer.js +++ b/app/Game/Client/View/Abstract/Layer.js @@ -3,7 +3,7 @@ define([ "Lib/Utilities/NotificationCenter" ], -function (Abstract, Nc) { +function (Abstract, nc) { "use strict"; @@ -59,7 +59,7 @@ function (Abstract, Nc) { Layer.prototype.destroy = function() { for (var i = 0; i < this.ncTokens.length; i++) { - Nc.off(this.ncTokens[i]); + nc.off(this.ncTokens[i]); }; }; diff --git a/app/Game/Client/View/Abstract/View.js b/app/Game/Client/View/Abstract/View.js index dd162a5..a226801 100755 --- a/app/Game/Client/View/Abstract/View.js +++ b/app/Game/Client/View/Abstract/View.js @@ -6,7 +6,7 @@ define([ "Lib/Utilities/NotificationCenter" ], -function (Abstract, domController, Settings, Exception, Nc) { +function (Abstract, domController, Settings, Exception, nc) { "use strict"; @@ -16,14 +16,14 @@ function (Abstract, domController, Settings, Exception, Nc) { this.debugMode = false; this.ncTokens = [ - Nc.on(Nc.ns.client.view.display.change, this.onDisplaySizeChange, this), - Nc.on(Nc.ns.client.view.debugMode.toggle, this.onToggleDebugMode, this), + nc.on(nc.ns.client.view.display.change, this.onDisplaySizeChange, this), + nc.on(nc.ns.client.view.debugMode.toggle, this.onToggleDebugMode, this), - Nc.on(Nc.ns.client.game.zoomIn, this.onZoomIn, this), - Nc.on(Nc.ns.client.game.zoomOut, this.onZoomOut, this), - Nc.on(Nc.ns.client.game.zoomReset, this.onZoomReset, this), + nc.on(nc.ns.client.game.zoomIn, this.onZoomIn, this), + nc.on(nc.ns.client.game.zoomOut, this.onZoomOut, this), + nc.on(nc.ns.client.game.zoomReset, this.onZoomReset, this), - Nc.on(Nc.ns.client.view.preloadBar.update, this.onUpdateLoader, this), + nc.on(nc.ns.client.view.preloadBar.update, this.onUpdateLoader, this), ]; } @@ -98,7 +98,7 @@ function (Abstract, domController, Settings, Exception, Nc) { AbstractView.prototype.destroy = function() { for (var i = 0; i < this.ncTokens.length; i++) { - Nc.off(this.ncTokens[i]); + nc.off(this.ncTokens[i]); }; }; diff --git a/app/Game/Client/View/DomController.js b/app/Game/Client/View/DomController.js index f50f170..12489ab 100755 --- a/app/Game/Client/View/DomController.js +++ b/app/Game/Client/View/DomController.js @@ -6,7 +6,7 @@ define([ "Game/Client/PointerLockManager" ], -function (Settings, Nc, Screenfull, Graph, PointerLockManager) { +function (Settings, nc, Screenfull, Graph, PointerLockManager) { "use strict"; @@ -122,7 +122,7 @@ function (Settings, Nc, Screenfull, Graph, PointerLockManager) { var checkbox = document.createElement("input"); checkbox.type = "checkbox"; checkbox.onclick = function(e) { - Nc.trigger(Nc.ns.client.view.debugMode.toggle, e.target.checked); + nc.trigger(nc.ns.client.view.debugMode.toggle, e.target.checked); }; label.appendChild(checkbox); label.appendChild(document.createTextNode("Debug")); @@ -147,7 +147,7 @@ function (Settings, Nc, Screenfull, Graph, PointerLockManager) { // FIXME : isn't this a weird place for this? window.onresize = function() { - Nc.trigger(Nc.ns.client.view.display.change); + nc.trigger(nc.ns.client.view.display.change); }; }; @@ -180,7 +180,7 @@ function (Settings, Nc, Screenfull, Graph, PointerLockManager) { }; DomController.prototype.initCanvas = function (canvas) { - Nc.trigger(Nc.ns.client.view.display.change, Screenfull.isFullscreen); + nc.trigger(nc.ns.client.view.display.change, Screenfull.isFullscreen); }; DomController.prototype.setConnected = function(connected) { diff --git a/app/Game/Client/View/LayerManager.js b/app/Game/Client/View/LayerManager.js index 8245e3f..2e2d34f 100644 --- a/app/Game/Client/View/LayerManager.js +++ b/app/Game/Client/View/LayerManager.js @@ -4,7 +4,7 @@ define([ "Game/Client/View/Pixi/Layer" ], -function (Nc, Exception, Layer) { +function (nc, Exception, Layer) { "use strict"; @@ -13,16 +13,16 @@ function (Nc, Exception, Layer) { this.container = container; this.ncTokens = [ - Nc.on(Nc.ns.client.view.layer.createAndInsert, this.createAndInsert, this), - Nc.on(Nc.ns.client.view.mesh.create, this.createMesh, this), - Nc.on(Nc.ns.client.view.animatedMesh.create, this.createAnimatedMesh, 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(Nc.ns.client.view.mesh.addFilter, this.addFilter, this), - Nc.on(Nc.ns.client.view.mesh.removeFilter, this.removeFilter, this), - Nc.on(Nc.ns.client.view.mesh.swapMeshIndexes, this.swapMeshIndexes, this), - Nc.on(Nc.ns.client.view.mesh.swapMeshes, this.swapMeshes, this) + nc.on(nc.ns.client.view.layer.createAndInsert, this.createAndInsert, this), + nc.on(nc.ns.client.view.mesh.create, this.createMesh, this), + nc.on(nc.ns.client.view.animatedMesh.create, this.createAnimatedMesh, 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(nc.ns.client.view.mesh.addFilter, this.addFilter, this), + nc.on(nc.ns.client.view.mesh.removeFilter, this.removeFilter, this), + nc.on(nc.ns.client.view.mesh.swapMeshIndexes, this.swapMeshIndexes, this), + nc.on(nc.ns.client.view.mesh.swapMeshes, this.swapMeshes, this) ]; } @@ -171,7 +171,7 @@ function (Nc, Exception, Layer) { LayerManager.prototype.destroy = function() { for (var i = 0; i < this.ncTokens.length; i++) { - Nc.off(this.ncTokens[i]); + nc.off(this.ncTokens[i]); }; for (var i = this.layers.length - 1; i >= 0; i--) { var layer = this.layers[i]; diff --git a/app/Game/Client/View/Mesh.js b/app/Game/Client/View/Mesh.js index d261e36..9290593 100644 --- a/app/Game/Client/View/Mesh.js +++ b/app/Game/Client/View/Mesh.js @@ -5,7 +5,7 @@ define([ "Lib/Vendor/Screenfull" ], -function (Settings, Nc, Stats, Screenfull) { +function (Settings, nc, Stats, Screenfull) { "use strict"; diff --git a/app/Game/Client/View/Pixi/GameStats.js b/app/Game/Client/View/Pixi/GameStats.js index e660d9c..55d520c 100644 --- a/app/Game/Client/View/Pixi/GameStats.js +++ b/app/Game/Client/View/Pixi/GameStats.js @@ -5,7 +5,7 @@ define([ "Lib/Utilities/ColorConverter" ], -function (PIXI, Nc, Settings, ColorConverter) { +function (PIXI, nc, Settings, ColorConverter) { "use strict"; @@ -63,8 +63,8 @@ function (PIXI, Nc, Settings, ColorConverter) { this.sortedPlayers = []; this.ncTokens = [ - Nc.on(Nc.ns.client.view.gameStats.toggle, this.toggle, this), - Nc.on(Nc.ns.client.view.gameStats.update, this.update, this) + nc.on(nc.ns.client.view.gameStats.toggle, this.toggle, this), + nc.on(nc.ns.client.view.gameStats.update, this.update, this) ]; } @@ -197,7 +197,7 @@ function (PIXI, Nc, Settings, ColorConverter) { GameStats.prototype.destroy = function() { for (var i = 0; i < this.ncTokens.length; i++) { - Nc.off(this.ncTokens[i]); + nc.off(this.ncTokens[i]); }; }; diff --git a/app/Game/Client/View/Pixi/Layer.js b/app/Game/Client/View/Pixi/Layer.js index ae16ba5..5a44988 100644 --- a/app/Game/Client/View/Pixi/Layer.js +++ b/app/Game/Client/View/Pixi/Layer.js @@ -7,7 +7,7 @@ define([ "Lib/Utilities/NotificationCenter" ], -function (Parent, PIXI, ColorRangeReplaceFilter, Settings, ColorConverter, Nc) { +function (Parent, PIXI, ColorRangeReplaceFilter, Settings, ColorConverter, nc) { "use strict"; @@ -23,7 +23,7 @@ function (Parent, PIXI, ColorRangeReplaceFilter, Settings, ColorConverter, Nc) { } this.ncTokens = this.ncTokens.concat([ - Nc.on(Nc.ns.client.view.layer.levelSizeUpdate, this.onLevelSizeUpdate, this) + nc.on(nc.ns.client.view.layer.levelSizeUpdate, this.onLevelSizeUpdate, this) ]); if (Settings.SHOW_LAYER_INFO) { diff --git a/app/Game/Client/View/Pixi/Layers/Ghost.js b/app/Game/Client/View/Pixi/Layers/Ghost.js index 9377e59..8260f6f 100644 --- a/app/Game/Client/View/Pixi/Layers/Ghost.js +++ b/app/Game/Client/View/Pixi/Layers/Ghost.js @@ -5,7 +5,7 @@ define([ "Game/Config/Settings" ], -function (Parent, PIXI, Nc, Settings) { +function (Parent, PIXI, nc, Settings) { "use strict"; @@ -13,12 +13,12 @@ function (Parent, PIXI, Nc, Settings) { Parent.call(this, "ghost", {parallaxSpeed: 0}); this.ncTokens = this.ncTokens.concat([ - Nc.on(Nc.ns.client.view.layer.levelSizeUpdate, this.onLevelSizeUpdate, this), - Nc.on(Nc.ns.client.view.playerArrow.createAndAdd, this.onCreateAndAddPlayerArrow, this), - Nc.on(Nc.ns.client.view.playerArrow.update, this.onUpdatePlayerArrow, this), - Nc.on(Nc.ns.client.view.healthBar.createAndAdd, this.onCreateAndAddHealthBar, this), - Nc.on(Nc.ns.client.view.healthBar.update, this.onUpdateHealthBar, this), - Nc.on(Nc.ns.client.view.healthBar.remove, this.onRemoveHealthBar, this), + nc.on(nc.ns.client.view.layer.levelSizeUpdate, this.onLevelSizeUpdate, this), + nc.on(nc.ns.client.view.playerArrow.createAndAdd, this.onCreateAndAddPlayerArrow, this), + nc.on(nc.ns.client.view.playerArrow.update, this.onUpdatePlayerArrow, this), + nc.on(nc.ns.client.view.healthBar.createAndAdd, this.onCreateAndAddHealthBar, this), + nc.on(nc.ns.client.view.healthBar.update, this.onUpdateHealthBar, this), + nc.on(nc.ns.client.view.healthBar.remove, this.onRemoveHealthBar, this), ]); } diff --git a/app/Game/Client/View/Pixi/Layers/Messages.js b/app/Game/Client/View/Pixi/Layers/Messages.js index 08c4f99..a9a547c 100644 --- a/app/Game/Client/View/Pixi/Layers/Messages.js +++ b/app/Game/Client/View/Pixi/Layers/Messages.js @@ -5,7 +5,7 @@ define([ "Game/Config/Settings" ], -function (Parent, PIXI, Nc, Settings) { +function (Parent, PIXI, nc, Settings) { "use strict"; @@ -13,7 +13,7 @@ function (Parent, PIXI, Nc, Settings) { Parent.call(this, "messages", {parallaxSpeed:-1}); this.ncTokens = this.ncTokens.concat([ - Nc.on(Nc.ns.client.view.gameStats.kill, this.onKill, this) + nc.on(nc.ns.client.view.gameStats.kill, this.onKill, this) ]); this.mainTextOptions = { diff --git a/app/Game/Client/View/Pixi/Layers/Swiper.js b/app/Game/Client/View/Pixi/Layers/Swiper.js index bd62fb5..9c89d95 100644 --- a/app/Game/Client/View/Pixi/Layers/Swiper.js +++ b/app/Game/Client/View/Pixi/Layers/Swiper.js @@ -5,7 +5,7 @@ define([ "Game/Config/Settings" ], -function (Parent, PIXI, Nc, Settings) { +function (Parent, PIXI, nc, Settings) { function Swiper() { Parent.call(this, "swiper", {parallaxSpeed:0}); @@ -13,8 +13,8 @@ function (Parent, PIXI, Nc, Settings) { this.static = true; this.ncTokens = this.ncTokens.concat([ - Nc.on(Nc.ns.client.view.swiper.swipe, this.swipe, this), - Nc.on(Nc.ns.client.view.swiper.end, this.end, this) + nc.on(nc.ns.client.view.swiper.swipe, this.swipe, this), + nc.on(nc.ns.client.view.swiper.end, this.end, this) ]); this.sprite = new PIXI.Graphics(); diff --git a/app/Game/Client/View/Pixi/View.js b/app/Game/Client/View/Pixi/View.js index 8ef2752..7696f0d 100755 --- a/app/Game/Client/View/Pixi/View.js +++ b/app/Game/Client/View/Pixi/View.js @@ -14,7 +14,7 @@ define([ "Game/Client/View/Pixi/Layers/Messages" ], -function (Parent, domController, PIXI, Settings, Nc, Exception, GameStats, LayerManager, Ghost, Swiper, PointerLockManager, Debug, Messages) { +function (Parent, domController, PIXI, Settings, nc, Exception, GameStats, LayerManager, Ghost, Swiper, PointerLockManager, Debug, Messages) { "use strict"; @@ -35,8 +35,8 @@ function (Parent, domController, PIXI, Settings, Nc, Exception, GameStats, Layer this.init(); this.ncTokens = this.ncTokens.concat([ - Nc.on(Nc.ns.client.pointerLock.change, this.onPointerLockChange, this), - Nc.on(Nc.ns.core.game.events.level.loaded, this.showDefaultLayers, this) + nc.on(nc.ns.client.pointerLock.change, this.onPointerLockChange, this), + nc.on(nc.ns.core.game.events.level.loaded, this.showDefaultLayers, this) ]); PIXI.scaleModes.DEFAULT = PIXI.scaleModes.NEAREST; diff --git a/app/Game/Client/View/ViewManager.js b/app/Game/Client/View/ViewManager.js index 2f30bd5..f935357 100755 --- a/app/Game/Client/View/ViewManager.js +++ b/app/Game/Client/View/ViewManager.js @@ -7,7 +7,7 @@ define([ "Lib/Utilities/NotificationCenter" ], -function (Settings, Exception, AbstractView, PixiView, Nc) { +function (Settings, Exception, AbstractView, PixiView, nc) { "use strict"; diff --git a/app/Game/Core/GameController.js b/app/Game/Core/GameController.js index 58b4454..caea9c3 100755 --- a/app/Game/Core/GameController.js +++ b/app/Game/Core/GameController.js @@ -9,7 +9,7 @@ define([ "Lib/Utilities/Assert", ], -function (PhysicsEngine, TiledLevel, Player, Nc, Doll, GameObject, Item, Assert) { +function (PhysicsEngine, TiledLevel, Player, nc, Doll, GameObject, Item, Assert) { "use strict"; @@ -24,8 +24,8 @@ function (PhysicsEngine, TiledLevel, Player, Nc, Doll, GameObject, Item, Assert) this.physicsEngine.setCollisionDetector(); this.ncTokens = [ - Nc.on(Nc.ns.core.game.worldUpdateObjects.add, this.onWorldUpdateObjectAdd, this), - Nc.on(Nc.ns.core.game.worldUpdateObjects.remove, this.onWorldUpdateObjectRemove, this) + nc.on(nc.ns.core.game.worldUpdateObjects.add, this.onWorldUpdateObjectAdd, this), + nc.on(nc.ns.core.game.worldUpdateObjects.remove, this.onWorldUpdateObjectRemove, this) ]; this.loadLevel(options.levelUid); @@ -116,10 +116,10 @@ function (PhysicsEngine, TiledLevel, Player, Nc, Doll, GameObject, Item, Assert) } // FIXME ns.client in core? - Nc.trigger(Nc.ns.client.game.events.destroy); + nc.trigger(nc.ns.client.game.events.destroy); // Testing after destroy if worldUpdateObjects is empty - // events.game.destroy -> gameobjects.destroy() -> Nc.trigger(worldUpdateObjects.remove) + // events.game.destroy -> gameobjects.destroy() -> nc.trigger(worldUpdateObjects.remove) if(Object.keys(this.worldUpdateObjects).length > 0) { console.warn('Not all worldUpdateObjects have been removed... ', Object.keys(this.worldUpdateObjects)); } @@ -127,7 +127,7 @@ function (PhysicsEngine, TiledLevel, Player, Nc, Doll, GameObject, Item, Assert) this.physicsEngine.destroy(); this.worldUpdateObjects = null; - Nc.off(this.ncTokens); + nc.off(this.ncTokens); }; return GameController; diff --git a/app/Game/Core/GameObjects/Doll.js b/app/Game/Core/GameObjects/Doll.js index ab258b4..32c3e05 100755 --- a/app/Game/Core/GameObjects/Doll.js +++ b/app/Game/Core/GameObjects/Doll.js @@ -9,7 +9,7 @@ define([ "Lib/Utilities/Assert" ], -function (Parent, Exception, Box2D, Settings, CollisionDetector, Item, Nc, Assert) { +function (Parent, Exception, Box2D, Settings, CollisionDetector, Item, nc, Assert) { "use strict"; @@ -45,7 +45,7 @@ function (Parent, Exception, Box2D, Settings, CollisionDetector, Item, Nc, Asser this.createFixtures(); this.body.SetActive(false); - Nc.trigger(Nc.ns.core.game.worldUpdateObjects.add, this); + nc.trigger(nc.ns.core.game.worldUpdateObjects.add, this); } Doll.prototype = Object.create(Parent.prototype); @@ -481,7 +481,7 @@ function (Parent, Exception, Box2D, Settings, CollisionDetector, Item, Nc, Asser }; Doll.prototype.destroy = function() { - Nc.trigger(Nc.ns.core.game.worldUpdateObjects.remove, this); + nc.trigger(nc.ns.core.game.worldUpdateObjects.remove, this); Parent.prototype.destroy.call(this); }; diff --git a/app/Game/Core/GameObjects/GameObject.js b/app/Game/Core/GameObjects/GameObject.js index 22d770d..a1eb12d 100755 --- a/app/Game/Core/GameObjects/GameObject.js +++ b/app/Game/Core/GameObjects/GameObject.js @@ -5,7 +5,7 @@ define([ "Lib/Utilities/NotificationCenter" ], -function (Box2D, Exception, Assert, Nc) { +function (Box2D, Exception, Assert, nc) { "use strict"; @@ -17,7 +17,7 @@ function (Box2D, Exception, Assert, Nc) { this.body = physicsEngine.createBody(def); this.ncTokens = (this.ncTokens || []).concat([ - Nc.on(Nc.ns.client.game.events.destroy, this.destroy, this) + nc.on(nc.ns.client.game.events.destroy, this.destroy, this) ]); } @@ -33,7 +33,7 @@ function (Box2D, Exception, Assert, Nc) { throw new Exception("can not destroy body"); } - Nc.off(this.ncTokens); + nc.off(this.ncTokens); }; GameObject.prototype.getBody = function() { diff --git a/app/Game/Core/GameObjects/Item.js b/app/Game/Core/GameObjects/Item.js index 893f2c8..fd15946 100644 --- a/app/Game/Core/GameObjects/Item.js +++ b/app/Game/Core/GameObjects/Item.js @@ -8,7 +8,7 @@ define([ "Lib/Utilities/Assert" ], -function (Parent, Box2D, Options, Settings, Exception, Nc, Assert) { +function (Parent, Box2D, Options, Settings, Exception, nc, Assert) { "use strict"; @@ -41,7 +41,7 @@ function (Parent, Box2D, Options, Settings, Exception, Nc, Assert) { this.body.SetBullet(true); } - Nc.trigger(Nc.ns.core.game.worldUpdateObjects.add, this); + nc.trigger(nc.ns.core.game.worldUpdateObjects.add, this); } Item.prototype = Object.create(Parent.prototype); @@ -158,7 +158,7 @@ function (Parent, Box2D, Options, Settings, Exception, Nc, Assert) { }; Item.prototype.destroy = function() { - Nc.trigger(Nc.ns.core.game.worldUpdateObjects.remove, this); + nc.trigger(nc.ns.core.game.worldUpdateObjects.remove, this); Parent.prototype.destroy.call(this); }; diff --git a/app/Game/Core/GameObjects/Items/RagDoll.js b/app/Game/Core/GameObjects/Items/RagDoll.js index bfd284b..e47c5d6 100644 --- a/app/Game/Core/GameObjects/Items/RagDoll.js +++ b/app/Game/Core/GameObjects/Items/RagDoll.js @@ -8,7 +8,7 @@ define([ "Game/Config/ItemSettings", ], -function (Parent, Box2D, Settings, Nc, Assert, Options, ItemSettings) { +function (Parent, Box2D, Settings, nc, Assert, Options, ItemSettings) { "use strict"; diff --git a/app/Game/Core/GameObjects/Items/RubeDoll.js b/app/Game/Core/GameObjects/Items/RubeDoll.js index ba1f9cf..77b511d 100644 --- a/app/Game/Core/GameObjects/Items/RubeDoll.js +++ b/app/Game/Core/GameObjects/Items/RubeDoll.js @@ -9,7 +9,7 @@ define([ "json!Game/Asset/RubeDoll.json" // using requirejs json loader plugin ], -function (Parent, RubeLoader, Box2D, Settings, Assert, Nc, Matrix, RubeDollJson) { +function (Parent, RubeLoader, Box2D, Settings, Assert, nc, Matrix, RubeDollJson) { "use strict"; diff --git a/app/Game/Core/GameObjects/Tile.js b/app/Game/Core/GameObjects/Tile.js index ec8557e..dee3a1a 100755 --- a/app/Game/Core/GameObjects/Tile.js +++ b/app/Game/Core/GameObjects/Tile.js @@ -7,7 +7,7 @@ define([ "Lib/Utilities/Assert" ], -function (Parent, Box2D, Settings, Exception, Nc, Assert) { +function (Parent, Box2D, Settings, Exception, nc, Assert) { "use strict"; diff --git a/app/Game/Core/Loader/Level.js b/app/Game/Core/Loader/Level.js index 86fd92b..83cabde 100755 --- a/app/Game/Core/Loader/Level.js +++ b/app/Game/Core/Loader/Level.js @@ -10,7 +10,7 @@ define([ "Game/" + GLOBALS.context + "/GameObjects/Items/RagDoll", "Game/" + GLOBALS.context + "/GameObjects/Items/RubeDoll" -], function (Settings, Box2D, Nc, Abstract, CollisionDetector, Tile, Item, Skateboard, RagDoll, RubeDoll) { +], function (Settings, Box2D, nc, Abstract, CollisionDetector, Tile, Item, Skateboard, RagDoll, RubeDoll) { "use strict"; @@ -34,7 +34,7 @@ define([ Level.prototype.setup = function(levelData) { // jshint unused:false this.isLoaded = true; - Nc.trigger(Nc.ns.core.game.events.level.loaded); + nc.trigger(nc.ns.core.game.events.level.loaded); }; Level.prototype.createItems = function(options) { diff --git a/app/Game/Core/Loader/TiledLevel.js b/app/Game/Core/Loader/TiledLevel.js index 761c7d4..8f26b11 100755 --- a/app/Game/Core/Loader/TiledLevel.js +++ b/app/Game/Core/Loader/TiledLevel.js @@ -13,7 +13,7 @@ define([ "Game/" + GLOBALS.context + "/GameObjects/Item", "Game/" + GLOBALS.context + "/GameObjects/Items/Skateboard", -], function (Parent, Settings, ItemSettings, Box2D, Options, Exception, Nc, Assert, AbstractLayer, CollisionDetector, Tile, Item, Skateboard) { +], function (Parent, Settings, ItemSettings, Box2D, Options, Exception, nc, Assert, AbstractLayer, CollisionDetector, Tile, Item, Skateboard) { "use strict"; diff --git a/app/Game/Core/Physics/Engine.js b/app/Game/Core/Physics/Engine.js index 245b8f6..4ec27b2 100755 --- a/app/Game/Core/Physics/Engine.js +++ b/app/Game/Core/Physics/Engine.js @@ -5,7 +5,7 @@ define([ "Lib/Utilities/NotificationCenter" ], -function (Settings, Box2D, CollisionDetector, Nc) { +function (Settings, Box2D, CollisionDetector, nc) { "use strict"; @@ -19,7 +19,7 @@ function (Settings, Box2D, CollisionDetector, Nc) { this.worldQueue = []; this.ncTokens = [ - Nc.on(Nc.ns.channel.engine.worldQueue.add, this.addToWorldQueue, this) + nc.on(nc.ns.channel.engine.worldQueue.add, this.addToWorldQueue, this) ]; } @@ -62,7 +62,7 @@ function (Settings, Box2D, CollisionDetector, Nc) { } Engine.prototype.destroy = function() { - Nc.offAll(this.ncTokens); + nc.offAll(this.ncTokens); delete this.world; }; diff --git a/app/Game/Core/Player.js b/app/Game/Core/Player.js index 5ae0259..996facb 100755 --- a/app/Game/Core/Player.js +++ b/app/Game/Core/Player.js @@ -9,7 +9,7 @@ define([ "Game/" + GLOBALS.context + "/GameObjects/Items/RubeDoll" ], -function (Doll, PlayerController, Settings, Nc, Exception, ColorConverter, SpectatorDoll, RubeDoll) { +function (Doll, PlayerController, Settings, nc, Exception, ColorConverter, SpectatorDoll, RubeDoll) { "use strict"; diff --git a/app/Lib/Utilities/NotificationCenter.js b/app/Lib/Utilities/NotificationCenter.js index d629b8e..36ac8d0 100755 --- a/app/Lib/Utilities/NotificationCenter.js +++ b/app/Lib/Utilities/NotificationCenter.js @@ -7,7 +7,7 @@ function (Exception) { "use strict"; function populate(obj, path) { - path = path || "Nc.ns"; + path = path || "nc.ns"; for(var key in obj) { if(!obj.hasOwnProperty(key)) continue; if(obj[key] === null) { @@ -199,15 +199,15 @@ function (Exception) { NotificationCenter.prototype.validate = function(topic) { if (topic === undefined) { - throw new Exception("Topic not registered in Nc. See stack trace."); + throw new Exception("Topic not registered in nc. See stack trace."); } if (typeof topic === 'object') { throw new Exception("Topic bad format " + JSON.stringify(topic)); } - if (topic.indexOf("Nc.ns") !== 0) { - throw new Exception("Topic bad format, does not begin with Nc.ns. : " + topic); + if (topic.indexOf("nc.ns") !== 0) { + throw new Exception("Topic bad format, does not begin with nc.ns. : " + topic); } }; @@ -266,7 +266,7 @@ function (Exception) { } } - // should be treated as a private function - use Nc.off(Array); + // should be treated as a private function - use nc.off(Array); NotificationCenter.prototype.offAll = function (tokens) { for (var i = 0; i < tokens.length; i++) { this.off(tokens[i]); diff --git a/app/Server/Api.js b/app/Server/Api.js index 47b4a63..489a998 100644 --- a/app/Server/Api.js +++ b/app/Server/Api.js @@ -7,7 +7,7 @@ define([ "fs" ], -function (Nc, ProtocolHelper, validate, Options, Settings, FileSystem) { +function (nc, ProtocolHelper, validate, Options, Settings, FileSystem) { "use strict"; diff --git a/app/Server/Coordinator.js b/app/Server/Coordinator.js index 2e2060d..20d8c93 100644 --- a/app/Server/Coordinator.js +++ b/app/Server/Coordinator.js @@ -5,14 +5,14 @@ define([ "Game/Config/Settings" ], -function (User, PipeToChannel, Nc, Settings) { +function (User, PipeToChannel, nc, Settings) { "use strict"; function Coordinator() { this.channelPipes = {}; - Nc.on(Nc.ns.server.events.controlCommand.coordinator, this.onMessage, this); + nc.on(nc.ns.server.events.controlCommand.coordinator, this.onMessage, this); console.checkpoint('create Coordinator'); } diff --git a/app/Server/PipeToChannel.js b/app/Server/PipeToChannel.js index bf2adcd..19bee94 100755 --- a/app/Server/PipeToChannel.js +++ b/app/Server/PipeToChannel.js @@ -3,7 +3,7 @@ define([ "child_process" ], -function (Nc, childProcess) { +function (nc, childProcess) { "use strict"; @@ -57,10 +57,10 @@ function (Nc, childProcess) { PipeToChannel.prototype.onMessage = function (message) { switch(message.recipient) { case 'coordinator': - Nc.trigger(Nc.ns.server.events.controlCommand.coordinator, message.data); + nc.trigger(nc.ns.server.events.controlCommand.coordinator, message.data); break; default: - Nc.trigger(Nc.ns.server.events.controlCommand.user + message.recipient, message.data); + nc.trigger(nc.ns.server.events.controlCommand.user + message.recipient, message.data); break; } diff --git a/app/Server/User.js b/app/Server/User.js index a9d63a2..1ba04bc 100644 --- a/app/Server/User.js +++ b/app/Server/User.js @@ -4,7 +4,7 @@ define([ "Lib/Utilities/NotificationCenter" ], -function (Parent, ProtocolHelper, Nc) { +function (Parent, ProtocolHelper, nc) { "use strict"; @@ -19,7 +19,7 @@ function (Parent, ProtocolHelper, Nc) { socketLink.on('message', this.onMessage.bind(this)); socketLink.on('disconnect', this.onDisconnect.bind(this)); - Nc.on(Nc.ns.server.events.controlCommand.user + this.id, this.socketLink.send, this.socketLink); + nc.on(nc.ns.server.events.controlCommand.user + this.id, this.socketLink.send, this.socketLink); } User.prototype = Object.create(Parent.prototype); @@ -97,7 +97,7 @@ function (Parent, ProtocolHelper, Nc) { User.prototype.onPing = function(timestamp) { var message = ProtocolHelper.encodeCommand("pong", timestamp); - Nc.trigger(Nc.ns.server.events.controlCommand.user + this.id, message); + nc.trigger(nc.ns.server.events.controlCommand.user + this.id, message); }; return User; diff --git a/client.js b/client.js index b082d49..6ccbb94 100755 --- a/client.js +++ b/client.js @@ -27,7 +27,7 @@ requirejs([ "Menu/Menu" ], -function (Networker, SocketIO, Settings, Exception, Nc, Menu) { +function (Networker, SocketIO, Settings, Exception, nc, Menu) { var menu = new Menu(); menu.onRun = function(channelName, nickname) { @@ -44,7 +44,7 @@ function (Networker, SocketIO, Settings, Exception, Nc, Menu) { var networker = new Networker(socket, channelName, nickname); Chuck.inspector.networker = networker; Chuck.inspector.settings = Settings; - Chuck.inspector.nc = Nc; + Chuck.inspector.nc = nc; Chuck.inspector.resetLevel = function() { networker.sendGameCommand("resetLevel"); } } menu.init(); diff --git a/lab/Worker.js b/lab/Worker.js index 62483bb..04585b1 100755 --- a/lab/Worker.js +++ b/lab/Worker.js @@ -6,7 +6,7 @@ define([ "Lib/Utilities/NotificationCenter" ], -function (Parent, ProtocolHelper, GameController, User, Nc) { +function (Parent, ProtocolHelper, GameController, User) { function Worker () { //this.socketLink = socketLink; @@ -40,7 +40,7 @@ function (Parent, ProtocolHelper, GameController, User, Nc) { } }, this); - Nc.on(Nc.ns.client.to.server.gameCommand.send, this.sendGameCommand, this); + nc.on(nc.ns.client.to.server.gameCommand.send, this.sendGameCommand, this); } Worker.prototype.sendCommand = function (command, options) {