[英]In python, how would I go about creating a save system for a text adventure?
Basically, a continue from left off system... kinda like any game has. 从根本上说,这是一个从停滞状态继续的系统……有点像任何游戏一样。 So far the idea I got going is to save the certain variables into a text file like name, health, xp, etc. and have a location variable that determines where the player is in the game and will act as the continue from left off.
到目前为止,我的想法是将某些变量保存到文本文件中,例如名称,运行状况,xp等,并具有一个位置变量,该变量确定玩家在游戏中的位置,并从头开始。 Is there a simpler way about going about doing this?
有没有更简单的方法来做到这一点?
Save all this information in some sort of object and pickle it. 将所有这些信息保存在某种对象中并使其腌制。 https://docs.python.org/2/library/pickle.html
https://docs.python.org/2/library/pickle.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.