hedgewars/uLandGenMaze.pas
changeset 10477 b219c5a2317f
parent 10389 2f5941a05656
child 10494 0eb97cf4c78e
equal deleted inserted replaced
10476:e40021c61cfe 10477:b219c5a2317f
     6 
     6 
     7 procedure GenMaze;
     7 procedure GenMaze;
     8 
     8 
     9 implementation
     9 implementation
    10 
    10 
    11 uses uRandom, uLandOutline, uLandTemplates, uVariables, uFloat, uConsts, uLandGenTemplateBased;
    11 uses uRandom, uLandOutline, uLandTemplates, uVariables, uFloat, uConsts, uLandGenTemplateBased, uUtils;
    12 
    12 
    13 type direction = record x, y: LongInt; end;
    13 type direction = record x, y: LongInt; end;
    14 const DIR_N: direction = (x: 0; y: -1);
    14 const DIR_N: direction = (x: 0; y: -1);
    15     DIR_E: direction = (x: 1; y: 0);
    15     DIR_E: direction = (x: 1; y: 0);
    16     DIR_S: direction = (x: 0; y: 1);
    16     DIR_S: direction = (x: 0; y: 1);
   315 begin
   315 begin
   316 case cTemplateFilter of
   316 case cTemplateFilter of
   317     0: begin
   317     0: begin
   318         cellsize := small_cell_size;
   318         cellsize := small_cell_size;
   319         maze_inverted := false;
   319         maze_inverted := false;
       
   320         minDistance:= max(cFeatureSize*8,32);
   320     end;
   321     end;
   321     1: begin
   322     1: begin
   322         cellsize := medium_cell_size;
   323         cellsize := medium_cell_size;
       
   324         minDistance:= max(cFeatureSize*6,20);
   323         maze_inverted := false;
   325         maze_inverted := false;
   324     end;
   326     end;
   325     2: begin
   327     2: begin
   326         cellsize := large_cell_size;
   328         cellsize := large_cell_size;
       
   329         minDistance:= max(cFeatureSize*5,12);
   327         maze_inverted := false;
   330         maze_inverted := false;
   328     end;
   331     end;
   329     3: begin
   332     3: begin
   330         cellsize := small_cell_size;
   333         cellsize := small_cell_size;
       
   334         minDistance:= max(cFeatureSize*8,32);
   331         maze_inverted := true;
   335         maze_inverted := true;
   332     end;
   336     end;
   333     4: begin
   337     4: begin
   334         cellsize := medium_cell_size;
   338         cellsize := medium_cell_size;
       
   339         minDistance:= max(cFeatureSize*6,20);
   335         maze_inverted := true;
   340         maze_inverted := true;
   336     end;
   341     end;
   337     5: begin
   342     5: begin
   338         cellsize := large_cell_size;
   343         cellsize := large_cell_size;
       
   344         minDistance:= max(cFeatureSize*5,12);
   339         maze_inverted := true;
   345         maze_inverted := true;
   340     end;
   346     end;
   341 end;
   347 end;
   342 
   348 
   343 num_cells_x := LAND_WIDTH div cellsize;
   349 num_cells_x := LAND_WIDTH div cellsize;