Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
基本上,从离开系统继续......有点像任何游戏。到目前为止,我的想法是将某些变量保存到一个文本文件中,如名称、健康、xp 等,并有一个位置变量来确定玩家在游戏中的位置,并将作为从左开始的继续。有没有更简单的方法来做这件事?
将所有这些信息保存在某种对象中并腌制它。https://docs.python.org/2/library/pickle.html
您可以使用pickle或json或xml。另请参阅此问题。或者这个。或者只是谷歌数据持久性。