home *** CD-ROM | disk | FTP | other *** search
/ Más de 2,500 Juegos / CD1.iso / ZIPDAT / 0951 / 0951.ZIP / RAMMER.AT2 < prev    next >
Encoding:
Text File  |  1997-02-20  |  1.9 KB  |  54 lines

  1. ; RAMMER -  Robot that rams targets, sometimes driving backwards.
  2. ; Sample robot - Intended only to demonstrate backwards driving.
  3. ;
  4. ; Ed T. Toton III - 02/20/97
  5. ;
  6.  
  7. #def    speed
  8. #msg    Eat my shorts!
  9.  
  10.         opo     17      6       ; Scan arc is +/-6
  11.         out     13,     0       ; Aim turret forward.
  12.         mov     speed,  100     ; speed = 100%
  13.  
  14.         ipo     10,     ax      ; get random
  15.         cmp     ax,     0       ; 50% chance
  16.         jls     100
  17.  
  18.         out     13,     80h     ; Aim turret backwards.
  19.         mov     speed,  -100    ; Robot will go backwards at max (75)
  20.                                 ; (The -100 will be trunc'ed to -75
  21.                                 ; by the game engine, but if the game's
  22.                                 ; max backward speed ever gets changed,
  23.                                 ; the robot is already designed to as
  24.                                 ; fast as the game will allow).
  25.  
  26. :100                            ; begin main loop
  27.  
  28.         out     14,     -5      ; turn 5 degrees left
  29.         out     11,     speed   ; drive backwards at maximum speed!
  30.         in      7,      ax      ; scan
  31.         cmp     ax,     1500    ; find anything?
  32.         ja      100             ; if not, repeat
  33.  
  34.         mov     bx,     0       ; bx = 0
  35.  
  36. :101                            ; if so, do the following:
  37.  
  38.         ipo     10,     ax      ; get random number
  39.         cmp     ax,     4000h   ; 1/4 chance
  40.         jls     102
  41.         opo     15,     bx      ; fire!
  42. :102
  43.         ipo     8       bx      ; get accuracy setting from scan
  44.         mpy     bx,     3       ; enlarge it
  45.         out     14,     bx      ; turn! Keep him centered!
  46.  
  47.         in      7,      ax      ; scan
  48.         cmp     ax,     1500    ; still there?
  49.         jls     101             ; if so, scan again.
  50.  
  51.  
  52.         jmp     100             ; end main loop
  53.  
  54.