10 lines
309 B
GDScript
10 lines
309 B
GDScript
extends TileMapLayer
|
|
|
|
var dirt_id = 0
|
|
var grass_id = 1
|
|
|
|
func _unhandled_input(event: InputEvent) -> void:
|
|
if event is InputEventMouseButton and event.button_index == MOUSE_BUTTON_LEFT and event.is_pressed():
|
|
var coords: Vector2i = local_to_map(event.position)
|
|
set_cell(coords, dirt_id, Vector2i.ZERO, 0)
|