;
; NorthBot - Bounces up and down the screen
;
; by Philip Taylor
;
; Visit AUWSAAGCATR at www.zaynar.demon.co.uk/atr


#def direction
#def north
#def speed

     mov        speed,  100
     opo        11,     speed           ; full speed ahead!
     ipo        3,      direction       ; direction = compass heading
     mov        north,  0               ; north = 0 degrees
     sub        north,  direction       ; north = north - direction
     opo        14,     north           ; turn to north

:1
     int        12                      ; fx = number of collisions
     cmp        fx,     0               ;
     jne        5                       ; jump to 10 it collisions <> 0
     jmp        1

:5
     int        13                      ; reset collisions to 0
     neg        speed                   ; negate direction (frwrds/bckwrds)
     opo        11,     speed           ; set new speed
     jmp        1                       ; jump to 1


#END
