aboutsummaryrefslogtreecommitdiff
path: root/collectables/Apple.gd
diff options
context:
space:
mode:
authorIndrajith K L2022-04-14 16:36:24 +0530
committerIndrajith K L2022-04-14 16:36:24 +0530
commitaef396151234aa21af4a658ea11f03ea9434961c (patch)
treee6572f4e53830283846f4294b43f083159c5fd50 /collectables/Apple.gd
parent8bf932bf0b2184c1dc11241bb9c84d6c4e420293 (diff)
downloadgamedevjs-jam-aef396151234aa21af4a658ea11f03ea9434961c.tar.gz
gamedevjs-jam-aef396151234aa21af4a658ea11f03ea9434961c.tar.bz2
gamedevjs-jam-aef396151234aa21af4a658ea11f03ea9434961c.zip
Graphics and SFX Changes
* Adds Background parallax images (not exactly parallax since we have a fixed camera) * Adds SFX * Fixes Pickable collisions and SFX playback
Diffstat (limited to 'collectables/Apple.gd')
-rw-r--r--collectables/Apple.gd7
1 files changed, 5 insertions, 2 deletions
diff --git a/collectables/Apple.gd b/collectables/Apple.gd
index e95ef61..abf0db3 100644
--- a/collectables/Apple.gd
+++ b/collectables/Apple.gd
@@ -4,8 +4,11 @@ export var health=10
func _ready():
$AnimationPlayer.play("idle")
-
func _on_Area2D_body_entered(body):
if (body.name=="Player"):
body.health += health
- queue_free()
+ self.hide()
+ $pickup.play()
+
+func _on_pickup_finished():
+ queue_free()