Chaos_Kitchen/Scripts/Interactibles/Item.gd

34 lines
599 B
GDScript3
Raw Permalink Normal View History

class_name Item extends Node
var Name : String = "none"
var Icon : Sprite2D
var mixed_self : Item
func _init(name:String , icon_texture : Texture2D, mixed_self : Item = null):
Name = name
Icon.texture = icon_texture
if Mixed_Item[Name] != null :
mixed_self = Mixed_Item[Name]
add_child(Icon)
static var Base_Item = [
Item.new("Apple", preload("res://GraphicalAssets/Sprite/IMG_0156.PNG")),
]
static var Cooked_Item = {
}
static var Mixed_Item = {
"Apple" = Item.new("Apple_Juice", preload("res://GraphicalAssets/Sprite/Apple_Juice.tres")),
}
static var Cutted_Item = {
}