Page 1 of 1

From Newbie: How to use Differnet GED for different Levels

PostPosted: Mon Apr 16, 2012 1:34 pm
by ggesterGamePro99
Total newbie. Got game-editor in the weekend. Managed to finally make a walking character.
i've done little bit game programming before in java so i know alittle bit about game progoraming.

So, I read in the manual that you can use diferent GED files in order to move to different levels. And in each GED you create a different level.

My question is, how do you set which GED is the first level.
and how within that first level...how do you code or how do you do it so that after you accomplish a certain thing, then you move into a different GED file(different level)

Re: From Newbie: How to use Differnet GED for different Leve

PostPosted: Mon Apr 16, 2012 4:11 pm
by skydereign
Ok, using multiple geds for different levels is pretty simple. To jump between ged files, all you need to do is use LoadGame.
Code: Select all
LoadGame("level_01.ged");

That code would try to load the level_01 game file. Each game file can be run independently (since they are currently .ged files) so whichever file you happen to be editing is technically the first level. But, when you export the games, only the first ged file should be exported as an exe. Normally this would be the menu for your game. To start actually playing your game, you would then jump to another file (your real first level).

play_game -> Mouse Button Down -> Script Editor
Code: Select all
LoadGame("level_00.ged"); // this will jump you to the first level when you press play


Now one very important thing to know when starting out with gE is how events work. Everything is based around events. So if you want something to happen, you just need to find an event that triggers at that time. For instance if you want the player to move when you press right, then you should add a keydown event. In your case you are asking how to make it so you can move to the next level.

If we were dealing with mario, then when he collides with the flag, you would want it to load the next level. So, you can add a collision event with the flag, that uses the LoadGame code.

Re: From Newbie: How to use Differnet GED for different Leve

PostPosted: Mon Apr 16, 2012 4:15 pm
by ggesterGamePro99
Aweeeesome.

I'm gonna do great games :)