[common] add deathmatch mode

This commit is contained in:
2019-03-25 17:42:20 +03:00
parent 7d570336a5
commit 556cd2f1a9
14 changed files with 223 additions and 15 deletions

View File

@@ -29,7 +29,8 @@ import ru.m.tankz.util.LevelUtil;
@:view var spawnPointList:DataView<SpawnPoint, SpawnPointView>;
@:view var brickList:DataView<BrickConfig, BrickView>;
private var config:Config;
@:provide var configBundle:IConfigBundle;
@:provide var config:Config;
public function init():Void {
var resetSelected = function() {
@@ -59,8 +60,7 @@ import ru.m.tankz.util.LevelUtil;
}
private function setGameType(type:GameType):Void {
config = Provider.get(IConfigBundle).get(type);
Provider.set(Config, config);
config = configBundle.get(type);
mapView.config = config;
mapView.data = LevelUtil.empty(config);

View File

@@ -7,16 +7,18 @@ layout.hAlign: center
views:
- $type: haxework.view.HGroupView
views:
- id: gameClassicButton
$type: haxework.view.ButtonView
- $type: haxework.view.ButtonView
skinId: button.simple
text: Classic
+onPress: $this:onPress
- id: gameDotaButton
$type: haxework.view.ButtonView
+onPress: $code:setGameType('classic')
- $type: haxework.view.ButtonView
skinId: button.simple
text: DotA
+onPress: $this:onPress
+onPress: $code:setGameType('dota')
- $type: haxework.view.ButtonView
skinId: button.simple
text: DeathMatch
+onPress: $code:setGameType('death')
- id: fileNameLabel
$type: haxework.view.LabelView
# map