13 lines
401 B
GDScript
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)
|