Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(1 edit) (+1)

Great stuff! Enjoy watching progress. From game dev standpoint a more technical "i'm learning, here is my understanding + example snippet" would be sweet.

I'm still new to coding/Godot. Have you considered a crafting pattern. Resources node yield different loot tables based on inputs

e.g.

class_name AppleTree

extends Tree

var node_name := "apple tree"

var loot_table := Array[Item]

var state_table  : Dictionary

var tool_table  : Dictionary

var harvest_state := HARVEST_STATE.RIPE

enum HARVEST_STATE : {BLOOMING, RIPE, PICKED, BARREN}

func interact(inputs : Array[String]) -> Array[Item]:

    var out_items := Array[Item]

    if state_table[harvest_state].has( "_".join(inputs) ):

         out_items = state_table[harvest_state][ "_".join(inputs) ]
     else:

         game_notice(NOTICE_ALERT.INVALID_TOOL)

     return out_items

# [ RIP ] [ "hands" ] = [apple]

# [ RIP ] [ "hands_axe" ] = [log, apple]

# [ PICKED] [ "hands" ] = [twigs]

Kinda thing.

keep it coming!