Given how dungeonAdventure was basically a whole bunch of functions calling each other (placed in no particular order), I finally split the functions up into files according to their purpose:
init.js -- this is the global variables and start_game(), as well as the on_load event, etc
world.js -- this handles movement in the world, any functions about refreshing world html, etc
inventory.js -- this handles the inventory functions (equip, unequip, display html)
spelltree.js -- just the html for the spell tree (to unclutter world.js)
devutils.js -- for functions that only are used for our dev purposes
tutorial.js -- for the tutorialStart function
Going Forward
These aren't hard lines, some functions may get shifted again, but for now, I think this handles a large portion of the divide we needed / the compartmentalization.
We may want to consider removing the large number of global variables / trimming init.js (through things such as #26 ) but that is future work
Its time to break up dungeonAdventure.js 😢
Fixes #114
How Done
Given how dungeonAdventure was basically a whole bunch of functions calling each other (placed in no particular order), I finally split the functions up into files according to their purpose:
Going Forward
These aren't hard lines, some functions may get shifted again, but for now, I think this handles a large portion of the divide we needed / the compartmentalization.
We may want to consider removing the large number of global variables / trimming init.js (through things such as #26 ) but that is future work