aboutsummaryrefslogtreecommitdiff
path: root/collectables/Apple.gd
diff options
context:
space:
mode:
authorIndrajith K L2022-04-14 03:16:45 +0530
committerIndrajith K L2022-04-14 03:16:45 +0530
commitfc44ae1243e21179d759df3b947fc55ca0425534 (patch)
tree588afc653da04ca4a71ab8d744d900c6c6f76b6e /collectables/Apple.gd
downloadgamedevjs-jam-fc44ae1243e21179d759df3b947fc55ca0425534.tar.gz
gamedevjs-jam-fc44ae1243e21179d759df3b947fc55ca0425534.tar.bz2
gamedevjs-jam-fc44ae1243e21179d759df3b947fc55ca0425534.zip
Initial Commit
* Basic Character Controls * Tileset * Collision * Basic Collectables
Diffstat (limited to 'collectables/Apple.gd')
-rw-r--r--collectables/Apple.gd11
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()