| Jedijds wrote: |
| How do I make a button that I can press and it will save where every thing is in the game? If I leave then come back or die in the game I would like a button I can then press that I can load the game I saved before. If any one knows how could you make a tutorial on YouTube? |
| Code: |
|
def save(): import GameLogic scn = GameLogic.getCurrentScene() for obj in scn.objects: #save to file obj.name # save to file obj.position, # save to file obj.rotation dev load(): import GameLogic scn = GameLogic.getCurrentScene() #open the file and load data into list for item in list: scn.objects[item.name].position = item.position scn.objects[item.name].rotation = item.rotation |