(wip) First food commit

This commit is contained in:
2026-02-07 13:23:54 +01:00
parent 22ffa3dac1
commit 098348b329
7 changed files with 35 additions and 6 deletions

View File

@@ -2,14 +2,14 @@
class_name AbstractFood
extends Area2D
@export var val: int = 10
@export var val: int = 1
@export var food_name: String = "Food"
func _ready() -> void:
body_entered.connect(_on_body_entered)
func _on_body_entered(body: Node2D) -> void:
if body.is_in_group("player"):
if body.has_method("collect_resource"): # TODO: Define a "consumer" group instead?
eat(body)
func eat(consumer: Node2D) -> void: