mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
Merge 806a9d8194 into e6089687ed
This commit is contained in:
commit
f03926424a
17 changed files with 59 additions and 49 deletions
|
|
@ -1,11 +1,11 @@
|
||||||
define([
|
define([
|
||||||
"Game/" + GLOBALS.context + "/Physics/Engine",
|
"Game/" + App.context + "/Physics/Engine",
|
||||||
"Game/" + GLOBALS.context + "/Loader/TiledLevel",
|
"Game/" + App.context + "/Loader/TiledLevel",
|
||||||
"Game/" + GLOBALS.context + "/Player",
|
"Game/" + App.context + "/Player",
|
||||||
"Lib/Utilities/NotificationCenter",
|
"Lib/Utilities/NotificationCenter",
|
||||||
"Game/" + GLOBALS.context + "/GameObjects/Doll",
|
"Game/" + App.context + "/GameObjects/Doll",
|
||||||
"Game/" + GLOBALS.context + "/GameObjects/GameObject",
|
"Game/" + App.context + "/GameObjects/GameObject",
|
||||||
"Game/" + GLOBALS.context + "/GameObjects/Item",
|
"Game/" + App.context + "/GameObjects/Item",
|
||||||
"Lib/Utilities/Assert",
|
"Lib/Utilities/Assert",
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
define([
|
define([
|
||||||
"Game/" + GLOBALS.context + "/GameObjects/GameObject",
|
"Game/" + App.context + "/GameObjects/GameObject",
|
||||||
"Lib/Utilities/Exception",
|
"Lib/Utilities/Exception",
|
||||||
"Lib/Vendor/Box2D",
|
"Lib/Vendor/Box2D",
|
||||||
"Game/Config/Settings",
|
"Game/Config/Settings",
|
||||||
"Game/" + GLOBALS.context + "/Collision/Detector",
|
"Game/" + App.context + "/Collision/Detector",
|
||||||
"Game/" + GLOBALS.context + "/GameObjects/Item",
|
"Game/" + App.context + "/GameObjects/Item",
|
||||||
"Lib/Utilities/NotificationCenter",
|
"Lib/Utilities/NotificationCenter",
|
||||||
"Lib/Utilities/Assert"
|
"Lib/Utilities/Assert"
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
define([
|
define([
|
||||||
"Game/" + GLOBALS.context + "/GameObjects/GameObject",
|
"Game/" + App.context + "/GameObjects/GameObject",
|
||||||
"Lib/Vendor/Box2D",
|
"Lib/Vendor/Box2D",
|
||||||
"Lib/Utilities/OptionsHelper",
|
"Lib/Utilities/OptionsHelper",
|
||||||
"Game/Config/Settings",
|
"Game/Config/Settings",
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
define([
|
define([
|
||||||
"Game/" + GLOBALS.context + "/GameObjects/Item",
|
"Game/" + App.context + "/GameObjects/Item",
|
||||||
"Lib/Vendor/Box2D",
|
"Lib/Vendor/Box2D",
|
||||||
"Game/Config/Settings",
|
"Game/Config/Settings",
|
||||||
"Lib/Utilities/NotificationCenter",
|
"Lib/Utilities/NotificationCenter",
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
define([
|
define([
|
||||||
"Game/" + GLOBALS.context + "/GameObjects/Item",
|
"Game/" + App.context + "/GameObjects/Item",
|
||||||
"Lib/Vendor/Box2D",
|
"Lib/Vendor/Box2D",
|
||||||
"Game/Config/Settings"
|
"Game/Config/Settings"
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
define([
|
define([
|
||||||
"Game/" + GLOBALS.context + "/GameObjects/Item",
|
"Game/" + App.context + "/GameObjects/Item",
|
||||||
"Lib/Vendor/RubeLoader",
|
"Lib/Vendor/RubeLoader",
|
||||||
"Lib/Vendor/Box2D",
|
"Lib/Vendor/Box2D",
|
||||||
"Game/Config/Settings",
|
"Game/Config/Settings",
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
define([
|
define([
|
||||||
"Game/" + GLOBALS.context + "/GameObjects/Item",
|
"Game/" + App.context + "/GameObjects/Item",
|
||||||
"Lib/Vendor/Box2D",
|
"Lib/Vendor/Box2D",
|
||||||
"Game/Config/Settings",
|
"Game/Config/Settings",
|
||||||
"Lib/Utilities/Assert"
|
"Lib/Utilities/Assert"
|
||||||
|
|
@ -89,7 +89,7 @@ function (Parent, Box2D, Settings, Assert) {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
define([
|
define([
|
||||||
"Game/" + GLOBALS.context + "/GameObjects/Item",
|
"Game/" + App.context + "/GameObjects/Item",
|
||||||
"Lib/Vendor/Box2D",
|
"Lib/Vendor/Box2D",
|
||||||
"Game/Config/Settings",
|
"Game/Config/Settings",
|
||||||
"Lib/Utilities/Assert"
|
"Lib/Utilities/Assert"
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
define([
|
define([
|
||||||
"Game/" + GLOBALS.context + "/GameObjects/GameObject",
|
"Game/" + App.context + "/GameObjects/GameObject",
|
||||||
"Lib/Vendor/Box2D"
|
"Lib/Vendor/Box2D"
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
define([
|
define([
|
||||||
"Game/" + GLOBALS.context + "/GameObjects/GameObject",
|
"Game/" + App.context + "/GameObjects/GameObject",
|
||||||
"Lib/Vendor/Box2D",
|
"Lib/Vendor/Box2D",
|
||||||
"Game/Config/Settings",
|
"Game/Config/Settings",
|
||||||
"Lib/Utilities/Exception",
|
"Lib/Utilities/Exception",
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,12 @@ define([
|
||||||
"Lib/Vendor/Box2D",
|
"Lib/Vendor/Box2D",
|
||||||
"Lib/Utilities/NotificationCenter",
|
"Lib/Utilities/NotificationCenter",
|
||||||
"Lib/Utilities/Abstract",
|
"Lib/Utilities/Abstract",
|
||||||
"Game/" + GLOBALS.context + "/Collision/Detector",
|
"Game/" + App.context + "/Collision/Detector",
|
||||||
"Game/" + GLOBALS.context + "/GameObjects/Tile",
|
"Game/" + App.context + "/GameObjects/Tile",
|
||||||
"Game/" + GLOBALS.context + "/GameObjects/Item",
|
"Game/" + App.context + "/GameObjects/Item",
|
||||||
"Game/" + GLOBALS.context + "/GameObjects/Items/Skateboard",
|
"Game/" + App.context + "/GameObjects/Items/Skateboard",
|
||||||
"Game/" + GLOBALS.context + "/GameObjects/Items/RagDoll",
|
"Game/" + App.context + "/GameObjects/Items/RagDoll",
|
||||||
"Game/" + GLOBALS.context + "/GameObjects/Items/RubeDoll"
|
"Game/" + App.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) {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
define([
|
define([
|
||||||
"Game/" + GLOBALS.context + "/Loader/Level",
|
"Game/" + App.context + "/Loader/Level",
|
||||||
"Game/Config/Settings",
|
"Game/Config/Settings",
|
||||||
"Game/Config/ItemSettings",
|
"Game/Config/ItemSettings",
|
||||||
"Lib/Vendor/Box2D",
|
"Lib/Vendor/Box2D",
|
||||||
|
|
@ -8,10 +8,10 @@ define([
|
||||||
"Lib/Utilities/NotificationCenter",
|
"Lib/Utilities/NotificationCenter",
|
||||||
"Lib/Utilities/Assert",
|
"Lib/Utilities/Assert",
|
||||||
"Game/Client/View/Abstract/Layer",
|
"Game/Client/View/Abstract/Layer",
|
||||||
"Game/" + GLOBALS.context + "/Collision/Detector",
|
"Game/" + App.context + "/Collision/Detector",
|
||||||
"Game/" + GLOBALS.context + "/GameObjects/Tile",
|
"Game/" + App.context + "/GameObjects/Tile",
|
||||||
"Game/" + GLOBALS.context + "/GameObjects/Item",
|
"Game/" + App.context + "/GameObjects/Item",
|
||||||
"Game/" + GLOBALS.context + "/GameObjects/Items/Skateboard",
|
"Game/" + App.context + "/GameObjects/Items/Skateboard",
|
||||||
|
|
||||||
], function (Parent, Settings, ItemSettings, Box2D, optionsHelper, Exception, nc, Assert, AbstractLayer, CollisionDetector, Tile, Item, Skateboard) {
|
], function (Parent, Settings, ItemSettings, Box2D, optionsHelper, Exception, nc, Assert, AbstractLayer, CollisionDetector, Tile, Item, Skateboard) {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
define([
|
define([
|
||||||
"Game/Config/Settings",
|
"Game/Config/Settings",
|
||||||
"Lib/Vendor/Box2D",
|
"Lib/Vendor/Box2D",
|
||||||
"Game/" + GLOBALS.context + "/Collision/Detector",
|
"Game/" + App.context + "/Collision/Detector",
|
||||||
"Lib/Utilities/NotificationCenter"
|
"Lib/Utilities/NotificationCenter"
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
define([
|
define([
|
||||||
"Game/" + GLOBALS.context + "/GameObjects/Doll",
|
"Game/" + App.context + "/GameObjects/Doll",
|
||||||
"Game/" + GLOBALS.context + "/Control/PlayerController",
|
"Game/" + App.context + "/Control/PlayerController",
|
||||||
"Game/Config/Settings",
|
"Game/Config/Settings",
|
||||||
"Lib/Utilities/NotificationCenter",
|
"Lib/Utilities/NotificationCenter",
|
||||||
"Lib/Utilities/Exception",
|
"Lib/Utilities/Exception",
|
||||||
"Lib/Utilities/ColorConverter",
|
"Lib/Utilities/ColorConverter",
|
||||||
"Game/" + GLOBALS.context + "/GameObjects/SpectatorDoll",
|
"Game/" + App.context + "/GameObjects/SpectatorDoll",
|
||||||
"Game/" + GLOBALS.context + "/GameObjects/Items/RubeDoll"
|
"Game/" + App.context + "/GameObjects/Items/RubeDoll"
|
||||||
],
|
],
|
||||||
|
|
||||||
function (Doll, PlayerController, Settings, nc, Exception, ColorConverter, SpectatorDoll, RubeDoll) {
|
function (Doll, PlayerController, Settings, nc, Exception, ColorConverter, SpectatorDoll, RubeDoll) {
|
||||||
|
|
|
||||||
14
channel.js
14
channel.js
|
|
@ -1,4 +1,7 @@
|
||||||
GLOBALS = { context: "Channel" };
|
// "use strict"; intentionally omitted as App scope workaround
|
||||||
|
|
||||||
|
Error.stackTraceLimit = Infinity;
|
||||||
|
|
||||||
var requirejs = require('requirejs');
|
var requirejs = require('requirejs');
|
||||||
|
|
||||||
requirejs.config({
|
requirejs.config({
|
||||||
|
|
@ -11,14 +14,17 @@ requirejs.config({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
var inspector = {};
|
|
||||||
|
App = {};
|
||||||
|
App.inspector = {};
|
||||||
|
App.context = "Channel";
|
||||||
|
|
||||||
requirejs([
|
requirejs([
|
||||||
"Game/Channel/PipeToServer"
|
"Game/Channel/PipeToServer"
|
||||||
],
|
],
|
||||||
|
|
||||||
function (PipeToServer) {
|
function (PipeToServer) {
|
||||||
var PipeToServer = new PipeToServer(process);
|
var PipeToServer = new PipeToServer(process);
|
||||||
|
|
||||||
inspector.PipeToServer = PipeToServer;
|
App.inspector.PipeToServer = PipeToServer;
|
||||||
});
|
});
|
||||||
15
client.js
15
client.js
|
|
@ -1,6 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var GLOBALS = { context: "Client" };
|
Error.stackTraceLimit = Infinity;
|
||||||
|
|
||||||
requirejs.config({
|
requirejs.config({
|
||||||
baseUrl: 'app',
|
baseUrl: 'app',
|
||||||
|
|
@ -15,8 +15,9 @@ requirejs.config({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if(!Chuck) var Chuck = {};
|
var App = App || {};
|
||||||
Chuck.inspector = {};
|
App.inspector = {};
|
||||||
|
App.context = "Client";
|
||||||
|
|
||||||
requirejs([
|
requirejs([
|
||||||
"Game/Client/Networker",
|
"Game/Client/Networker",
|
||||||
|
|
@ -36,10 +37,10 @@ function (Networker, io, Settings, Exception, nc, Menu) {
|
||||||
};
|
};
|
||||||
var socket = io("/", options);
|
var socket = io("/", options);
|
||||||
var networker = new Networker(socket, channelName, nickname);
|
var networker = new Networker(socket, channelName, nickname);
|
||||||
Chuck.inspector.networker = networker;
|
App.inspector.networker = networker;
|
||||||
Chuck.inspector.settings = Settings;
|
App.inspector.settings = Settings;
|
||||||
Chuck.inspector.nc = nc;
|
App.inspector.nc = nc;
|
||||||
Chuck.inspector.resetLevel = function() { networker.sendGameCommand("resetLevel"); }
|
App.inspector.resetLevel = function() { networker.sendGameCommand("resetLevel"); }
|
||||||
}
|
}
|
||||||
menu.init();
|
menu.init();
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
name: "../client",
|
name: "../client",
|
||||||
out: "../build/client.min.js",
|
out: "../build/client.min.js",
|
||||||
onBuildRead: function (moduleName, path, contents) {
|
onBuildRead: function (moduleName, path, contents) {
|
||||||
var contents = contents.replace(/\" \+ GLOBALS.context \+ \"/g, "Client");
|
var contents = contents.replace(/\" \+ App.context \+ \"/g, "Client");
|
||||||
return contents;
|
return contents;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
||||||
11
server.js
11
server.js
|
|
@ -1,10 +1,13 @@
|
||||||
"use strict"
|
"use strict"
|
||||||
|
|
||||||
var GLOBALS = { context: "Channel" };
|
Error.stackTraceLimit = Infinity;
|
||||||
|
|
||||||
var requirejs = require('requirejs');
|
var requirejs = require('requirejs');
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
|
|
||||||
var inspector;
|
var App = App || {};
|
||||||
|
App.inspector = {};
|
||||||
|
App.context = "Channel";
|
||||||
|
|
||||||
requirejs.config({
|
requirejs.config({
|
||||||
nodeRequire: require,
|
nodeRequire: require,
|
||||||
|
|
@ -41,11 +44,11 @@ function (HttpServer, Socket, Coordinator, Settings) {
|
||||||
var httpServer = new HttpServer(options, coordinator);
|
var httpServer = new HttpServer(options, coordinator);
|
||||||
var socket = new Socket(httpServer.getServer(), options, coordinator);
|
var socket = new Socket(httpServer.getServer(), options, coordinator);
|
||||||
|
|
||||||
inspector = {
|
App.inspector = {
|
||||||
coordinator: coordinator,
|
coordinator: coordinator,
|
||||||
httpServer: httpServer,
|
httpServer: httpServer,
|
||||||
socket: socket
|
socket: socket
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
exports = module.exports = inspector;
|
exports = module.exports = App;
|
||||||
Loading…
Add table
Add a link
Reference in a new issue