Am I punching trees or pounding sand?

This commit is contained in:
2025-11-05 13:48:01 +11:00
parent b65134d283
commit cb85608dfe
5 changed files with 34 additions and 7 deletions

24
items/inventory.gd Normal file
View File

@@ -0,0 +1,24 @@
#Inventory Singleton
extends Node
#game items
@abstract
class Item:
var name: String
func _init(_name: String):
name = _name
class Wood extends Item:
func _init():
super("Wood")
class Stone extends Item:
func _init():
super("Stone")
#inventory controls
var _inventory_contents: Array[Item] = []
func add_item(item: Item) -> void:
_inventory_contents.push_back(item)
print("Inventory: ", _inventory_contents.map(func (i: Item) -> String: return i.name))

1
items/inventory.gd.uid Normal file
View File

@@ -0,0 +1 @@
uid://cf0cv8j7r1qjm