player as object

This commit is contained in:
2023-07-07 15:18:51 +02:00
parent 7ef126f02b
commit 1db9417dbb
9 changed files with 88 additions and 23 deletions

View File

@@ -0,0 +1,29 @@
package konstructor
type PlayerTypeID string
type InventoryItem struct {
Item Item
Used bool
Active bool
}
type Inventory struct {
Items []InventoryItem
}
type PlayerType struct {
ID PlayerTypeID
Render Render
}
type Player struct {
ID string
Type PlayerType
Position Position
Inventory Inventory
}
func GetPlayerTypeImagePath(name PlayerTypeID) string {
return GetObjectDirectory(PlayerObjectType) + string(name) + ".png"
}