LevelSwap.gd 362 B

12345678910111213141516
  1. extends Tween
  2. # Drive animation during level switching
  3. const FAR_AWAY = 4000
  4. export var duration = 1
  5. func swap_out(node):
  6. interpolate_property(node, "position:x", null, FAR_AWAY, duration, Tween.TRANS_QUAD, Tween.EASE_IN)
  7. start()
  8. func swap_in(node):
  9. interpolate_property(node, "position:y", null, 0, duration, Tween.TRANS_QUAD, Tween.EASE_OUT)
  10. start()