rotation rework, deletion of complex objects

This commit is contained in:
Rendo 2025-10-16 19:47:52 +05:00
commit 8dcd7725a9
15 changed files with 103 additions and 147 deletions

View file

@ -30,18 +30,18 @@ func _input(event: InputEvent) -> void:
if event.is_action_pressed("plc_place"):
var zone = try_get_zone(held_construction.global_position)
if zone != null and held_construction.try_place(zone):
var facing = held_construction.facing
var direction = held_construction.direction
held_construction = selected_prototype.scene.instantiate()
add_child(held_construction)
held_construction.set_facing(facing)
held_construction.set_direction(direction)
if event.is_action_pressed("plc_rotate_up"):
if held_construction != null:
held_construction.cycle_up_facing()
held_construction.increment_direction()
if event.is_action_pressed("plc_rotate_down"):
if held_construction != null:
held_construction.cycle_down_facing()
held_construction.decrement_direction()
if event.is_action_pressed("plc_cancel"):
held_construction.queue_free()