123456789101112131415161718192021222324252627 |
- extends Tween
- # Drive moves for player
- export var default_duration = 0.1
- export var drift_duration = 0.2
- var current_duration = default_duration
- func connect_into(o):
- connect("tween_completed", o, "_on_tween_completed")
- func move_char(c, target, duration = current_duration):
- interpolate_property(c, "position", c.get_position(), target, duration, Tween.TRANS_LINEAR, Tween.EASE_OUT_IN)
- func rotate_char(c, from, to, duration = current_duration):
- interpolate_property(c, "rotation_degrees", from, to, duration, Tween.TRANS_LINEAR, Tween.EASE_OUT)
- func _on_Player_drift_started():
- current_duration = drift_duration
- func _on_Player_drift_ended():
- current_duration = default_duration
|