pickle - Python - where to initialize a player inventory? -
i'm having bit of problem in python. it's not syntax or but, making text rpg. have save/load feature within game using pickle. works fine. problem when load game, inventory variable set defined in init of main class. this:
class main(): def __init__(self): self.inventory = [] and load command in main class well. reason when load variables pickle, resets inventory whatever set in main class. how can stop this?
Comments
Post a Comment