xxxxxxxxxx
#GDScript
#The type void means the function does not return anything. You can use any type, as with variables
func _process(delta: float) -> void:
pass
#BooleanExample
func hit(damage: float) -> bool:
health_points -= damage
return health_points <= 0
# Adds an item to the inventory and returns it.
func add(reference: Item, amount: int) -> Item:
var item: Item = find_item(reference)
if not item:
item = ItemDatabase.get_instance(reference)
item.amount += amount
return item