I’m trying to create a program that moves a little man forward by walking or running etc.
I need to be able to save the state of the little man and load it at any given time and I have no idea how to do this. Could anyone please help me get the ball rolling?
I’m trying to create a program that moves a little man forward by walking
Share
You will probably have the state (the position of the character, maybe something else) stored in some sort of Python data structures. You could create a file storing this information. The most obvious ways are:
pickleto dump your Python objects to a file directly. You will then read them usingpickle.loadand won’t have to bother parsing the file.