brackeys-12/ui_level.gd

14 lines
401 B
GDScript3
Raw Normal View History

2024-09-15 01:37:29 +00:00
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)