[common] update Game with GameEvent

This commit is contained in:
2019-04-26 17:28:36 +03:00
parent e9de677ceb
commit 363a48bb1b
13 changed files with 230 additions and 219 deletions

View File

@@ -4,7 +4,6 @@ import haxework.view.HGroupView;
import haxework.view.ImageView;
import haxework.view.LabelView;
import openfl.Assets;
import ru.m.tankz.game.GameState.PlayerState;
import ru.m.tankz.game.GameState;
@:template class LifeView extends HGroupView {
@@ -51,7 +50,7 @@ import ru.m.tankz.game.GameState;
override public function update():Void {
super.update();
if (state != null) {
if (state != null && currentState != null) {
var tankConfig = currentState.config.getTank(state.tank);
tank = tankConfig == null ? 'ba' : tankConfig.skin;
color = currentState.config.getColor(state.id);