Made building consume resources

Now may build more than one if resources allow
building placement is red/green for indicating success
This commit is contained in:
2024-03-10 07:50:26 -05:00
parent 856b6a0400
commit d74bfda9a3
8 changed files with 53 additions and 9 deletions

View File

@@ -25,6 +25,9 @@ func change_layer(layer: int, data: Variant) -> bool:
func change_resource(data: GameResource) -> void:
layer_info[Constants.TilemapLayers.ENVIRONMENT] = data
func change_building(data: BuildingBase) -> void:
layer_info[Constants.TilemapLayers.BUILDINGS] = data
func get_resource() -> GameResource:
return layer_info[Constants.TilemapLayers.ENVIRONMENT] as GameResource
@@ -44,7 +47,7 @@ func is_interactable() -> bool:
return has_resource() or has_building()
func is_buildable() -> bool:
return not has_resource() or not has_building()
return not has_resource() and not has_building()
func get_interaction_options() -> Array[Interaction]:
var interactions: Array[Interaction] = []