implemented spawn points and a brand new map

This commit is contained in:
logsol 2014-02-03 16:18:22 +01:00
parent 4ea86a97aa
commit cc8aedd3ba
10 changed files with 1283 additions and 10645 deletions

View file

@ -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;

View file

@ -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);