home *** CD-ROM | disk | FTP | other *** search
/ Revista CD Expert 51 / PCGamer51_17Demos.iso / games / colobotdemo / colobotdemo10e.exe / script / twasp2.txt < prev    next >
Text File  |  2001-06-21  |  759b  |  57 lines

  1. extern void object::Solution()
  2. {
  3.     
  4.     object    item;
  5.     float     angle;
  6.     
  7.     aim(0);
  8.     
  9.     while (true)
  10.     {
  11.         while(radar(AlienWasp, 0, 360, 0, 20) == null)
  12.         {
  13.             item = radar(AlienWasp);
  14.             turn(direction(item.position));
  15.             motor(1,1);
  16.             
  17.             jet(0);
  18.             if(position.z > item.position.z)
  19.             {
  20.                 jet(-0.3);
  21.             }
  22.             
  23.             if(position.z < item.position.z - 1)
  24.             {
  25.                 jet(0.3);
  26.             }
  27.             
  28.             wait(0.2);
  29.         }
  30.         item = radar(AlienWasp);
  31.         angle = direction(item.position);
  32.         turn(angle);
  33.         if (angle < 0)
  34.         {
  35.             motor(1,0.5);
  36.         }
  37.         else
  38.         {
  39.             motor(0.5,1);
  40.         }
  41.         
  42.         jet(0);
  43.         if(position.z > item.position.z)
  44.         {
  45.             jet(-0.3);
  46.         }
  47.         
  48.         if(position.z < item.position.z - 1)
  49.         {
  50.             jet(0.3);
  51.         }
  52.         
  53.         fire(1);
  54.     }
  55.     
  56. }
  57.