]> Untitled Git - mushroom-game.git/blob - mushroom/mushroom.gd
Squashed commit of the following:
[mushroom-game.git] / mushroom / mushroom.gd
1 extends Node3D
2
3
4 signal picked
5 var is_picked := false
6
7
8 # Called when the node enters the scene tree for the first time.
9 func _ready() -> void:
10         pass # Replace with function body.
11
12
13 # Called every frame. 'delta' is the elapsed time since the previous frame.
14 func _process(_delta: float) -> void:
15         pass
16
17
18 func _on_area_3d_area_entered(area: Area3D) -> void:
19         if(area.is_in_group("player")):
20                 # make this instance vanish
21                 hide()
22                 $Area3D/CollisionShape3D.set_deferred("disabled", true)
23                 is_picked = true
24                 
25                 # emit "picked" signal
26                 picked.emit()