hedgewars/uAIAmmoTests.pas
changeset 7486 f3a13da9fa4e
parent 7474 bbecb1b4f59b
child 7501 1763dc3bc9b7
equal deleted inserted replaced
7483:d479b98d38f7 7486:f3a13da9fa4e
   874         trackFall:= 0
   874         trackFall:= 0
   875     else
   875     else
   876         exit(BadTurn);
   876         exit(BadTurn);
   877         
   877         
   878     valueResult:= 0;
   878     valueResult:= 0;
       
   879     v:= 0;
   879 
   880 
   880     x:= hwFloat2Float(Me^.X);
   881     x:= hwFloat2Float(Me^.X);
   881     y:= hwFloat2Float(Me^.Y);
   882     y:= hwFloat2Float(Me^.Y);
   882     d:= sqrt(sqr(Targ.X - x) + sqr(Targ.Y - y));
   883     d:= sqrt(sqr(Targ.X - x) + sqr(Targ.Y - y));
   883     if d = 0 then
   884     if d < 10 then
   884         begin
   885         begin
   885         dx:= 0;
   886         dx:= 0;
   886         dy:= 8;
   887         dy:= 8;
   887         ap.Angle:= 2048
   888         ap.Angle:= 2048
   888         end
   889         end
   907         x:= x + dx;
   908         x:= x + dx;
   908         y:= y + dy;
   909         y:= y + dy;
   909         end;
   910         end;
   910     if dx = 0 then
   911     if dx = 0 then
   911         begin
   912         begin
   912         v:= 0;
       
   913         x:= hwFloat2Float(Me^.X);
   913         x:= hwFloat2Float(Me^.X);
   914         y:= hwFloat2Float(Me^.Y);
   914         y:= hwFloat2Float(Me^.Y);
   915         tx:= trunc(x);
   915         tx:= trunc(x);
   916         RateShove(Me, tx, trunc(y)
   916         v:= RateShove(Me, tx, trunc(y)
   917             , 30, 30, 25
   917                 , 30, 30, 25
   918             , -cx, -0.9, trackFall);
   918                 , -cx, -0.9, trackFall);
   919         for i:= 1 to 512 div step - 2 do
   919         for i:= 1 to 512 div step - 2 do
   920             begin
   920             begin
   921             y:= y + dy;
   921             y:= y + dy;
   922             v:= v + 
   922             v:= v + 
   923                 RateShove(Me, tx, trunc(y)
   923                 RateShove(Me, tx, trunc(y)