home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2001 November / Gamestar_34_2001-11_cd1.bin / DEMA / colobotdemoe.exe / script / titan2.txt < prev    next >
Text File  |  2001-07-27  |  825b  |  25 lines

  1. extern void object::CollectTitanium2()
  2. {
  3.     // 1) Variable definition.
  4.     object  item;            // info. about objects
  5.     
  6.     // 2) Go to the titanium ore and grab it.
  7.     item = radar(TitaniumOre);// look for titanium ore
  8.     goto(item.position);     // go to the position
  9.     grab();                  // grab the titanium
  10.     
  11.     // 3) Go to the converter and drop it.
  12.     item = radar(Converter); // look for converter
  13.     goto(item.position);     // go to the position
  14.     drop();                  // drop the titanium
  15.     move(-2.5);              // step back 2.5 m
  16.     
  17.     // 4) If power cell half empty, recharges.
  18.     if ( energyCell.energyLevel < 0.5 )
  19.     {                               // if so:
  20.         item = radar(PowerStation); // look for station
  21.         goto(item.position);        // go there
  22.         wait(5);                    // wait
  23.     }
  24. }
  25.