mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 18:47:35 +00:00
implemented spawn points and a brand new map
This commit is contained in:
parent
4ea86a97aa
commit
cc8aedd3ba
10 changed files with 1283 additions and 10645 deletions
|
|
@ -3,17 +3,18 @@
|
|||
"Lib/Utilities/NotificationCenter",
|
||||
"Game/Server/User",
|
||||
"Lib/Utilities/Protocol/Helper",
|
||||
"Lib/Utilities/Options"
|
||||
"Lib/Utilities/Options",
|
||||
"Game/Config/Settings"
|
||||
],
|
||||
|
||||
function (GameController, NotificationCenter, User, ProtocolHelper, Options) {
|
||||
function (GameController, NotificationCenter, User, ProtocolHelper, Options, Settings) {
|
||||
|
||||
function Channel (pipeToLobby, name, options) {
|
||||
|
||||
var self = this;
|
||||
|
||||
this.options = options = Options.merge(options, {
|
||||
levelUids: ["circles", "dungeon"]
|
||||
levelUids: Settings.DEFAULT_LEVELS
|
||||
});
|
||||
|
||||
this.name = name;
|
||||
|
|
|
|||
|
|
@ -54,16 +54,17 @@ function (Parent, PhysicsEngine, Settings, PlayerController, requestAnimFrame, N
|
|||
}
|
||||
|
||||
GameController.prototype.spawnPlayer = function(player) {
|
||||
var x = 150 + Math.random() * 300,
|
||||
y = 0;
|
||||
player.spawn(x, y);
|
||||
|
||||
var spawnPoint = this.level.getRandomSpawnPoint();
|
||||
|
||||
player.spawn(spawnPoint.x, spawnPoint.y);
|
||||
this.gameObjects.animated.push(player.getDoll());
|
||||
|
||||
var message = {
|
||||
spawnPlayer: {
|
||||
id: player.id,
|
||||
x: x,
|
||||
y: y
|
||||
x: spawnPoint.x,
|
||||
y: spawnPoint.y
|
||||
}
|
||||
};
|
||||
NotificationCenter.trigger("sendControlCommandToAllUsers", "gameCommand", message);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue