whats the script editor code for saving
Posted: Sun Jul 11, 2010 8:09 am
Does anyone know how I can make a level checkpoint save in a game?
Game Editor discussion board
http://game-editor.com/forum/
PosX=x; //assign the x position
PosY=y; //assign the y position
saveVars("YourDataFileName.dat","data"); //save your data into a file
CreateActor("YourPlayerName", "YourPlayerAnimation", "(none)", "(none)", PosX, PosY, true); //create your player to the checkpoint location
view.x=PosX-320; //assign the view x position
view.y=PosY-240; //assign the view y position
loadVars("YourDataFileName.dat", "data"); //load your saved data from file
YourPlayerName.x=PosX;
YourPlayerName.y=PosY;
view.x=PosX-320;
view.y=PosY-240;
Camper1995 wrote:Thats one way to make if you want your game be loaded when you start new one
Bee-Ant wrote:When your player die, and you want to recreate your player to the checkpoint location, for instance you want to directly create the player just after he's died...
playerx=player.x;
playery=player.y
player.x=playerx;
player.y=playery;
px = player.x;
py = player.y;
vx = view.x;
vy = view.y;
if (player_hp<=0)
{
x = px;
y = py;
view.x = vx;
view.y = vy;
player_hp = player_maxhp
}
savvy wrote:if he/she