I’m creating a game heavily inspired by minecraft, and the following scripts are direct features from minecraft.
I currently have an issue with module circular dependency. I currently have 3 module scripts, inventory, dropped, and pickup.
Inventory → Dropped → Pickup → Inventory again
Inventory handles the inventory system and can also drop an item (think of selecting an item then right clicking outside your inventory in minecraft)
Dropped handles registering an item and animating it
Pickup is in charge of determining the distance of the player from each dropped object, if they’re close then they’ll pick it up (by adding to inventory)
I’m not experienced at module script hierarchy, are there any recommendations for designing this system, and should I adopt a certain hierarchy style I’m not aware of?
Currently, none of these scripts are classes. They consist of a initialization function (called from the local script) that activate input events. The rest of the module consists of a bunch of functions. Not sure if this is a good way to structure the code or if there is another standard practice.