CloudPlatform.gd 407 B

123456789101112131415161718
  1. extends AnimatableBody2D
  2. var active := false
  3. @onready var starting_position := global_position
  4. func _physics_process(delta: float) -> void:
  5. if active:
  6. global_position.x += 48 * delta
  7. func on_player_entered(player: Player) -> void:
  8. if player.velocity.y > -player.FALL_GRAVITY:
  9. active = true
  10. func reset() -> void:
  11. global_position = starting_position
  12. reset_physics_interpolation()
  13. active = false