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

  1. ;
  2. ; TRACKER - Scans with sonar and uses interrupts to aim at it.
  3. ;                                 Ed T. Toton III    02/10/97
  4.  
  5.  
  6.         opo     p_throttle, 50  ; throttle to 50%
  7. :1
  8.         ipo     p_sonar,ax      ; get heading to nearest enemy
  9.         cmp     ax,     0       ; check sonar result
  10.         jls     3               ; if under 0, goto 3
  11.         gsb     2000            ; turn to that absolute heading
  12.         opo     15              ; fire!
  13.  
  14. :2
  15.         opo     p_throttle, 50  ; throttle to 50%
  16.  
  17.         ipo     2,      bx      ; Get heat into BX
  18.         cmp     bx,     200     ; is it over 200?
  19.         ja      1000            ; if so, let's cool down.
  20.  
  21.         jmp     1               ; repeat!
  22.  
  23. :3
  24.         opo     p_throttle, 100 ; throttle to 50%
  25.         opo     p_steering, 16  ; turn
  26.         jmp     1
  27.  
  28. ;heat handler
  29. :1000
  30.         ; evasive maneuvers!
  31.         opo     14,     8       ; turn 8 degrees to the right.
  32.         opo     11      100     ; throttle up to 100%
  33.  
  34.         ;check heat again
  35.         ipo     2,      bx      ; check heat
  36.         cmp     bx,     100     ; over 100?
  37.         ja      1000            ; if so keep scanning heat
  38.  
  39.         jmp     1               ; feeling better, let's fight!
  40.  
  41.  
  42. ;course-setting subroutine
  43. ;set course to heading in AX.
  44. :2000
  45.         mov     bx,     @1      ; get current course-setting
  46.         sub     ax,     bx      ; get number of degrees to turn.
  47.         opo     14,     ax      ; turn!
  48.  
  49.         ret
  50.