mirror of
https://github.com/Steffo99/swear-jar.git
synced 2024-11-21 15:24:18 +00:00
Add debug logging to Collectible
and UniversalCollector
This commit is contained in:
parent
f7c0b2359a
commit
d1429d4b3c
2 changed files with 3 additions and 0 deletions
|
@ -15,8 +15,10 @@ signal collected
|
|||
##
|
||||
## You'll probably want to connect this to an AudioSource2D, which will disable the node and play a sound, and when the sound is over a new signal will queue_free it.
|
||||
func collect():
|
||||
print("[Collectible] Collected ", self, "!")
|
||||
collected.emit()
|
||||
|
||||
|
||||
func _on_done():
|
||||
print("[Collectible] Deleting ", self, "...")
|
||||
get_parent().queue_free()
|
||||
|
|
|
@ -20,6 +20,7 @@ signal goal
|
|||
|
||||
func _on_body_entered(body: Node2D):
|
||||
if body is PhysicsBody2D:
|
||||
print("[UniversalCollector] Body entered: ", body)
|
||||
var collectible: Collectible = body.find_child("Collectible")
|
||||
if collectible:
|
||||
collected_count += 1
|
||||
|
|
Loading…
Reference in a new issue