DuckRun/scenes/coin/coin.gd
megamichi dd5b4bcae5 - improving textures
- adding coins (no shop jet)
- adding skin changing [no gui jet
- fixing loops for deleting stuff]
2024-11-10 19:51:00 +01:00

22 lines
561 B
GDScript

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":
#print("duck touched")
$AnimationPlayer.play("explode")
#await await $AnimationPlayer.animation_finished
##queue_free()
#print("animation finisched")
# add coin
if body.name == "hurdle":
pass#queue_free()