does anyone know how to make levels with random paths
for example http://www.coptergame.net/?
like how each time it's different
#define game_height 300
#define rand_range 15
#define tile_width 20
void
create_level ()
{
static int i;
static int slope;
static int offset;
i+=xvelocity;
if(i%(40)==0)
{
offset+=slope;
CreateActor("tile", "tilemask", "(none)", "(none)", x+width+tile_width, y+tile_width+offset, true);
CreateActor("tile", "tilemask", "(none)", "(none)", x+width+tile_width, y+game_height-tile_width+offset, true);
}
if(i>=width)
{
i=0;
slope=rand_range-rand(rand_range*2);
while(offset+game_height+slope*width/tile_width>height || offset+slope*width/tile_width<0)
{
slope=rand_range-rand(rand_range*2);
}
}
}
create_level();
xvelocity=5;
Users browsing this forum: No registered users and 1 guest