(wip) First food commit
This commit is contained in:
@@ -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