velho/godot/prefabs/player/player.gd

14 lines
322 B
GDScript

class_name Player
extends GridPosition
@export var gatherer: Gatherer
static func is_player(node: Node) -> bool:
return node is Player || node.get_parent() is Player
func _ready() -> void:
gatherer.gathered.connect(_on_gathered)
func _on_gathered(item: String, count: int):
print("gathered: ", count, " x ", item)