hedgewars/uGears.pas
changeset 5348 0bc81de36e08
parent 5319 51d8e4747876
child 5351 a4409b50bdc2
equal deleted inserted replaced
5345:3c5480e91951 5348:0bc81de36e08
   339                     DirAngle:= random * 360;
   339                     DirAngle:= random * 360;
   340                     dx.isNegative:= GetRandom(2) = 0;
   340                     dx.isNegative:= GetRandom(2) = 0;
   341                     dx.QWordValue:= GetRandom(100000000);
   341                     dx.QWordValue:= GetRandom(100000000);
   342                     dy.isNegative:= false;
   342                     dy.isNegative:= false;
   343                     dy.QWordValue:= GetRandom(70000000);
   343                     dy.QWordValue:= GetRandom(70000000);
       
   344                     State:= State or gstInvisible;
   344                     if GetRandom(2) = 0 then dx := -dx;
   345                     if GetRandom(2) = 0 then dx := -dx;
   345                     Health:= random(vobFrameTicks);
   346                     Health:= random(vobFrameTicks);
   346                     Timer:= random(vobFramesCount);
   347                     Timer:= random(vobFramesCount);
   347                     Angle:= (random(2) * 2 - 1) * (1 + random(10000)) * vobVelocity
   348                     Angle:= (random(2) * 2 - 1) * (1 + random(10000)) * vobVelocity
   348                     end
   349                     end
  1173     x, y: LongInt;
  1174     x, y: LongInt;
  1174 begin
  1175 begin
  1175 Gear:= GearsList;
  1176 Gear:= GearsList;
  1176 while Gear <> nil do
  1177 while Gear <> nil do
  1177     begin
  1178     begin
  1178     x:= hwRound(Gear^.X) + WorldDx;
  1179     if Gear^.State and gstInvisible = 0 then
  1179     y:= hwRound(Gear^.Y) + WorldDy;
  1180         begin
  1180     RenderGear(Gear, x, y);
  1181         x:= hwRound(Gear^.X) + WorldDx;
       
  1182         y:= hwRound(Gear^.Y) + WorldDy;
       
  1183         RenderGear(Gear, x, y);
       
  1184         end;
  1181     Gear:= Gear^.NextGear
  1185     Gear:= Gear^.NextGear
  1182     end;
  1186     end;
  1183 end;
  1187 end;
  1184 
  1188 
  1185 procedure FreeGearsList;
  1189 procedure FreeGearsList;