[client] add tanks players names to render

This commit is contained in:
2019-06-07 17:31:00 +03:00
parent dbf30decae
commit 8f50da64c2
20 changed files with 100 additions and 26 deletions

View File

@@ -46,17 +46,15 @@ enum Brush {
override private function drawBackground():Void {
super.drawBackground();
var mapWidth = map.gridWidth * map.cellWidth;
var mapHeight = map.gridHeight * map.cellHeight;
var g:Graphics = backgroundLayer.graphics;
g.lineStyle(1, 0x007700);
for (x in 0...map.gridWidth) {
g.moveTo(x * map.cellWidth, 0);
g.lineTo(x * map.cellWidth, mapHeight);
for (x in 0...config.map.gridWidth) {
g.moveTo(x * config.map.cellWidth, 0);
g.lineTo(x * config.map.cellWidth, config.mapHeight);
}
for (y in 0...map.gridHeight) {
g.moveTo(0, y * map.cellHeight);
g.lineTo(mapWidth, y * map.cellHeight);
for (y in 0...config.map.gridHeight) {
g.moveTo(0, y * config.map.cellHeight);
g.lineTo(config.mapWidth, y * config.map.cellHeight);
}
}
@@ -117,7 +115,7 @@ enum Brush {
var playerId = new PlayerId(point.team, point.index < 0 ? 0 : point.index);
var player = config.getPlayer(playerId);
var tankSpawn = player.tanks[0];
var tank = builder.buildTank(point, playerId, tankSpawn.type, 0, true);
var tank = builder.buildTank(point, playerId, tankSpawn.type, 0, playerId.toString(), true);
pointEntities[pointKey(point)] = tank;
gameEventSignal.emit(EventUtil.buildTankSpawn(tank));
}