mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
This commit is contained in:
parent
502cf72a7e
commit
c87997c774
13 changed files with 134 additions and 27 deletions
|
|
@ -82,6 +82,7 @@
|
||||||
|
|
||||||
Channel.prototype.onEndRound = function() {
|
Channel.prototype.onEndRound = function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
this.gameController.endRound();
|
||||||
this.broadcastControlCommand("endRound", true);
|
this.broadcastControlCommand("endRound", true);
|
||||||
|
|
||||||
console.checkpoint("End Round (" + this.name + ") - Begin Round in " + Settings.CHANNEL_END_ROUND_TIME + " seconds");
|
console.checkpoint("End Round (" + this.name + ") - Begin Round in " + Settings.CHANNEL_END_ROUND_TIME + " seconds");
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ function (Parent, PhysicsEngine, Settings, PlayerController, requestAnimFrame, N
|
||||||
this.animationTimeout = null;
|
this.animationTimeout = null;
|
||||||
this.worldUpdateTimeout = null;
|
this.worldUpdateTimeout = null;
|
||||||
this.spawnTimeouts = [];
|
this.spawnTimeouts = [];
|
||||||
|
this.roundHasEnded = false;
|
||||||
|
|
||||||
Parent.call(this, options);
|
Parent.call(this, options);
|
||||||
|
|
||||||
|
|
@ -214,6 +215,14 @@ function (Parent, PhysicsEngine, Settings, PlayerController, requestAnimFrame, N
|
||||||
this.spawnPlayer(player, 0);
|
this.spawnPlayer(player, 0);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
GameController.prototype.endRound = function() {
|
||||||
|
this.roundHasEnded = true;
|
||||||
|
|
||||||
|
for(var id in this.players) {
|
||||||
|
this.players[id].getPlayerController().setIsInBetweenGames(true);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// FIXME: remove this method
|
// FIXME: remove this method
|
||||||
GameController.prototype.onResetLevel = function(userId) {
|
GameController.prototype.onResetLevel = function(userId) {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,76 +27,86 @@ function (Parent, Nc, KeyboardAndMouse, Gamepad, PointerLockManager) {
|
||||||
};
|
};
|
||||||
|
|
||||||
PlayerController.prototype.moveLeft = function () {
|
PlayerController.prototype.moveLeft = function () {
|
||||||
if (!PointerLockManager.isLocked()) return;
|
if (!this.isPlayerInputAllowed()) return;
|
||||||
Parent.prototype.moveLeft.call(this);
|
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 () {
|
PlayerController.prototype.moveRight = function () {
|
||||||
if (!PointerLockManager.isLocked()) return;
|
if (!this.isPlayerInputAllowed()) return;
|
||||||
Parent.prototype.moveRight.call(this);
|
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 () {
|
PlayerController.prototype.stop = function () {
|
||||||
Parent.prototype.stop.call(this);
|
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 () {
|
PlayerController.prototype.jump = function () {
|
||||||
if (!PointerLockManager.isLocked()) return;
|
if (!this.isPlayerInputAllowed()) return;
|
||||||
Parent.prototype.jump.call(this);
|
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 () {
|
PlayerController.prototype.jumpStop = function () {
|
||||||
if (!PointerLockManager.isLocked()) return;
|
|
||||||
Parent.prototype.jumpStop.call(this);
|
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) {
|
PlayerController.prototype.setXY = function(x, y) {
|
||||||
if (!PointerLockManager.isLocked()) return;
|
if (!this.isPlayerInputAllowed()) return;
|
||||||
var options = {x:x, y:y};
|
var options = {x:x, y:y};
|
||||||
Parent.prototype.lookAt.call(this, options);
|
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() {
|
PlayerController.prototype.suicide = function() {
|
||||||
if (!PointerLockManager.isLocked()) return;
|
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) {
|
PlayerController.prototype.handActionRequest = function(options) {
|
||||||
if (!PointerLockManager.isLocked()) return;
|
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() {
|
PlayerController.prototype.showInfo = function() {
|
||||||
if (!PointerLockManager.isLocked()) return;
|
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() {
|
PlayerController.prototype.hideInfo = function() {
|
||||||
if (!PointerLockManager.isLocked()) return;
|
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() {
|
PlayerController.prototype.zoomIn = function() {
|
||||||
if (!PointerLockManager.isLocked()) return;
|
if (!this.isPlayerInputAllowed()) return;
|
||||||
Nc.trigger(Nc.ns.client.game.zoomIn, true);
|
Nc.trigger(Nc.ns.client.game.zoomIn, true);
|
||||||
};
|
};
|
||||||
|
|
||||||
PlayerController.prototype.zoomOut = function() {
|
PlayerController.prototype.zoomOut = function() {
|
||||||
if (!PointerLockManager.isLocked()) return;
|
if (!this.isPlayerInputAllowed()) return;
|
||||||
Nc.trigger(Nc.ns.client.game.zoomOut, false);
|
Nc.trigger(Nc.ns.client.game.zoomOut, false);
|
||||||
};
|
};
|
||||||
|
|
||||||
PlayerController.prototype.zoomReset = function() {
|
PlayerController.prototype.zoomReset = function() {
|
||||||
if (!PointerLockManager.isLocked()) return;
|
if (!this.isPlayerInputAllowed()) return;
|
||||||
Nc.trigger(Nc.ns.client.game.zoomReset, false);
|
Nc.trigger(Nc.ns.client.game.zoomReset, false);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Client overwrite - allow player input if PointerLock is locked to canvas
|
||||||
|
* and is not in between games
|
||||||
|
*/
|
||||||
|
PlayerController.prototype.isPlayerInputAllowed = function() {
|
||||||
|
return PointerLockManager.isLocked()
|
||||||
|
&& Parent.prototype.isPlayerInputAllowed.call(this);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
return PlayerController;
|
return PlayerController;
|
||||||
});
|
});
|
||||||
|
|
@ -130,6 +130,10 @@ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Nc, reque
|
||||||
};
|
};
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
GameController.prototype.onRemoveGameObject = function(options) {
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
GameController.prototype.updateGameObject = function (gameObject, gameObjectUpdate) {
|
GameController.prototype.updateGameObject = function (gameObject, gameObjectUpdate) {
|
||||||
if(gameObject === this.me.doll) {
|
if(gameObject === this.me.doll) {
|
||||||
this.me.setLastServerPositionState(gameObjectUpdate);
|
this.me.setLastServerPositionState(gameObjectUpdate);
|
||||||
|
|
@ -252,6 +256,17 @@ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Nc, reque
|
||||||
Nc.trigger(Nc.ns.client.view.gameStats.toggle, show);
|
Nc.trigger(Nc.ns.client.view.gameStats.toggle, show);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
GameController.prototype.beginRound = function() {
|
||||||
|
if (this.me.getPlayerController()) {
|
||||||
|
this.me.getPlayerController().setIsInBetweenGames(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
GameController.prototype.endRound = function() {
|
||||||
|
this.me.getPlayerController().setIsInBetweenGames(true);
|
||||||
|
this.toggleGameStats(true);
|
||||||
|
};
|
||||||
|
|
||||||
GameController.prototype.destroy = function() {
|
GameController.prototype.destroy = function() {
|
||||||
|
|
||||||
if (!window.cancelAnimationFrame) {
|
if (!window.cancelAnimationFrame) {
|
||||||
|
|
|
||||||
|
|
@ -196,10 +196,12 @@ function (ProtocolHelper, GameController, User, Nc, Settings, DomController) {
|
||||||
this.gameController.createPlayer(this.users[userId]);
|
this.gameController.createPlayer(this.users[userId]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.gameController.beginRound();
|
||||||
};
|
};
|
||||||
|
|
||||||
Networker.prototype.onEndRound = function() {
|
Networker.prototype.onEndRound = function() {
|
||||||
this.gameController.toggleGameStats(true);
|
this.gameController.endRound();
|
||||||
};
|
};
|
||||||
|
|
||||||
return Networker;
|
return Networker;
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ function (PIXI, Nc, Settings, ColorConverter) {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
function GameStats(gameContainer) {
|
function GameStats(view) {
|
||||||
|
|
||||||
this.style = {
|
this.style = {
|
||||||
borderWidth: 3,
|
borderWidth: 3,
|
||||||
|
|
@ -27,7 +27,7 @@ function (PIXI, Nc, Settings, ColorConverter) {
|
||||||
fontSize: 12
|
fontSize: 12
|
||||||
};
|
};
|
||||||
|
|
||||||
this.gameContainer = gameContainer;
|
this.view = view;
|
||||||
|
|
||||||
this.container = new PIXI.DisplayObjectContainer();
|
this.container = new PIXI.DisplayObjectContainer();
|
||||||
|
|
||||||
|
|
@ -77,11 +77,12 @@ function (PIXI, Nc, Settings, ColorConverter) {
|
||||||
this.redraw();
|
this.redraw();
|
||||||
// show stats with filters
|
// show stats with filters
|
||||||
this.container.visible = true;
|
this.container.visible = true;
|
||||||
this.gameContainer.filters = this.filters;
|
|
||||||
|
this.view.addFilters(this.filters);
|
||||||
this.filters.forEach(function(filter) { filter.dirty = true; });
|
this.filters.forEach(function(filter) { filter.dirty = true; });
|
||||||
} else {
|
} else {
|
||||||
this.container.visible = false;
|
this.container.visible = false;
|
||||||
this.gameContainer.filters = null;
|
this.view.removeFilters(this.filters);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -174,6 +174,11 @@ function (Parent, PIXI, ColorRangeReplaceFilter, Settings, ColorConverter, Nc) {
|
||||||
|
|
||||||
Layer.prototype.addFilter = function(mesh, filterName, options) {
|
Layer.prototype.addFilter = function(mesh, filterName, options) {
|
||||||
|
|
||||||
|
// use game container if mesh null
|
||||||
|
if(mesh === null) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if (!this.getAvailableMeshFilters().hasOwnProperty(filterName)) {
|
if (!this.getAvailableMeshFilters().hasOwnProperty(filterName)) {
|
||||||
throw new Exception('Filter ' + filterName + ' is not available');
|
throw new Exception('Filter ' + filterName + ' is not available');
|
||||||
}
|
}
|
||||||
|
|
@ -228,6 +233,8 @@ function (Parent, PIXI, ColorRangeReplaceFilter, Settings, ColorConverter, Nc) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FIXME this should throw an error i think since "options" is not defined here
|
||||||
|
// maybe we never actually call this method?
|
||||||
var MeshFilter = this.getAvailableMeshFilters()[options.filter];
|
var MeshFilter = this.getAvailableMeshFilters()[options.filter];
|
||||||
|
|
||||||
filters = filters.filter(function(filter){
|
filters = filters.filter(function(filter){
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ function (Parent, DomController, PIXI, Settings, Nc, Exception, GameStats, Layer
|
||||||
this.initPointerLockView();
|
this.initPointerLockView();
|
||||||
|
|
||||||
// Tab Overlay (not using layer manager, cause of filters)
|
// Tab Overlay (not using layer manager, cause of filters)
|
||||||
this.gameStats = new GameStats(this.container);
|
this.gameStats = new GameStats(this);
|
||||||
this.stage.addChild(this.gameStats.getInfoContainer());
|
this.stage.addChild(this.gameStats.getInfoContainer());
|
||||||
|
|
||||||
this.ghostLayer = new Ghost();
|
this.ghostLayer = new Ghost();
|
||||||
|
|
@ -143,7 +143,8 @@ function (Parent, DomController, PIXI, Settings, Nc, Exception, GameStats, Layer
|
||||||
if (!Settings.ENABLE_POINTER_LOCK_FILTER) return;
|
if (!Settings.ENABLE_POINTER_LOCK_FILTER) return;
|
||||||
|
|
||||||
if(isLocked) {
|
if(isLocked) {
|
||||||
this.container.filters = null;
|
this.removeFilters(this.pointerLockFilters);
|
||||||
|
|
||||||
this.clickToEnable.visible = false;
|
this.clickToEnable.visible = false;
|
||||||
this.onZoomReset();
|
this.onZoomReset();
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -159,7 +160,7 @@ function (Parent, DomController, PIXI, Settings, Nc, Exception, GameStats, Layer
|
||||||
strokeThickness: 6 * this.currentZoom
|
strokeThickness: 6 * this.currentZoom
|
||||||
});
|
});
|
||||||
|
|
||||||
this.container.filters = this.pointerLockFilters;
|
this.addFilters(this.pointerLockFilters);
|
||||||
this.pointerLockFilters.forEach(function(filter) { filter.dirty = true; });
|
this.pointerLockFilters.forEach(function(filter) { filter.dirty = true; });
|
||||||
|
|
||||||
this.clickToEnable.position = new PIXI.Point(Settings.STAGE_WIDTH / 2 - this.clickToEnable.width / 2, Settings.STAGE_HEIGHT / 2 - this.clickToEnable.height / 2)
|
this.clickToEnable.position = new PIXI.Point(Settings.STAGE_WIDTH / 2 - this.clickToEnable.width / 2, Settings.STAGE_HEIGHT / 2 - this.clickToEnable.height / 2)
|
||||||
|
|
@ -170,6 +171,46 @@ function (Parent, DomController, PIXI, Settings, Nc, Exception, GameStats, Layer
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
PixiView.prototype.removeFilters = function(filters) {
|
||||||
|
|
||||||
|
if(this.container && this.container.filters && this.container.filters.length) {
|
||||||
|
for (var i = this.container.filters.length - 1; i >= 0; i--) {
|
||||||
|
|
||||||
|
for (var j = filters.length - 1; j >= 0; j--) {
|
||||||
|
if (filters[j] === this.container.filters[i]) {
|
||||||
|
this.container.filters.splice(i, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// weird bug, filters.length cant be 0, must be set to null
|
||||||
|
if(this.container.filters.length < 1) {
|
||||||
|
this.container.filters = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
PixiView.prototype.addFilters = function(filters) {
|
||||||
|
if (filters.length < 1) return;
|
||||||
|
if (!this.container) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!this.container.filters) {
|
||||||
|
/*
|
||||||
|
* slice does a copy, which is important here -
|
||||||
|
* otherwise this.pointerLockFilters will be manipulated too on remove.
|
||||||
|
*/
|
||||||
|
this.container.filters = filters.slice();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (var i = 0; i < filters.length; i++) {
|
||||||
|
this.container.filters.push(filters[i]);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
PixiView.prototype.calculateCenterPosition = function() {
|
PixiView.prototype.calculateCenterPosition = function() {
|
||||||
var target = this.me.getHeadPosition();
|
var target = this.me.getHeadPosition();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ function () {
|
||||||
VIEW_CONTROLLER: 0 ? "Three" : "Pixi",
|
VIEW_CONTROLLER: 0 ? "Three" : "Pixi",
|
||||||
ARROW_GLIDE: 30, // % of the way per frame
|
ARROW_GLIDE: 30, // % of the way per frame
|
||||||
SHOW_LAYER_INFO: false,
|
SHOW_LAYER_INFO: false,
|
||||||
ENABLE_POINTER_LOCK_FILTER: false,
|
ENABLE_POINTER_LOCK_FILTER: true,
|
||||||
|
|
||||||
// GAME PLAY
|
// GAME PLAY
|
||||||
WALK_SPEED: 4,
|
WALK_SPEED: 4,
|
||||||
|
|
@ -88,8 +88,8 @@ function () {
|
||||||
CHANNEL_MAX_USERS: 20,
|
CHANNEL_MAX_USERS: 20,
|
||||||
CHANNEL_DESTRUCTION_TIME: 0.5 * 60,
|
CHANNEL_DESTRUCTION_TIME: 0.5 * 60,
|
||||||
CHANNEL_END_ROUND_TIME: 20, //10,
|
CHANNEL_END_ROUND_TIME: 20, //10,
|
||||||
CHANNEL_DEFAULT_MAX_USERS: 40,
|
CHANNEL_DEFAULT_MAX_USERS: 10,
|
||||||
CHANNEL_DEFAULT_SCORE_LIMIT: 10,
|
CHANNEL_DEFAULT_SCORE_LIMIT: 1,
|
||||||
CHANNEL_DEFAULT_LEVELS: ["debug"],
|
CHANNEL_DEFAULT_LEVELS: ["debug"],
|
||||||
CHANNEL_RECORD_SESSION: false,
|
CHANNEL_RECORD_SESSION: false,
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,14 +10,18 @@ function () {
|
||||||
this._shift;
|
this._shift;
|
||||||
this._isJumping;
|
this._isJumping;
|
||||||
this._walkingDirectionStatus = 0;
|
this._walkingDirectionStatus = 0;
|
||||||
|
|
||||||
|
this.isInBetweenGames = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
PlayerController.prototype.moveLeft = function () {
|
PlayerController.prototype.moveLeft = function () {
|
||||||
|
if(!this.isPlayerInputAllowed()) return;
|
||||||
this.player.move(-1);
|
this.player.move(-1);
|
||||||
this._walkingDirectionStatus = -1;
|
this._walkingDirectionStatus = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
PlayerController.prototype.moveRight = function () {
|
PlayerController.prototype.moveRight = function () {
|
||||||
|
if(!this.isPlayerInputAllowed()) return;
|
||||||
this.player.move(1);
|
this.player.move(1);
|
||||||
this._walkingDirectionStatus = 1;
|
this._walkingDirectionStatus = 1;
|
||||||
}
|
}
|
||||||
|
|
@ -28,6 +32,7 @@ function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
PlayerController.prototype.jump = function () {
|
PlayerController.prototype.jump = function () {
|
||||||
|
if(!this.isPlayerInputAllowed()) return;
|
||||||
this._isJumping = true;
|
this._isJumping = true;
|
||||||
this.player.jump();
|
this.player.jump();
|
||||||
}
|
}
|
||||||
|
|
@ -37,9 +42,18 @@ function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
PlayerController.prototype.lookAt = function (options) {
|
PlayerController.prototype.lookAt = function (options) {
|
||||||
|
if(!this.isPlayerInputAllowed()) return;
|
||||||
if(options) this.player.lookAt(options.x, options.y);
|
if(options) this.player.lookAt(options.x, options.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PlayerController.prototype.setIsInBetweenGames = function(isInBetweenGames) {
|
||||||
|
this.isInBetweenGames = !!isInBetweenGames;
|
||||||
|
};
|
||||||
|
|
||||||
|
PlayerController.prototype.isPlayerInputAllowed = function() {
|
||||||
|
return !this.isInBetweenGames;
|
||||||
|
};
|
||||||
|
|
||||||
PlayerController.prototype.update = function () {
|
PlayerController.prototype.update = function () {
|
||||||
if(this._walkingDirectionStatus != 0) {
|
if(this._walkingDirectionStatus != 0) {
|
||||||
this.player.move(this._walkingDirectionStatus);
|
this.player.move(this._walkingDirectionStatus);
|
||||||
|
|
|
||||||
|
|
@ -187,5 +187,9 @@ function (Doll, Settings, Nc, Exception, ColorConverter, SpectatorDoll, RubeDoll
|
||||||
this.playerController = playerController;
|
this.playerController = playerController;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Player.prototype.getPlayerController = function() {
|
||||||
|
return this.playerController;
|
||||||
|
}
|
||||||
|
|
||||||
return Player;
|
return Player;
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,12 @@
|
||||||
define([
|
define([
|
||||||
|
"Game/Config/Settings",
|
||||||
"Lib/Utilities/ColorConverter",
|
"Lib/Utilities/ColorConverter",
|
||||||
"Lib/Utilities/Exception",
|
"Lib/Utilities/Exception",
|
||||||
"Game/Client/PointerLockManager",
|
"Game/Client/PointerLockManager",
|
||||||
"Lib/Utilities/QuerySelector"
|
"Lib/Utilities/QuerySelector"
|
||||||
],
|
],
|
||||||
|
|
||||||
function (ColorConverter, Exception, PointerLockManager, Qs) {
|
function (Settings, ColorConverter, Exception, PointerLockManager, Qs) {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
|
@ -29,6 +30,8 @@ function (ColorConverter, Exception, PointerLockManager, Qs) {
|
||||||
if(localStorage["customname"]) {
|
if(localStorage["customname"]) {
|
||||||
Qs.$("#customname").value = localStorage["customname"];
|
Qs.$("#customname").value = localStorage["customname"];
|
||||||
}
|
}
|
||||||
|
Qs.$("#scoreLimit").value = Settings.CHANNEL_DEFAULT_SCORE_LIMIT;
|
||||||
|
Qs.$("#userLimit").value = Settings.CHANNEL_DEFAULT_MAX_USERS;
|
||||||
|
|
||||||
|
|
||||||
Qs.$("#refresh").onclick = refresh;
|
Qs.$("#refresh").onclick = refresh;
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,8 @@
|
||||||
<div>
|
<div>
|
||||||
<h2>Create your own!</h2>
|
<h2>Create your own!</h2>
|
||||||
<p><label>Name:<br> <input id="customname"></label></p>
|
<p><label>Name:<br> <input id="customname"></label></p>
|
||||||
<p><label>Score limit:<br> <input id="scoreLimit" type="number" value="5"></label></p>
|
<p><label>Score limit:<br> <input id="scoreLimit" type="number" value=""></label></p>
|
||||||
<p><label>User limit:<br> <input id="userLimit" type="number" value="10"></label></p>
|
<p><label>User limit:<br> <input id="userLimit" type="number" value=""></label></p>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>Maps</legend>
|
<legend>Maps</legend>
|
||||||
<ul id="maps">
|
<ul id="maps">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue