saving a game

is there any way to save a game in the middle of the game and then replay it from where we left it with all textures and models in the same place?

sure. technique depends on the game.

It is a breakout game in 3d with ball pad and bricks/blocks. can you explain how to save the game and resume it.

leo

im not sure if this works (without workarounds) in panda but you should have a look at the pickle/cPickle module for python (included)

As I understand it, the way one saves a game is to write all of the dynamic variables to a text file. (You can even encode it and give a different extension so people don’t try and cheat)

What is a Dynamic Variable?
Basically a variable that would change throughout the game and would need to be loaded. I.E. The rate at which your bricks move/accelerate would not change. However; their position, current velocity, orientation would change. Also the score, lives remaining etc. Those that have changed and would be different need to be saved!

Then when you load a game you read the file, assign all the variables in your game to the ones in the file and whala! You have just loaded a game.

That is the theory behind it anyways!!! If you have experience in Python this should be no problem at all!