slowed the snake down, now the doors are much more reliable

This commit is contained in:
Tabby 2025-08-10 16:31:21 +10:00
parent 5197d10172
commit 7584cf0b19
11 changed files with 71 additions and 10 deletions

View file

@ -23,3 +23,15 @@ func _physics_process(delta: float) -> void:
velocity = velocity.move_toward(Vector2(0,0), SPEED)
move_and_slide()
func _on_door_box_area_entered(area: Area2D) -> void:
print(area.name)
if area.name == "DoorIn":
global_position = area.get_parent().get_parent().door_out_node.global_position
Router.activate_seg.emit(Router.cur_id + 1)
# +1 seg
elif area.name == "DoorOut":
global_position = area.get_parent().get_parent().door_in_node.global_position
Router.activate_seg.emit(Router.cur_id - 1)
# -1 seg