mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +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
|
|
@ -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