extends Area2D
var velocity = Vector2(100, 0);
var jump_speed = 1000;
var target = null;
func _unhandled_input(event):
if target and event is InputEventScreenTouch and event.is_pressed:
jump();
func jump():
target = null; # Leave taget
velocity = transform.x * jump_speed;
func _on_Jumper_area_entered(area):
target = area; # Jumper hit the circle
velocity = Vector2(); # Stop moving forward
func _physics_process(delta):
if target:
transform = target.orbit_position.global_transform;
else:
position += velocity * delta;