Main dude instance is created and disposed in each level - thus for saving permanent state, Inventory singleton is utilized (so far only for hearts/bombs/ropes/dollars).
I extended Inventory singleton to also save carried item types upon each GameLoopPlayingState exit and re-populate instances of them on each entry.
Inventory is cleaned upon entering GameLoopScoresState.
Main dude instance is created and disposed in each level - thus for saving permanent state,
Inventory
singleton is utilized (so far only for hearts/bombs/ropes/dollars).I extended
Inventory
singleton to also save carried item types upon eachGameLoopPlayingState
exit and re-populate instances of them on each entry.Inventory is cleaned upon entering
GameLoopScoresState
.