diff options
Diffstat (limited to 'src/entities/actors/snake/scripts/head.gd')
-rw-r--r-- | src/entities/actors/snake/scripts/head.gd | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/entities/actors/snake/scripts/head.gd b/src/entities/actors/snake/scripts/head.gd index 448802e..117f461 100644 --- a/src/entities/actors/snake/scripts/head.gd +++ b/src/entities/actors/snake/scripts/head.gd @@ -5,6 +5,7 @@ enum { RIGHT=1 } +var _initial_speed: float = Global.SNAKE_SPEED var velocity: Vector2 = Vector2.ZERO var _direction: Vector2 = Vector2.UP var _time_elapsed: float = 0.0 @@ -26,6 +27,7 @@ func _physics_process(delta: float) -> void: func _rotate_to(direction: int) -> void: rotate(deg2rad(direction * Global.SNAKE_ROT_SPEED * get_physics_process_delta_time())) _direction = _direction.rotated(deg2rad(direction * Global.SNAKE_ROT_SPEED * get_physics_process_delta_time())) + Event.emit_signal("snake_rotated") # using a timer is not recommended for < 0.01 |