2024-11-04 19:10:10 +01:00
|
|
|
extends Area2D
|
|
|
|
|
|
|
|
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
|
|
func _ready() -> void:
|
|
|
|
$AnimationPlayer.play("rotate")
|
|
|
|
|
|
|
|
func _physics_process(delta: float) -> void:
|
|
|
|
if $"/root/Global".gamerunning:
|
|
|
|
global_position.x -= $"/root/Global".speed*delta
|
|
|
|
|
|
|
|
|
|
|
|
func _on_body_entered(body: Node2D) -> void:
|
|
|
|
if body.name == "Duck":
|
2024-11-10 19:51:00 +01:00
|
|
|
#print("duck touched")
|
2024-11-04 19:10:10 +01:00
|
|
|
$AnimationPlayer.play("explode")
|
2024-11-10 19:51:00 +01:00
|
|
|
#await await $AnimationPlayer.animation_finished
|
|
|
|
##queue_free()
|
|
|
|
#print("animation finisched")
|
2024-11-04 19:10:10 +01:00
|
|
|
# add coin
|
|
|
|
if body.name == "hurdle":
|
2024-11-10 19:51:00 +01:00
|
|
|
pass#queue_free()
|