Browse Source

names

master
mort 8 years ago
parent
commit
6df29100c5
1 changed files with 6 additions and 1 deletions
  1. 6
    1
      js/game.js

+ 6
- 1
js/game.js View File

this.canShoot = true; this.canShoot = true;
this.health = 100; this.health = 100;
this.sendSetQueue = []; this.sendSetQueue = [];
this.name = "";


sock.on("request", (req) => { sock.on("request", (req) => {
if (req.url == "get_id") { if (req.url == "get_id") {
id: this.id id: this.id
}); });


this.name = req.data.name;

setTimeout(() => { setTimeout(() => {
game.entities.forEach((e) => e.send(true)); game.entities.forEach((e) => e.send(true));
}, 100); }, 100);
health: this.health health: this.health
} }


if (first)
if (first) {
obj.type = "player"; obj.type = "player";
obj.name = this.name;
}


this.game.players.forEach((p) => p.sendSet(obj)); this.game.players.forEach((p) => p.sendSet(obj));
} }

Loading…
Cancel
Save