hedgewars/GSHandlers.inc
changeset 8594 8946f98d09a0
parent 8592 bb724ef609db
child 8612 f7c194533d45
equal deleted inserted replaced
8592:bb724ef609db 8594:8946f98d09a0
  5089         end 
  5089         end 
  5090 *)
  5090 *)
  5091   end;
  5091   end;
  5092 end;
  5092 end;
  5093 
  5093 
  5094 
       
  5095 function isLandscapeEdge(weight:Longint):boolean;
       
  5096 begin
       
  5097     result := (weight < 8) and (weight >= 2);
       
  5098 end;
       
  5099 
       
  5100 function isLandscape(weight:Longint):boolean;
       
  5101 begin
       
  5102     result := weight < 2;
       
  5103 end;
       
  5104 
       
  5105 function isEmptySpace(weight:Longint):boolean;
       
  5106 begin
       
  5107     result := not isLandscape(weight) and not isLandscapeEdge(weight);
       
  5108 end;
       
  5109 
       
  5110 
       
  5111 function getPixelWeight(x, y:Longint): Longint;
       
  5112 var
       
  5113     i, j:Longint;
       
  5114 begin    
       
  5115     result := 0;
       
  5116     for i := x - 1 to x + 1 do
       
  5117         for j := y - 1 to y + 1 do 
       
  5118         begin
       
  5119         if (i < 0) or 
       
  5120            (i > LAND_WIDTH - 1) or 
       
  5121            (j < 0) or 
       
  5122            (j > LAND_HEIGHT -1) or 
       
  5123            ((Land[j, i] and $FF00) = 0) then
       
  5124            begin
       
  5125            result := result + 1;
       
  5126            end;
       
  5127         end;
       
  5128 end;
       
  5129 
  5094 
  5130 procedure doStepIceGun(Gear: PGear);
  5095 procedure doStepIceGun(Gear: PGear);
  5131 const iceWaitCollision:Longint = 0;
  5096 const iceWaitCollision:Longint = 0;
  5132 const iceCollideWithGround:Longint = 1;
  5097 const iceCollideWithGround:Longint = 1;
  5133 const iceWaitNextTarget:Longint = 2;
  5098 const iceWaitNextTarget:Longint = 2;