ball.gd 285 B

1234567891011121314151617
  1. extends Area2D
  2. const BALL_SPEED = 100
  3. var direction = Vector2(-1, 0)
  4. var speed = BALL_SPEED
  5. onready var initial_pos = self.position
  6. func reset():
  7. position = initial_pos
  8. speed = BALL_SPEED
  9. direction = Vector2(-1, 0)
  10. func _process(delta):
  11. position += direction * speed * delta