;Gladiator Brittany Sandvall 04/12/01 ; ;My program is based off of CIRCLES, which runs in circles, firing if ; the enemy is detected. ;My program, however, runs in circles and if the enemy is detected, the ; robot slows down and if not overheating, it fires two shots. ; If it is too hot, it does not fire. If when scanning, the ; enemy is not detected, it increases its turn rate and keeps ; scanning. #def turn_rate #def heat #def scanarc #def speed mov speed, 75 ;set turn rate to 4 deg mov turn_rate, 4 opo 13, 0 ;port 13 - set turret to 0 deg mov scanarc, 64 ;port 17 - set scan arc to 64 deg ipo 10, ax ;port 10 - get a random number cmp ax, -1 ;is it 0 or higher? ja !turn ;if so, turn xor ax, ax ;ax=0 sub ax, turn_rate ;ax=0-turn_rate mov turn_rate, ax ;turn_rate = ax (turn left) !turn opo 14, turn_rate ;port 14 - turn opo 11, 100 ;port 11 - throttle to 100% ipo 7, ax ;port 7 - scan, ax=range cmp ax, 1500 ;is enemy in range? ja !repeat ;if not then don't fire mov turn_rate, 1 shr scanarc, 1 ;narrow scanarc mov bx, scanarc mpy bx, @03 opo P_STEERING, bx ;center enemy or scanarc, 1 ;make sure scanarc >0 ipo p_heat, heat cmp heat, 200 ;check heat ja !turn opo 15 ;port 15 - fire opo 15 ;port 15 - fire !repeat mov turn_rate 8; ;set turn rate to 8 deg jmp !turn ;repeat loop #END