diff --git a/scenes/game/game.gd b/scenes/game/game.gd index 37b0961..e6da42e 100644 --- a/scenes/game/game.gd +++ b/scenes/game/game.gd @@ -78,7 +78,11 @@ func _on_Grid_tile_pressed(v): if country.money >= 5 and tile.country == country and not tile.factory: country.money -= 5 $Grid.set_factory(v, true) - + "buy_army": + if country.money >= 3 and tile.country == country and tile.factory and len(tile.units) == 0: + country.money -= 3 + country.add_unit({}, v) + func _input(event): if event is InputEventMouseButton: if event.pressed and event.button_index == BUTTON_RIGHT: diff --git a/scenes/game/game.tscn b/scenes/game/game.tscn index 81da57b..1c7645c 100644 --- a/scenes/game/game.tscn +++ b/scenes/game/game.tscn @@ -17,6 +17,7 @@ margin_left = 10.0 margin_top = 10.0 margin_right = -10.0 margin_bottom = -10.0 +mouse_filter = 1 [node name="VBoxContainer" type="VBoxContainer" parent="CanvasLayer/Control"] anchor_left = 1.0