this example shows how to make a level loading from external file and custom levels.
-all maps are 8x5 (you can change it in the source code, global->vars.) world[x][y]
-maplist must be saved in "maps.txt" file.
-maximum 10 maps in maplist. you can change this value in the view->create actor->script editor.
for(i=0;i<10;i++) //<<==Change this
{
fscanf(maps,"%s\n",mapname[i]);
}
-Dummy map:
0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,
0 - nothing
1 - wall
2 - guy*
3 - portal 2 the next level*
*-must be 1 on each level
-you can add a new level actors and objects in global->creator:
example:
if(world[i][j]==4)
{
CreateActor("wall2", "wall2", "(none)", "(none)", mapX, mapY, false);
{
of course, u must create an "wall2" actor with anim. name "wall2". and don't forget to add these
objects to global->Destroyer.
...and don't laugh about the hero name...