Tutorial: Making Checkpoints

Learn how to make certain types of games and use gameEditor.

Re: Tutorial: Making Checkpoints

Postby again » Mon Jun 27, 2011 9:29 pm

OK click on view

click on draw actor

click on add action

click on script editor

view.x=(players name).x-150;

Now the view should follow the actor , adjust the -150 to whereever is comfurtable for you.
Free windows mobile games like doodle jump and super mario bros
http://krenisis.freeforums.org/
again
 
Posts: 258
Joined: Wed Jan 19, 2011 7:06 pm
Score: 33 Give a positive score

Re: Tutorial: Making Checkpoints

Postby raminjoon » Wed Jul 20, 2011 1:23 am

hey bee ant I was wondering to know how you can save your game file. my game plot is where only one ball crosses my screen and after its off the screen I have another game file to be loaded in order for a ball with different color to come on screen. so how can I make a score archive which will save all game datas/levels into one archive .ged file. if I am not making sense plz reply for detail explanation.
raminjoon
 
Posts: 40
Joined: Tue Jul 05, 2011 5:34 am
Location: Denver, Co.
Score: 3 Give a positive score

Re: Tutorial: Making Checkpoints

Postby skydereign » Wed Jul 20, 2011 2:39 am

Why are you using multiple ged files for that? By the sound of it, you could either change the rgb values or perhaps the animation of the ball, and only use one file. But, to make the score transfer between files just create a variable, add it to a save group, and when you want to load the next game, you do something like this.
Code: Select all
saveVars("save_file", "group");
LoadGame("game_file");

And in some create event, put this.
Code: Select all
loadVars("save_file", "group");

One thing though is that every file needs to have that variable and have it in the group.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Tutorial: Making Checkpoints

Postby bilvyy » Wed Jul 20, 2011 3:16 am

The checkpoint works great, thank you! I do have a problem though. When my character walks through a door (which uses the DestroyActor event), he always appears at the checkpoint, instead of where I had connected the door to. I have a feeling this is because of the Create Actor event, so is there a way to fix it so I can keep the CreateActor event and still use Destroy/Create for my doors?
bilvyy
 
Posts: 23
Joined: Wed Feb 16, 2011 2:04 am
Score: 0 Give a positive score

Re: Tutorial: Making Checkpoints

Postby happyjustbecause » Wed Apr 18, 2012 8:37 pm

Hello,

I've been trying to add checkpoints into my game, and I came across this tutorial. I did most everything of what the tutorial said, I didn't add saveVars, or loadVars because I don't feel like having the game start at the checkpoint when replaying the game at this point. I also didn't add the save to group, so it shouldn't have problems. But as soon as my character dies, or is destroyed, gameEditor crashes. There must be something wrong with the PosX and PosY variables? Is there some reason it is crashing? Do I need to save the variables or something?
For small creatures such as we the vastness is bearable only through love.
-Carl Sagan

Night Knight Development Thread
User avatar
happyjustbecause
 
Posts: 267
Joined: Tue Jul 26, 2011 3:10 pm
Location: Frazier Park, Ca
Score: 15 Give a positive score

Re: Tutorial: Making Checkpoints

Postby skydereign » Wed Apr 18, 2012 9:09 pm

Nothing about this tutorial should cause a crash in your game. There must be something else that adding this effects in your game.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Tutorial: Making Checkpoints

Postby Hblade » Thu Apr 19, 2012 4:49 pm

Another good way is to make an array like this:
Code: Select all
//global code
int chkPos[2], viewPos[2];

This allows you to store the players/views X and Y. Like so:
Code: Select all
//player's draw actor
chkPos[0]=x;
chkPos[1]=y;
viewPos[0]=view.x;
viewPos[1]=view.y;


:) now when loading the checkpoint:
Code: Select all
x=chkPos[0];
y=chkPos[1];
view.x=viewPos[0];
view.y=viewPos[1];




This is how I would do it :)

Bee's method is more user friendly though :3
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Tutorial: Making Checkpoints

Postby happyjustbecause » Thu Apr 19, 2012 8:34 pm

Hblade wrote:Another good way is to make an array like this:
Code: Select all
//global code
int chkPos[2], viewPos[2];

This allows you to store the players/views X and Y. Like so:
Code: Select all
//player's draw actor
chkPos[0]=x;
chkPos[1]=y;
viewPos[0]=view.x;
viewPos[1]=view.y;


:) now when loading the checkpoint:
Code: Select all
x=chkPos[0];
y=chkPos[1];
view.x=viewPos[0];
view.y=viewPos[1];




This is how I would do it :)

Bee's method is more user friendly though :3


Hmm, I'll try that out, because I can't seem to prevent the crashing of gameEditor with the original method. Thanks both of you though!
For small creatures such as we the vastness is bearable only through love.
-Carl Sagan

Night Knight Development Thread
User avatar
happyjustbecause
 
Posts: 267
Joined: Tue Jul 26, 2011 3:10 pm
Location: Frazier Park, Ca
Score: 15 Give a positive score

Previous

Return to Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest