brackeys-12/ui_level.gd
2024-09-14 21:37:29 -04:00

13 lines
401 B
GDScript

extends TileMapLayer
@onready var building_level = get_parent().get_child(0)
func _process(delta: float) -> void:
var tile = local_to_map(get_global_mouse_position())
var building_mode = Persister.get_value("building_mode")
for spot in building_level.building_spots:
erase_cell(spot)
if not building_mode and building_level.building_spots.has(tile):
set_cell(tile, 4, Vector2i(0, 0), 0)