hedgewars/uVisualGears.pas
changeset 5151 cbadb9fa52fc
parent 5121 2d34ec60992c
child 5179 8d64dcb566ea
equal deleted inserted replaced
5150:63ad8a648afd 5151:cbadb9fa52fc
   181                 end;
   181                 end;
   182     vgtExplPart,
   182     vgtExplPart,
   183     vgtExplPart2: begin
   183     vgtExplPart2: begin
   184                 t:= random(1024);
   184                 t:= random(1024);
   185                 sp:= 0.001 * (random(95) + 70);
   185                 sp:= 0.001 * (random(95) + 70);
   186                 dx:= AngleSin(t).QWordValue/4294967296 * sp;
   186                 dx:= hwFloat2Float(AngleSin(t)) * sp;
   187                 dy:= AngleCos(t).QWordValue/4294967296 * sp;
   187                 dy:= hwFloat2Float(AngleCos(t)) * sp;
   188                 if random(2) = 0 then dx := -dx;
   188                 if random(2) = 0 then dx := -dx;
   189                 if random(2) = 0 then dy := -dy;
   189                 if random(2) = 0 then dy := -dy;
   190                 Frame:= 7 - random(3);
   190                 Frame:= 7 - random(3);
   191                 FrameTicks:= cExplFrameTicks
   191                 FrameTicks:= cExplFrameTicks
   192                 end;
   192                 end;
   193         vgtFire: begin
   193         vgtFire: begin
   194                 t:= random(1024);
   194                 t:= random(1024);
   195                 sp:= 0.001 * (random(85) + 95);
   195                 sp:= 0.001 * (random(85) + 95);
   196                 dx:= AngleSin(t).QWordValue/4294967296 * sp;
   196                 dx:= hwFloat2Float(AngleSin(t)) * sp;
   197                 dy:= AngleCos(t).QWordValue/4294967296 * sp;
   197                 dy:= hwFloat2Float(AngleCos(t)) * sp;
   198                 if random(2) = 0 then dx := -dx;
   198                 if random(2) = 0 then dx := -dx;
   199                 if random(2) = 0 then dy := -dy;
   199                 if random(2) = 0 then dy := -dy;
   200                 FrameTicks:= 650 + random(250);
   200                 FrameTicks:= 650 + random(250);
   201                 Frame:= random(8)
   201                 Frame:= random(8)
   202                 end;
   202                 end;
   203          vgtEgg: begin
   203          vgtEgg: begin
   204                 t:= random(1024);
   204                 t:= random(1024);
   205                 sp:= 0.001 * (random(85) + 95);
   205                 sp:= 0.001 * (random(85) + 95);
   206                 dx:= AngleSin(t).QWordValue/4294967296 * sp;
   206                 dx:= hwFloat2Float(AngleSin(t)) * sp;
   207                 dy:= AngleCos(t).QWordValue/4294967296 * sp;
   207                 dy:= hwFloat2Float(AngleCos(t)) * sp;
   208                 if random(2) = 0 then dx := -dx;
   208                 if random(2) = 0 then dx := -dx;
   209                 if random(2) = 0 then dy := -dy;
   209                 if random(2) = 0 then dy := -dy;
   210                 FrameTicks:= 650 + random(250);
   210                 FrameTicks:= 650 + random(250);
   211                 Frame:= 1
   211                 Frame:= 1
   212                 end;
   212                 end;
   282                 angle:= random(360);
   282                 angle:= random(360);
   283                 end;
   283                 end;
   284      vgtFeather: begin
   284      vgtFeather: begin
   285                 t:= random(1024);
   285                 t:= random(1024);
   286                 sp:= 0.001 * (random(85) + 95);
   286                 sp:= 0.001 * (random(85) + 95);
   287                 dx:= AngleSin(t).QWordValue/4294967296 * sp;
   287                 dx:= hwFloat2Float(AngleSin(t)) * sp;
   288                 dy:= AngleCos(t).QWordValue/4294967296 * sp;
   288                 dy:= hwFloat2Float(AngleCos(t)) * sp;
   289                 if random(2) = 0 then dx := -dx;
   289                 if random(2) = 0 then dx := -dx;
   290                 if random(2) = 0 then dy := -dy;
   290                 if random(2) = 0 then dy := -dy;
   291                 FrameTicks:= 650 + random(250);
   291                 FrameTicks:= 650 + random(250);
   292                 Frame:= 1
   292                 Frame:= 1
   293                 end;
   293                 end;
   307                 end;
   307                 end;
   308       vgtChunk: begin
   308       vgtChunk: begin
   309                 gear^.Frame:= random(4);
   309                 gear^.Frame:= random(4);
   310                 t:= random(1024);
   310                 t:= random(1024);
   311                 sp:= 0.001 * (random(85) + 47);
   311                 sp:= 0.001 * (random(85) + 47);
   312                 dx:= AngleSin(t).QWordValue/4294967296 * sp;
   312                 dx:= hwFloat2Float(AngleSin(t)) * sp;
   313                 dy:= AngleCos(t).QWordValue/4294967296 * sp * -2;
   313                 dy:= hwFloat2Float(AngleCos(t)) * sp * -2;
   314                 if random(2) = 0 then dx := -dx;
   314                 if random(2) = 0 then dx := -dx;
   315                 end;
   315                 end;
   316       vgtNote: begin
   316       vgtNote: begin
   317                 dx:= 0.005 * (random(15) + 10);
   317                 dx:= 0.005 * (random(15) + 10);
   318                 dy:= -0.001 * (random(40) + 20);
   318                 dy:= -0.001 * (random(40) + 20);