Page 1 of 1

Save the game progress?

PostPosted: Sun Jul 09, 2006 7:24 am
by cyber
Hi!

How I can give the possibility to save the game-progresses??

[NOT my project, but the user's progress] :)

PostPosted: Sun Jul 09, 2006 1:25 pm
by willg101
There is no way currently to directly export the user's exact progress in a game, but you can save health, items, x, y, or any other global variable with saveVars.

Code: Select all
//asuming all your variables are in a group "gameVar"
xpos_actor1=actor1.x;
xpos_actor2=actor2.x;
ypos_actor1=actor1.y;
ypos_actor2=actor2.y;
health=Health.textNumber; //in case your health meter is a text actor
saveVars("gamesave.sav","gameVar"); //the first argument is the file name, the second is the variable group that you want to save.


...Now, load those variables:
Code: Select all
loadVars("gamesave.sav","gameVar");
actor1.x=xpos_actor1;
actor2.x=xpos_actor2;
actor1.y=ypos_actor1;
actor2.y=ypos_actor2;
Health.textNumber=health;


Note that loading and saving variables are essentially the oppostie.

Well that's all for now, I'm off to church! 8)

PostPosted: Sun Jul 09, 2006 3:40 pm
by cyber
Thanks for the reply! :o