- Jan 22, 2019
- 40
- 86
I am new coding and I'm still learning about it. There is a problem with saving the stats data in my game. My game is running without a problem but every time I turn off the game and load the saved file, my character stats data is set back to 0. Here is the code:
I have search about it online and I think it may have something to do with the "default" and "$" thing, but I can't figure out how to make it right. Please give me some advice. Thanks.
Python:
init python:
class Chara(object):
def __init__(self, name, love):
self.name = name
self.love = love
STATS = [],
t = 0
while t < 50:
STATS.append(Chara("none", 0))
t += 1
label variables:
$ STATS[0] = Chara("Laura", 1)