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

@@ -14,7 +14,6 @@ var noise_regions := [-999,0,999]
var atlas_regions := [Vector2i(0,1),Vector2i(0,0)]
@onready var world_grid: TileMap = $world_grid
@onready var resource_manager: Node2D = $ResourceManager
func get_noise_value(x: int, y: int):
return terrain_noise.get_noise_2d(x,y) * 500
@@ -62,7 +61,7 @@ func corrupt_location(loc: Vector2i):
func add_resources_to_map() -> void:
for res: GameResource in game_resources:
res.gained_resource.connect(resource_manager._on_gained_resource)
#res.gained_resource.connect(ResourceManager._on_gained_resource)
var spawns = res.get_spawn_locations()
for spawn in spawns:
Grid.change_location_resource(spawn, res)