home *** CD-ROM | disk | FTP | other *** search
/ c't freeware shareware 2001 January / CT_SW0101.ISO / pc / software / spiele / strat / bbots.tgz / battlebots-1.0.2-static.tar / teamtracker.basm < prev    next >
Text File  |  2001-03-18  |  2KB  |  81 lines

  1. RAM: 0
  2.  
  3. DEVICE: 1 1 0
  4. DEVICE: 2 2 0
  5. DEVICE: 3 2 0
  6. DEVICE: 4 2 0
  7. DEVICE: 5 4 0
  8. DEVICE: 6 3 0
  9. DEVICE: 5 4 0
  10. DEVICE: 7 4 0
  11. DEVICE: 13 2 0
  12. DEVICE: 7 4 0
  13. DEVICE: 12 4 0
  14. DEVICE: 0 0 0
  15. DEVICE: 0 0 0
  16. DEVICE: 0 0 0
  17. DEVICE: 0 0 0
  18. DEVICE: 0 0 0
  19. DEVICE: 0 0 0
  20. DEVICE: 0 0 0
  21. DEVICE: 0 0 0
  22. DEVICE: 0 0 0
  23. DEVICE: 0 0 0
  24. DEVICE: 0 0 0
  25. DEVICE: 0 0 0
  26. DEVICE: 0 0 0
  27. DEVICE: 0 0 0
  28. DEVICE: 0 0 0
  29. DEVICE: 0 0 0
  30. DEVICE: 0 0 0
  31. DEVICE: 0 0 0
  32. DEVICE: 0 0 0
  33. DEVICE: 0 0 0
  34. DEVICE: 0 0 0
  35.  
  36. ;It uses the scanner not only to find the enemy
  37. ;but it also uses the "offset" feature in the scanner
  38. ;to determine if he should turn into any direction in
  39. ;order to keep the target within the scanner
  40.  
  41. ;This version adds some code to make
  42. ;the bot to only follow and shoot at enemies
  43. ;(For team battle)
  44.  
  45. :start
  46. out Shield0_SetShieldEnabled,1      ; Up with shield
  47. out Scanner0_SetScanWidth,32    ; scan-arc of 32 bot grades
  48. in dx,CPU0_GetMyTeam ;Team number in dx
  49. out Scanner0_SelectReturn,0 ;Make scanner return team...
  50.  
  51. :loop
  52. out Engine0_SetThrust,75      ; 75% speed ahead
  53.  
  54. out Scanner0_Scan,1      ; emit scan pulse
  55. hwait
  56.  
  57. in ax, Scanner0_GetScanDistance     ; get scandist
  58. cmp ax,60000
  59. jae next
  60. in ax,Scanner0_GetScanInfo ;other bots team into ax
  61. cmp ax,dx
  62. jz next ;If same team, skip
  63. in ax, Scanner0_GetScanAccuracy     ; get the offset
  64. cmp ax,2
  65. jz shoot      ; it is straight ahead
  66. jae turnright ;it is to our right
  67.  
  68. :turnleft       ;else it is to our left¥
  69. out Steering0_AdjustWantedDir, 1012
  70. jmp shoot
  71.  
  72. :turnright
  73. out Steering0_AdjustWantedDir,12
  74.  
  75. :shoot
  76. out Plasmagun0_Shoot,1
  77. jmp loop
  78.  
  79. :next
  80. out Steering0_AdjustWantedDir,6    ; nothing found, turn right
  81. jmp loop