(wip) First food commit

This commit is contained in:
Martin committed 2026-02-07 13:23:54 +01:00
1 parent 22ffa3dac1
commit 098348b329
7 files changed
+35 -6

No files matched your search

+2 -2
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:
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.