Welcome GuestLogin

Programming Games Wiki

RSS RSS

Search

»

Explore


Share




ARobots

RSS
Modified on 2011/10/28 10:33 by Administrator Categorized as Arena Games
Image
ARobots is a game played by up to six programs which control a battle robot. Programs are written in 8086 assembly language.

Table of Contents [Hide/Show]


   History
   Robots
   Arena
   Programming
   Example
   External Links


Edit

History

Anders Danielsson released ARobots as shareware in March 1992. AnDan Software relicensed ARobots as freeware in January 2000. ARobots is distributed as a closed source DOS binary.

Edit

Robots

Robots are damaged by collisions or when a missile explodes within 40m. A robot is destroyed when it reaches 100 damage. A robot's maximum speed is 100 (1m per second). It takes 1 second for a robot to accelerate 0.01m, decelerate 0.05m or rotate 10°.

Changing direction by 180° brings a robot to a dead stop. If the speed is above 50, changing direction more than 45° will bring a robot to a dead stop.

Missiles move at 10m per second, maximum range 500m. It takes 50 seconds before the robot is ready to fire another missile.

Edit

Arena

The arena is 1000×1000m with the origin at the bottom left. 0° is to the right, increasing anti-clockwise.

Image

Edit

Programming

A program controls the robot by calling functions via INT 0F2h. When calling the interrupt, AH should contain the function number:

  • AH = 00 - return the current position of the robot in BX, CX
  • AH = 01 - return damage sustained in AX and the timer in CX:BX
  • AH = 02 - return drive speed in BX and drive degrees in CX
  • AH = 03 - set drive speed from BX and drive degrees from CX
  • AH = 04 - scan for robots at CX degrees with BX resolution, return range in AX
  • AH = 05 - fire missile at CX degrees with BX range
  • AH = 06 - return a random number in AX

Programs start at address 0 and are allocated 8192 bytes of memory.

Edit

Example

; Wildfire

; set speed / angle

turn:   add di,100
        mov bx,100
        mov cx,di
        mov ah,3
        int 0F2h

; scan for opponent

seek:   mov dx,6
        mov bx,6
s:      mov cx,si
        mov ah,4
        int 0F2h
        cmp ax,500
        jc fire
        add si,12
        dec dx
        jne s
        jmp direct

; fire at opponent

fire:   xchg ax,bx
        mov ah,5
        int 0F2h

; avoid edge of arena

direct: mov ah,0
        int 0F2h
        cmp bx,100
        jc turn
        cmp bx,900
        jnc turn
        cmp cx,100
        jc turn
        cmp cx,900
        jnc turn
        jmp seek

Edit

External Links

  Name Size
- arena_arobots.png 4.37 KB
- arobots.jpg 8.95 KB