mirror of
https://github.com/Steffo99/hella-farm.git
synced 2024-11-22 08:04:23 +00:00
16 lines
408 B
GDScript
16 lines
408 B
GDScript
@icon("res://behaviours/edible_tracker.svg")
|
|
extends Tracker
|
|
class_name EdibleTracker
|
|
|
|
## Keeps track of what [Edible]s are inside the area.
|
|
|
|
|
|
@export var acceptable_diets: Array[StringName] = []
|
|
|
|
|
|
func check_diet_then_track(body: Node2D) -> void:
|
|
var edibles: Array = body.find_children("Edible", "Edible", false, false)
|
|
for edible in edibles:
|
|
if edible.tag in acceptable_diets:
|
|
track(body)
|
|
break
|