#msg Let's try this again ; Some Variables #def vel #def sdir #def health #def hot ; do some set up and get us moving mov ax 1 ; overburn on int 4 ; we like speed =) mov vel 100 ; set our velocity up out 11 vel ; a sitting duck is a dead duck, let's get moving mov sdir 64 ; direction to scan in out 13 sdir ; 90 degrees off to the right in 6 health ; what is our current armor level? mov hot 0 ; we are not overheated right now ;--[Main loop]--; :1000 ; Check if we've been hit. If so, take action. in 6 bx ; check armor level cmp bx health ; has it changed since last checked? je 5000 ; if so, we've been hit: out 11 vel ; run, then think out 14 64 ; take evasive action out 11 vel ; get the heck out of here :5000 ; if not, go here: mov health bx ; store health for next time ; Check if we've run into something. If so, take action. int 12 ; How many collisions have happened cmp fx 0 ; since last time? je 6000 ; If any: neg vel ; flip our direction out 11 vel ; and head the other way int 13 ; and reset the collision counter in 6 bx ; we need to store armor level mov health bx ; so we don't think that we were shot :6000 ; if not, keep going on ; See what mode we're in and kill or scan apropriately. :6500 ; Start of the scan area in 7 bx ; look for our enemy cmp bx MAXINT ; see if there's something there je 7000 ; If so: ; Kill Mode!!! mov ax 1 ; turning keepshift on int 3 ; so we won't lose our target in 8 dx ; what's the error? shl dx 1 ; multiply this by two **try this both ways** cmp hot 0 ; is our engine too hot? jne 7500 ; If so, don't fire out 15 dx ; fire at the sucker :7500 out 12 dx ; try to track the enemy jmp 8000 ; skip the flip :7000 ; If there are no enemies: xor ax ax ; turn keepshift off int 3 ; no need for it now neg sdir ; Flip the scan to the other direction out 13 sdir ; set the new scan direction up :8000 ; Pretty much the end of the line ; Watch out for overheating in 2 bx ; What is our current temp? cmp bx 325 ; is it hotter than 375? jls 9000 ; If so: mov hot 1 ; it is too hot xor ax ax ; off with the overburn int 4 ; bye bye jmp 10000 ; don't unset it :9000 ; If it's cool enough: xor hot hot ; it's not too hot mov ax 1 ; turn it on baby int 4 ; overburn!!! :10000 jmp 1000 ; start all over again