From fc44ae1243e21179d759df3b947fc55ca0425534 Mon Sep 17 00:00:00 2001 From: Indrajith K L Date: Thu, 14 Apr 2022 03:16:45 +0530 Subject: Initial Commit * Basic Character Controls * Tileset * Collision * Basic Collectables --- collectables/Apple.gd | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 collectables/Apple.gd (limited to 'collectables/Apple.gd') 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() -- cgit v1.2.3