hedgewars/uAIAmmoTests.pas
changeset 7424 fe0f07667f24
parent 7416 2f2f78fc65a3
child 7427 48f9d53c844a
equal deleted inserted replaced
7421:76772043ba7f 7424:fe0f07667f24
   707     ap.Time:= 0;
   707     ap.Time:= 0;
   708     ap.Power:= 1;
   708     ap.Power:= 1;
   709     x:= hwRound(Me^.X);
   709     x:= hwRound(Me^.X);
   710     y:= hwRound(Me^.Y);
   710     y:= hwRound(Me^.Y);
   711 
   711 
   712     a:= 0;
   712     a:= cMaxAngle div 2;
   713     valueResult:= 0;
   713     valueResult:= 0;
   714 
   714 
   715     while a <= cMaxAngle div 2 do
   715     while a >= 0 do
   716         begin
   716         begin
   717         dx:= sin(a / cMaxAngle * pi) * 0.5;
   717         dx:= sin(a / cMaxAngle * pi) * 0.5;
   718         dy:= cos(a / cMaxAngle * pi) * 0.5;
   718         dy:= cos(a / cMaxAngle * pi) * 0.5;
   719 
   719 
   720         v1:= RateShove(Me, x - 10, y
   720         v1:= RateShove(Me, x - 10, y
   734                 begin
   734                 begin
   735                 ap.Angle:= -a;
   735                 ap.Angle:= -a;
   736                 valueResult:= v1
   736                 valueResult:= v1
   737                 end;
   737                 end;
   738 
   738 
   739         a:= a + 15 + random(cMaxAngle div 16)
   739         a:= a - 15 - random(cMaxAngle div 16)
   740         end;
   740         end;
   741    
   741    
   742     if valueResult <= 0 then
   742     if valueResult <= 0 then
   743         valueResult:= BadTurn;
   743         valueResult:= BadTurn;
   744 
   744