home *** CD-ROM | disk | FTP | other *** search
/ PC Format Collection 5 / PCFORMAT5.iso / ZIPS / CZONE.ZIP / CZONE / ROBOTS / AIMLESS.ROB < prev    next >
Encoding:
Text File  |  1993-12-14  |  816 b   |  31 lines

  1. { ****** AIMLESS ******}
  2. { This robot wanders around in a random direction (increments of 45'),
  3. { shooting at tanks if it  finds one.  It does not, however, lock onto a }
  4. { tank, making it relatively harmless and easy to beat. }
  5.  
  6.  
  7. REPEAT
  8.     {** Pick a random starting direction, in increments of 45' **}
  9.       a=RND(8)
  10.       a:=a*45
  11.       SHIELD OFF
  12.       RADAR a
  13.  
  14.       {** Did we spot a tank **}
  15.       IF OBJECT=TANK THEN
  16.             TURRET a            {** Yes, so turn gun towards it **}
  17.            FIRE DISTANCE    {** And blast the blighter **}
  18.       ELSE
  19.             {** Otherwise, if it's a missile then shield up for a while **}
  20.            IF OBJECT=MISSILE THEN
  21.                   DO 10
  22.                         SHIELD ON
  23.                   LOOP
  24.             ENDIF
  25.       ENDIF
  26.  
  27.       {** Turn to face the object and move off **}
  28.       ROTATE a
  29.       MOVE DISTANCE-20
  30. FOREVER
  31.