[common] added PlayerState

This commit is contained in:
2018-02-20 17:23:53 +03:00
parent 5b04242aab
commit 2e856c1256
16 changed files with 135 additions and 126 deletions

View File

@@ -69,7 +69,7 @@ class GameFrame extends VGroupView implements ViewBuilder implements IPacketHand
}
private function stateString(game:Game):String {
if (game.state == null) {
if (game == null) {
return '';
}
var result:Array<String> = [];
@@ -77,12 +77,12 @@ class GameFrame extends VGroupView implements ViewBuilder implements IPacketHand
for (team in game.teams) {
if (game.state.loser == team.id) {
result.push('${team.id}: LOSE');
} else if (team.life > -1) {
} else if (team.life > 0) {
result.push('${team.id}: ${team.life}');
} else {
for (player in team.players) {
if (player.life > -1) {
result.push('${player.id.team}${player.id.index}: ${player.life}');
if (player.state.life > 0) {
result.push('${player.id.team}${player.id.index}: ${player.state.life}');
}
}
}

View File

@@ -96,6 +96,7 @@ class Render extends SpriteView implements EngineListener {
clearLayer(entryLayer);
clearLayer(groundLayer);
clearLayer(upLayer);
clearLayer(upperLayer);
}
public function onSpawn(entity:EntityType):Void {