mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
moved files towards new structure. fixes #22
This commit is contained in:
parent
8cf8f057bb
commit
9de3147406
40 changed files with 0 additions and 110 deletions
0
app/game/Core/Collision/Detector.js
Normal file
0
app/game/Core/Collision/Detector.js
Normal file
0
app/game/Core/GameController.js
Normal file
0
app/game/Core/GameController.js
Normal file
0
app/game/Server/Collision/Detector.js
Normal file
0
app/game/Server/Collision/Detector.js
Normal file
|
|
@ -1,38 +0,0 @@
|
|||
define(["Chuck/Processors/ClientProcessor"], function(ClientProcessor) {
|
||||
|
||||
function ClientGame(networker, id) {
|
||||
this.networker = networker;
|
||||
this.clientProcessor = new ClientProcessor(this);
|
||||
this.clientProcessor.spawnMeWithId(id);
|
||||
|
||||
this.players = {};
|
||||
}
|
||||
|
||||
ClientGame.prototype.loadLevel = function(path) {
|
||||
this.clientProcessor.loadLevel(path);
|
||||
}
|
||||
|
||||
ClientGame.prototype.userJoined = function(userId) {
|
||||
this.players[userId] = this.clientProcessor.spawnNewPlayerWithId(userId);
|
||||
}
|
||||
|
||||
ClientGame.prototype.userLeft = function(userId) {
|
||||
var player = this.players[userId];
|
||||
player.destroy();
|
||||
delete this.players[userId];
|
||||
}
|
||||
|
||||
ClientGame.prototype.processGameCommand = function(command, options){
|
||||
this.clientProcessor.processGameCommand(command, options);
|
||||
}
|
||||
|
||||
ClientGame.prototype.sendGameCommand = function(command, options) {
|
||||
this.networker.sendGameCommand(command, options);
|
||||
}
|
||||
|
||||
ClientGame.prototype.destruct = function(){
|
||||
this.clientProcessor.destruct();
|
||||
}
|
||||
|
||||
return ClientGame;
|
||||
});
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
define({
|
||||
COLLISION_IDENTIFIER_PLAYER: 'player',
|
||||
COLLISION_IDENTIFIER_PLAYER_HEAD: 'head',
|
||||
COLLISION_IDENTIFIER_PLAYER_CHEST: 'chest',
|
||||
COLLISION_IDENTIFIER_PLAYER_LEGS: 'legs',
|
||||
COLLISION_IDENTIFIER_PLAYER_FOOT_SENSOR: 'footsensor',
|
||||
|
||||
COLLISION_IDENTIFIER_TILE: 'tile'
|
||||
});
|
||||
|
|
@ -1 +0,0 @@
|
|||
Server.js
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
define(["Chuck/Processors/ServerProcessor"], function(ServerProcessor) {
|
||||
|
||||
function ServerGame(channel) {
|
||||
this.channel = channel;
|
||||
this.serverProcessor = this.factory.new(ServerProcessor, this);
|
||||
}
|
||||
|
||||
ServerGame.prototype.loadLevel = function(path) {
|
||||
this.serverProcessor.loadLevel(path);
|
||||
}
|
||||
|
||||
ServerGame.prototype.progressGameCommandFromUser = function(command, options, user) {
|
||||
this.serverProcessor.progressGameCommandFromId(command, options, user.id);
|
||||
}
|
||||
|
||||
ServerGame.prototype.destruct = function() {
|
||||
this.serverProcessor.destruct();
|
||||
}
|
||||
|
||||
ServerGame.prototype.createPlayerForUser = function(user) {
|
||||
this.serverProcessor.createPlayerWithId(user.id);
|
||||
}
|
||||
|
||||
ServerGame.prototype.userIdLeft = function(userId) {
|
||||
this.serverProcessor.userIdLeft(userId);
|
||||
};
|
||||
|
||||
ServerGame.prototype.updateClientsWorld = function(update_world) {
|
||||
this.channel.sendCommandToAllUsers('gameCommand', {worldUpdate: update_world});
|
||||
}
|
||||
|
||||
return ServerGame;
|
||||
});
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
define(['Server/NotificationCenter'], function(NotificationCenter) {
|
||||
|
||||
function Factory() {
|
||||
this.notificationCenter = new NotificationCenter();
|
||||
}
|
||||
|
||||
Factory.prototype.new = function (constructor /*, arg1, arg2, ... */) {
|
||||
|
||||
if (arguments.length < 1)
|
||||
throw 'Too fiew arguments';
|
||||
if (typeof arguments[0] != 'function')
|
||||
throw arguments[0] + ' is not a function';
|
||||
|
||||
var instance = Object.create(constructor.prototype, {
|
||||
notificationCenter: {
|
||||
value: this.notificationCenter
|
||||
},
|
||||
factory: {
|
||||
value: this
|
||||
}
|
||||
});
|
||||
|
||||
constructor.apply(instance, Array.prototype.slice.call(arguments, 1));
|
||||
return instance;
|
||||
}
|
||||
|
||||
return Factory;
|
||||
|
||||
});
|
||||
BIN
lib/Vendor/.DS_Store
vendored
BIN
lib/Vendor/.DS_Store
vendored
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue