Save the game progress?

Non-platform specific questions.

Save the game progress?

Postby cyber » Sun Jul 09, 2006 7:24 am

Hi!

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

[NOT my project, but the user's progress] :)
User avatar
cyber
 
Posts: 2
Joined: Sun Jul 09, 2006 5:54 am
Location: North Italy
Score: 0 Give a positive score

Postby willg101 » Sun Jul 09, 2006 1:25 pm

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)
http://www.wish-games.com
Old betas now available!!
User avatar
willg101
 
Posts: 473
Joined: Thu Dec 16, 2004 12:08 am
Location: West Michigan
Score: 5 Give a positive score

Postby cyber » Sun Jul 09, 2006 3:40 pm

Thanks for the reply! :o
User avatar
cyber
 
Posts: 2
Joined: Sun Jul 09, 2006 5:54 am
Location: North Italy
Score: 0 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 0 guests