mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
merged from master (use strict)
This commit is contained in:
commit
1f8f0ef6e1
76 changed files with 157 additions and 60 deletions
|
|
@ -7,6 +7,8 @@ define([
|
||||||
|
|
||||||
function (http, nodeStatic, Api, fs) {
|
function (http, nodeStatic, Api, fs) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function HttpServer (options, coordinator) {
|
function HttpServer (options, coordinator) {
|
||||||
options.port = options.port || 1234;
|
options.port = options.port || 1234;
|
||||||
options.caching = typeof options.caching != 'undefined' ? options.caching : 3600;
|
options.caching = typeof options.caching != 'undefined' ? options.caching : 3600;
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,8 @@ define([
|
||||||
|
|
||||||
function (io) {
|
function (io) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function Socket (server, options, coordinator) {
|
function Socket (server, options, coordinator) {
|
||||||
options.logLevel = typeof options.logLevel != 'undefined'
|
options.logLevel = typeof options.logLevel != 'undefined'
|
||||||
? options.logLevel
|
? options.logLevel
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,8 @@ define([
|
||||||
|
|
||||||
function (Parent) {
|
function (Parent) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function Detector () {
|
function Detector () {
|
||||||
Parent.call(this);
|
Parent.call(this);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,8 @@ define([
|
||||||
|
|
||||||
function (Parent, PhysicsEngine, Settings, PlayerController, requestAnimFrame, Nc, Box2D, Player, GameObject, Doll, RagDoll) {
|
function (Parent, PhysicsEngine, Settings, PlayerController, requestAnimFrame, Nc, Box2D, Player, GameObject, Doll, RagDoll) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function GameController (options) {
|
function GameController (options) {
|
||||||
|
|
||||||
this.animationTimeout = null;
|
this.animationTimeout = null;
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,8 @@ define([
|
||||||
],
|
],
|
||||||
|
|
||||||
function (Parent, Item, Box2D, Nc) {
|
function (Parent, Item, Box2D, Nc) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function Doll(physicsEngine, uid, player) {
|
function Doll(physicsEngine, uid, player) {
|
||||||
Parent.call(this, physicsEngine, uid, player);
|
Parent.call(this, physicsEngine, uid, player);
|
||||||
|
|
@ -15,10 +17,12 @@ function (Parent, Item, Box2D, Nc) {
|
||||||
|
|
||||||
Doll.prototype.findCloseItem = function(x, y) {
|
Doll.prototype.findCloseItem = function(x, y) {
|
||||||
|
|
||||||
|
var self = this;
|
||||||
|
|
||||||
function findItem(array) {
|
function findItem(array) {
|
||||||
for (var i = 0; i < array.length; i++) {
|
for (var i = 0; i < array.length; i++) {
|
||||||
var item = array[i];
|
var item = array[i];
|
||||||
if(item.isGrabbingAllowed(this.player)) {
|
if(item.isGrabbingAllowed(self.player)) {
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@ define([
|
||||||
],
|
],
|
||||||
|
|
||||||
function (Parent) {
|
function (Parent) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function Item(physicsEngine, uid, options) {
|
function Item(physicsEngine, uid, options) {
|
||||||
Parent.call(this, physicsEngine, uid, options);
|
Parent.call(this, physicsEngine, uid, options);
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@ define([
|
||||||
],
|
],
|
||||||
|
|
||||||
function (Parent, Settings, Nc) {
|
function (Parent, Settings, Nc) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function RagDoll(physicsEngine, uid, options) {
|
function RagDoll(physicsEngine, uid, options) {
|
||||||
this.scheduledForDestruction = false;
|
this.scheduledForDestruction = false;
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,8 @@ define([
|
||||||
|
|
||||||
function (Parent) {
|
function (Parent) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
return Parent;
|
return Parent;
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
@ -4,6 +4,8 @@ define([
|
||||||
|
|
||||||
function (Parent) {
|
function (Parent) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
return Parent;
|
return Parent;
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
@ -6,6 +6,8 @@ define([
|
||||||
|
|
||||||
function (Parent, Settings, FileSystem) {
|
function (Parent, Settings, FileSystem) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function Level (uid, engine, gameObjects) {
|
function Level (uid, engine, gameObjects) {
|
||||||
Parent.call(this, uid, engine, gameObjects);
|
Parent.call(this, uid, engine, gameObjects);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,8 @@ define([
|
||||||
|
|
||||||
function (Parent) {
|
function (Parent) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
return Parent;
|
return Parent;
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
@ -5,6 +5,8 @@ define([
|
||||||
|
|
||||||
function (Nc, Channel) {
|
function (Nc, Channel) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function PipeToServer (process) {
|
function PipeToServer (process) {
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,8 @@ define([
|
||||||
],
|
],
|
||||||
|
|
||||||
function (Parent, Nc) {
|
function (Parent, Nc) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function Player(id, physicsEngine, user) {
|
function Player(id, physicsEngine, user) {
|
||||||
Parent.call(this, id, physicsEngine, user);
|
Parent.call(this, id, physicsEngine, user);
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@ define([
|
||||||
],
|
],
|
||||||
|
|
||||||
function () {
|
function () {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function AudioPlayer(path) {
|
function AudioPlayer(path) {
|
||||||
this.audio = new Audio(path);
|
this.audio = new Audio(path);
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,8 @@ define([
|
||||||
|
|
||||||
function (Parent) {
|
function (Parent) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function Detector () {
|
function Detector () {
|
||||||
Parent.call(this);
|
Parent.call(this);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,8 @@ define([
|
||||||
],
|
],
|
||||||
|
|
||||||
function (Parent, Settings) {
|
function (Parent, Settings) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function GamepadInput(playerController) {
|
function GamepadInput(playerController) {
|
||||||
this.playerController = playerController;
|
this.playerController = playerController;
|
||||||
|
|
|
||||||
|
|
@ -1,55 +0,0 @@
|
||||||
define([
|
|
||||||
"Game/Client/Control/Key"
|
|
||||||
],
|
|
||||||
|
|
||||||
function (Key) {
|
|
||||||
|
|
||||||
function KeyboardInput () {
|
|
||||||
this._registry = {};
|
|
||||||
this.init();
|
|
||||||
}
|
|
||||||
|
|
||||||
KeyboardInput.prototype.init = function () {
|
|
||||||
// Using window is ok here because it only runs in the browser
|
|
||||||
window.onkeydown = this._onKeyDown.bind(this);
|
|
||||||
window.onkeyup = this._onKeyUp.bind(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
KeyboardInput.prototype.registerKey = function (keyCode, onKeyDown, onKeyUp) {
|
|
||||||
var key = new Key();
|
|
||||||
if(onKeyDown) key.setKeyDownFunction(onKeyDown);
|
|
||||||
if(onKeyUp) key.setKeyUpFunction(onKeyUp);
|
|
||||||
this._registry[keyCode] = key;
|
|
||||||
}
|
|
||||||
|
|
||||||
KeyboardInput.prototype._getKeyByKeyCode = function (keyCode) {
|
|
||||||
return this._registry[keyCode];
|
|
||||||
}
|
|
||||||
|
|
||||||
KeyboardInput.prototype._onKeyDown = function (e) {
|
|
||||||
var key = this._getKeyByKeyCode(e.keyCode);
|
|
||||||
|
|
||||||
if (key && !key.getActive()) {
|
|
||||||
var callback = key.getKeyDownFunction();
|
|
||||||
if(callback) callback();
|
|
||||||
key.setActive(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Prevent tab from changing focus
|
|
||||||
if(e.keyCode == 9) return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
KeyboardInput.prototype._onKeyUp = function (e) {
|
|
||||||
var key = this._getKeyByKeyCode(e.keyCode);
|
|
||||||
if (key && key.getActive()) {
|
|
||||||
var callback = key.getKeyUpFunction();
|
|
||||||
if(callback) callback();
|
|
||||||
key.setActive(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Prevent tab from changing focus
|
|
||||||
if(e.keyCode == 9) return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return KeyboardInput;
|
|
||||||
});
|
|
||||||
|
|
@ -7,6 +7,8 @@ define([
|
||||||
|
|
||||||
function (Parent, Nc, KeyboardAndMouse, Gamepad) {
|
function (Parent, Nc, KeyboardAndMouse, Gamepad) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function PlayerController (me) {
|
function PlayerController (me) {
|
||||||
|
|
||||||
Parent.call(this, me);
|
Parent.call(this, me);
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,8 @@ define([
|
||||||
|
|
||||||
function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Nc, requestAnimFrame, Settings, GameObject, Doll, DomController, ProtocolHelper, Me, AudioPlayer) {
|
function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Nc, requestAnimFrame, Settings, GameObject, Doll, DomController, ProtocolHelper, Me, AudioPlayer) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
if (!window.cancelAnimationFrame) {
|
if (!window.cancelAnimationFrame) {
|
||||||
window.cancelAnimationFrame = function(id) {
|
window.cancelAnimationFrame = function(id) {
|
||||||
clearTimeout(id);
|
clearTimeout(id);
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,8 @@ define([
|
||||||
],
|
],
|
||||||
|
|
||||||
function (Parent, Settings, Nc, Exception, ColorConverter, Layer) {
|
function (Parent, Settings, Nc, Exception, ColorConverter, Layer) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function Doll(physicsEngine, uid, player) {
|
function Doll(physicsEngine, uid, player) {
|
||||||
this.layerId = Layer.ID.SPAWN;
|
this.layerId = Layer.ID.SPAWN;
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@ define([
|
||||||
],
|
],
|
||||||
|
|
||||||
function (Parent, Exception, Nc) {
|
function (Parent, Exception, Nc) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function GameObject(physicsEngine, uid) {
|
function GameObject(physicsEngine, uid) {
|
||||||
Parent.call(this, physicsEngine, uid);
|
Parent.call(this, physicsEngine, uid);
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,8 @@ define([
|
||||||
],
|
],
|
||||||
|
|
||||||
function (Parent, Settings, Nc, Layer) {
|
function (Parent, Settings, Nc, Layer) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function Item(physicsEngine, uid, options) {
|
function Item(physicsEngine, uid, options) {
|
||||||
this.layerId = Layer.ID.ITEM;
|
this.layerId = Layer.ID.ITEM;
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,8 @@ define([
|
||||||
],
|
],
|
||||||
|
|
||||||
function (Parent, CoreItem, Settings, Nc, Layer) {
|
function (Parent, CoreItem, Settings, Nc, Layer) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function RagDoll(physicsEngine, uid, options) {
|
function RagDoll(physicsEngine, uid, options) {
|
||||||
this.layerId = Layer.ID.SPAWN;
|
this.layerId = Layer.ID.SPAWN;
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@ define([
|
||||||
],
|
],
|
||||||
|
|
||||||
function (Parent) {
|
function (Parent) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function Rube(physicsEngine, uid, options) {
|
function Rube(physicsEngine, uid, options) {
|
||||||
Parent.call(this, physicsEngine, uid, options);
|
Parent.call(this, physicsEngine, uid, options);
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@ define([
|
||||||
],
|
],
|
||||||
|
|
||||||
function (Parent) {
|
function (Parent) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function SpectatorDoll(physicsEngine, uid) {
|
function SpectatorDoll(physicsEngine, uid) {
|
||||||
Parent.call(this, physicsEngine, uid);
|
Parent.call(this, physicsEngine, uid);
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,8 @@ define([
|
||||||
],
|
],
|
||||||
|
|
||||||
function (Parent, Settings, Nc, Layer) {
|
function (Parent, Settings, Nc, Layer) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function Tile(physicsEngine, uid, options) {
|
function Tile(physicsEngine, uid, options) {
|
||||||
this.layerId = Layer.ID.TILE;
|
this.layerId = Layer.ID.TILE;
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,8 @@ define([
|
||||||
|
|
||||||
function (Parent, Settings, Nc, PIXI, AbstractLayer) {
|
function (Parent, Settings, Nc, PIXI, AbstractLayer) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function Level (uid, engine, gameObjects) {
|
function Level (uid, engine, gameObjects) {
|
||||||
Parent.call(this, uid, engine, gameObjects);
|
Parent.call(this, uid, engine, gameObjects);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@ define([
|
||||||
],
|
],
|
||||||
|
|
||||||
function (Parent, Settings, Nc) {
|
function (Parent, Settings, Nc) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function TiledLevel(uid, engine, gameObjects) {
|
function TiledLevel(uid, engine, gameObjects) {
|
||||||
this.layerId = "background";
|
this.layerId = "background";
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@ define([
|
||||||
],
|
],
|
||||||
|
|
||||||
function (Parent, Settings, Nc) {
|
function (Parent, Settings, Nc) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function Me(id, physicsEngine, user) {
|
function Me(id, physicsEngine, user) {
|
||||||
Parent.call(this, id, physicsEngine, user);
|
Parent.call(this, id, physicsEngine, user);
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,8 @@ define([
|
||||||
|
|
||||||
function (ProtocolHelper, GameController, User, Nc, Settings, DomController) {
|
function (ProtocolHelper, GameController, User, Nc, Settings, DomController) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function Networker (socketLink, channelName, nickname) {
|
function Networker (socketLink, channelName, nickname) {
|
||||||
this.channelName = channelName;
|
this.channelName = channelName;
|
||||||
this.nickname = nickname;
|
this.nickname = nickname;
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,8 @@ define([
|
||||||
|
|
||||||
function (Parent, Settings, DomController, Box2D, Nc) {
|
function (Parent, Settings, DomController, Box2D, Nc) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function Engine () {
|
function Engine () {
|
||||||
Parent.call(this);
|
Parent.call(this);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@ define([
|
||||||
],
|
],
|
||||||
|
|
||||||
function (Parent, Nc, Settings) {
|
function (Parent, Nc, Settings) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function Player(id, physicsEngine, user) {
|
function Player(id, physicsEngine, user) {
|
||||||
Parent.call(this, id, physicsEngine, user);
|
Parent.call(this, id, physicsEngine, user);
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,8 @@ define([
|
||||||
|
|
||||||
function (Abstract) {
|
function (Abstract) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function Layer(name, parallaxSpeed) {
|
function Layer(name, parallaxSpeed) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.parallaxSpeed = parallaxSpeed;
|
this.parallaxSpeed = parallaxSpeed;
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,8 @@ define([
|
||||||
],
|
],
|
||||||
|
|
||||||
function (Abstract, DomController, Settings, Exception, Nc) {
|
function (Abstract, DomController, Settings, Exception, Nc) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function AbstractView () {
|
function AbstractView () {
|
||||||
this.me = null;
|
this.me = null;
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,8 @@ define([
|
||||||
|
|
||||||
function (Settings, Nc, Stats, Screenfull) {
|
function (Settings, Nc, Stats, Screenfull) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function DomController() {
|
function DomController() {
|
||||||
this.canvas = document.getElementById("canvas");
|
this.canvas = document.getElementById("canvas");
|
||||||
this.debugCanvas = null;
|
this.debugCanvas = null;
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@ define([
|
||||||
],
|
],
|
||||||
|
|
||||||
function (Nc, Exception, Layer) {
|
function (Nc, Exception, Layer) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function LayerManager(container, me) {
|
function LayerManager(container, me) {
|
||||||
this.layers = [];
|
this.layers = [];
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,8 @@ define([
|
||||||
|
|
||||||
function (Settings, Nc, Stats, Screenfull) {
|
function (Settings, Nc, Stats, Screenfull) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function Mesh() {
|
function Mesh() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,8 @@ define([
|
||||||
|
|
||||||
function (PIXI) {
|
function (PIXI) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
var Parent = PIXI.AbstractFilter;
|
var Parent = PIXI.AbstractFilter;
|
||||||
|
|
||||||
function ColorRangeReplaceFilter() {
|
function ColorRangeReplaceFilter() {
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,8 @@ define([
|
||||||
],
|
],
|
||||||
|
|
||||||
function (PIXI, Nc, Settings, ColorConverter) {
|
function (PIXI, Nc, Settings, ColorConverter) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function GameStats(container) {
|
function GameStats(container) {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,8 @@ define([
|
||||||
|
|
||||||
function (Parent, PIXI, ColorRangeReplaceFilter, Settings) {
|
function (Parent, PIXI, ColorRangeReplaceFilter, Settings) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
var AVAILABLE_MESH_FILTERS = {
|
var AVAILABLE_MESH_FILTERS = {
|
||||||
"blur": PIXI.BlurFilter,
|
"blur": PIXI.BlurFilter,
|
||||||
"desaturate": PIXI.GrayFilter,
|
"desaturate": PIXI.GrayFilter,
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,8 @@ define([
|
||||||
],
|
],
|
||||||
|
|
||||||
function (Parent, PIXI, Nc, Settings) {
|
function (Parent, PIXI, Nc, Settings) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function Ghost() {
|
function Ghost() {
|
||||||
Parent.call(this, "ghost", 0);
|
Parent.call(this, "ghost", 0);
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,8 @@ define([
|
||||||
|
|
||||||
function (Parent, DomController, PIXI, Settings, Nc, Exception, GameStats, LayerManager, Ghost, Swiper) {
|
function (Parent, DomController, PIXI, Settings, Nc, Exception, GameStats, LayerManager, Ghost, Swiper) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function PixiView () {
|
function PixiView () {
|
||||||
|
|
||||||
Parent.call(this);
|
Parent.call(this);
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,8 @@ define([
|
||||||
],
|
],
|
||||||
|
|
||||||
function (Parent, DomController, Three, Settings) {
|
function (Parent, DomController, Three, Settings) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function ThreeView () {
|
function ThreeView () {
|
||||||
Parent.call(this);
|
Parent.call(this);
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,8 @@ define([
|
||||||
],
|
],
|
||||||
|
|
||||||
function (Settings, Exception, AbstractView, PixiView, Nc) {
|
function (Settings, Exception, AbstractView, PixiView, Nc) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
var ViewManager = {};
|
var ViewManager = {};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,8 @@ define([
|
||||||
|
|
||||||
function (Box2D) {
|
function (Box2D) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function Detector () {
|
function Detector () {
|
||||||
this.listener = new Box2D.Dynamics.b2ContactListener();
|
this.listener = new Box2D.Dynamics.b2ContactListener();
|
||||||
this.listener.BeginContact = this.beginContact.bind(this);
|
this.listener.BeginContact = this.beginContact.bind(this);
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,8 @@ define([
|
||||||
|
|
||||||
function (PhysicsEngine, TiledLevel, Player, Nc, Doll) {
|
function (PhysicsEngine, TiledLevel, Player, Nc, Doll) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function GameController (options) {
|
function GameController (options) {
|
||||||
|
|
||||||
this.options = options;
|
this.options = options;
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,8 @@ define([
|
||||||
|
|
||||||
function (Parent, Box2D, Settings, CollisionDetector, Item, Nc) {
|
function (Parent, Box2D, Settings, CollisionDetector, Item, Nc) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function Doll (physicsEngine, uid, player) {
|
function Doll (physicsEngine, uid, player) {
|
||||||
|
|
||||||
this.characterName = "Chuck";
|
this.characterName = "Chuck";
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,8 @@ define([
|
||||||
],
|
],
|
||||||
|
|
||||||
function (Box2D, Exception) {
|
function (Box2D, Exception) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function GameObject(physicsEngine, uid) {
|
function GameObject(physicsEngine, uid) {
|
||||||
this.uid = uid;
|
this.uid = uid;
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,8 @@ define([
|
||||||
],
|
],
|
||||||
|
|
||||||
function (Parent, Box2D, Options, Settings, Exception, Nc) {
|
function (Parent, Box2D, Options, Settings, Exception, Nc) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function Item(physicsEngine, uid, options) {
|
function Item(physicsEngine, uid, options) {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,8 @@ define([
|
||||||
],
|
],
|
||||||
|
|
||||||
function (Parent, Box2D, Settings, Nc) {
|
function (Parent, Box2D, Settings, Nc) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function RagDoll(physicsEngine, uid, options) {
|
function RagDoll(physicsEngine, uid, options) {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@ define([
|
||||||
],
|
],
|
||||||
|
|
||||||
function (Parent, Box2D, Settings) {
|
function (Parent, Box2D, Settings) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function RagDoll(physicsEngine, uid, options) {
|
function RagDoll(physicsEngine, uid, options) {
|
||||||
Parent.call(this, physicsEngine, uid, options);
|
Parent.call(this, physicsEngine, uid, options);
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,8 @@ define([
|
||||||
|
|
||||||
function (Parent, RubeLoader, Box2D, Settings ) {
|
function (Parent, RubeLoader, Box2D, Settings ) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
// Fixme - make this loadable
|
// Fixme - make this loadable
|
||||||
var __ragdollJson;
|
var __ragdollJson;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@ define([
|
||||||
],
|
],
|
||||||
|
|
||||||
function (Parent, Box2D, Settings) {
|
function (Parent, Box2D, Settings) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function Skateboard(physicsEngine, uid, options) {
|
function Skateboard(physicsEngine, uid, options) {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,8 @@ define([
|
||||||
],
|
],
|
||||||
|
|
||||||
function (Parent, Box2D) {
|
function (Parent, Box2D) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function SpectatorDoll(physicsEngine, uid, player) {
|
function SpectatorDoll(physicsEngine, uid, player) {
|
||||||
Parent.call(this, physicsEngine, uid);
|
Parent.call(this, physicsEngine, uid);
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,8 @@ define([
|
||||||
],
|
],
|
||||||
|
|
||||||
function (Parent, Box2D, Settings, Exception, Nc) {
|
function (Parent, Box2D, Settings, Exception, Nc) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function Tile(physicsEngine, uid, options) {
|
function Tile(physicsEngine, uid, options) {
|
||||||
this.options = options;
|
this.options = options;
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,8 @@ define([
|
||||||
|
|
||||||
function (Settings, Box2D, CollisionDetector, Nc) {
|
function (Settings, Box2D, CollisionDetector, Nc) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function Engine () {
|
function Engine () {
|
||||||
this.world = new Box2D.Dynamics.b2World(
|
this.world = new Box2D.Dynamics.b2World(
|
||||||
new Box2D.Common.Math.b2Vec2(0, Settings.BOX2D_GRAVITY),
|
new Box2D.Common.Math.b2Vec2(0, Settings.BOX2D_GRAVITY),
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,10 @@ define([
|
||||||
"Game/" + GLOBALS.context + "/GameObjects/Items/RagDoll"
|
"Game/" + GLOBALS.context + "/GameObjects/Items/RagDoll"
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|
||||||
function (Doll, Settings, Nc, Exception, SpectatorDoll, RagDoll) {
|
function (Doll, Settings, Nc, Exception, SpectatorDoll, RagDoll) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function Player (id, physicsEngine, user) {
|
function Player (id, physicsEngine, user) {
|
||||||
this.stats = {
|
this.stats = {
|
||||||
health: 100,
|
health: 100,
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@ define([
|
||||||
],
|
],
|
||||||
|
|
||||||
function (Exception) {
|
function (Exception) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function Abstract() {
|
function Abstract() {
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@ define([
|
||||||
],
|
],
|
||||||
|
|
||||||
function (CryptoJS) {
|
function (CryptoJS) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function ColorConverter() {
|
function ColorConverter() {
|
||||||
this.sin = 0;
|
this.sin = 0;
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,8 @@ define([
|
||||||
|
|
||||||
function (Exception) {
|
function (Exception) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function populate(obj, path) {
|
function populate(obj, path) {
|
||||||
path = path || "Nc.ns";
|
path = path || "Nc.ns";
|
||||||
for(var key in obj) {
|
for(var key in obj) {
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@ define([
|
||||||
],
|
],
|
||||||
|
|
||||||
function (Exception) {
|
function (Exception) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function Options() {
|
function Options() {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@ define([
|
||||||
|
|
||||||
function (Parser, Exception) {
|
function (Parser, Exception) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
var Helper = {}
|
var Helper = {}
|
||||||
|
|
||||||
Helper.encodeCommand = function (command, options) {
|
Helper.encodeCommand = function (command, options) {
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@ define([
|
||||||
|
|
||||||
function () {
|
function () {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
var Parser = {};
|
var Parser = {};
|
||||||
|
|
||||||
Parser.encode = function (message) {
|
Parser.encode = function (message) {
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,8 @@ define([
|
||||||
|
|
||||||
function (Settings) {
|
function (Settings) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
var requestAnimFrame = (function () {
|
var requestAnimFrame = (function () {
|
||||||
|
|
||||||
var _setTimeout = function ( callback ) {
|
var _setTimeout = function ( callback ) {
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@ define([
|
||||||
],
|
],
|
||||||
|
|
||||||
function () {
|
function () {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function validate(object, description) {
|
function validate(object, description) {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@ define([
|
||||||
|
|
||||||
function (ColorConverter, Exception) {
|
function (ColorConverter, Exception) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
var instance = null
|
var instance = null
|
||||||
|
|
||||||
function Menu() {
|
function Menu() {
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,8 @@ define([
|
||||||
|
|
||||||
function (Nc, ProtocolHelper, validate, Options, Settings, FileSystem) {
|
function (Nc, ProtocolHelper, validate, Options, Settings, FileSystem) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function Api(coordinator) {
|
function Api(coordinator) {
|
||||||
this.coordinator = coordinator;
|
this.coordinator = coordinator;
|
||||||
this.isError = false;
|
this.isError = false;
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,8 @@ define([
|
||||||
|
|
||||||
function (User, Channel, PipeToChannel, Nc, Settings) {
|
function (User, Channel, PipeToChannel, Nc, Settings) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function Coordinator() {
|
function Coordinator() {
|
||||||
this.channelPipes = {};
|
this.channelPipes = {};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@ define([
|
||||||
|
|
||||||
function (Nc, childProcess) {
|
function (Nc, childProcess) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
var fork = childProcess.fork;
|
var fork = childProcess.fork;
|
||||||
|
|
||||||
function PipeToChannel (options) {
|
function PipeToChannel (options) {
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,8 @@ define([
|
||||||
|
|
||||||
function (Parent, ProtocolHelper, Nc) {
|
function (Parent, ProtocolHelper, Nc) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function User (socketLink, coordinator) {
|
function User (socketLink, coordinator) {
|
||||||
Parent.call(this, socketLink.id, {});
|
Parent.call(this, socketLink.id, {});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
GLOBALS = { context: "Channel" };
|
"use strict";
|
||||||
|
|
||||||
|
var GLOBALS = { context: "Channel" };
|
||||||
var requirejs = require('requirejs');
|
var requirejs = require('requirejs');
|
||||||
|
|
||||||
requirejs.config({
|
requirejs.config({
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
GLOBALS = { context: "Client" };
|
"use strict";
|
||||||
|
|
||||||
|
var GLOBALS = { context: "Client" };
|
||||||
|
|
||||||
requirejs.config({
|
requirejs.config({
|
||||||
baseUrl: 'app',
|
baseUrl: 'app',
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
GLOBALS = { context: "Channel" };
|
"use strict";
|
||||||
|
|
||||||
|
var GLOBALS = { context: "Channel" };
|
||||||
var requirejs = require('requirejs');
|
var requirejs = require('requirejs');
|
||||||
|
|
||||||
var inspector;
|
var inspector;
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,8 @@ define([
|
||||||
|
|
||||||
function (Parent) {
|
function (Parent) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
return Parent;
|
return Parent;
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@ define([
|
||||||
],
|
],
|
||||||
|
|
||||||
function (Parent) {
|
function (Parent) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function ${1:Module}() {
|
function ${1:Module}() {
|
||||||
Parent.call(this);
|
Parent.call(this);
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,11 @@ define([
|
||||||
],
|
],
|
||||||
|
|
||||||
function () {
|
function () {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function ${1:Module}() {
|
function ${1:Module}() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
${1:Module}.prototype.${2:name} = function(${3:arguments}) {
|
${1:Module}.prototype.${2:name} = function(${3:arguments}) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue