[common] add deathmatch mode
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user