diff options
Diffstat (limited to 'collectables/Apple.gd')
-rw-r--r-- | collectables/Apple.gd | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/collectables/Apple.gd b/collectables/Apple.gd new file mode 100644 index 0000000..909eaf2 --- /dev/null +++ b/collectables/Apple.gd @@ -0,0 +1,11 @@ +extends Node2D + +export var health=10 +func _ready(): + $AnimationPlayer.play("idle") + + +func _on_Area2D_body_entered(body): + if body.entity_type=="PLAYER": + body.health += health + queue_free() |