Bee State Machine
This commit is contained in:
parent
20bcab01b1
commit
752131c955
16 changed files with 467 additions and 13 deletions
19
entities/scripts/bee_hit_box.gd
Normal file
19
entities/scripts/bee_hit_box.gd
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
extends Area2D
|
||||
|
||||
@onready var bee = get_parent() as Bee
|
||||
|
||||
func _ready():
|
||||
pass
|
||||
|
||||
|
||||
func _on_area_entered(area:Area2D):
|
||||
## Check if the area entered is a flower patch
|
||||
if area.is_in_group("flowers"):
|
||||
bee.in_range_of_flowers = true
|
||||
Log.pr("I found some flowers!")
|
||||
|
||||
func _on_area_exited(area:Area2D):
|
||||
## Check if the area exited is a flower patch
|
||||
if area.is_in_group("flowers"):
|
||||
bee.in_range_of_flowers = false
|
||||
Log.pr("I left the flowers!")
|
||||
Loading…
Add table
Add a link
Reference in a new issue