From 3b2c5c210309bc5fddecb103d9bc5ec362749b7c Mon Sep 17 00:00:00 2001 From: TechieDamien Date: Sat, 2 Aug 2025 10:49:02 +0100 Subject: [PATCH] Changes input to not allow instant death by reversing direction (begrudgingly by popular request) --- Scripts/snake_part.gd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/snake_part.gd b/Scripts/snake_part.gd index d3b0207..1eb3f10 100644 --- a/Scripts/snake_part.gd +++ b/Scripts/snake_part.gd @@ -398,7 +398,7 @@ func _unhandled_input(event: InputEvent) -> void: # Change direction if we are the head if event is InputEventKey and part_type == PartTypes.HEAD: for dir in inputs.keys(): - if event.is_action_pressed(dir): + if event.is_action_pressed(dir) and current_direction != -inputs[dir]: current_direction = inputs[dir]