Amos Professional Manual  Contents  Index

Blitter Objects


General Bob Commands

BOB OFF
instruction: remove a Bob from display
Bob Off
Bob Off number

Use this command to remove all Bobs from the screen simultaneously. If a Bob number is specified, only that Bob will be extinguished. For example:

X> Bob Off 1: Rem Remove Bob1 only
   Bob Off : Rem Remove all Bobs from screen

The BOB OFF instruction also turns off any animation or collision routines associated with these Bobs.

X BOB
function: get x-coordinate of a Bob
x-coordinate=X Bob(number)

Y BOB
function: get y-coordinate of a Bob
y-coordinate=Y Bob(number)

It is not difficult to keep track of Bobs under normal circumstances, but if Bobs are moved with AMAL, their coordinates can vary unpredictably. In which case, the X BOB and Y BOB functions may be used to get a snapshot of their current position, by returning the screen coordinates of your selected Bob. Specify the number of the chosen Bob on screen, and the appropriate coordinate will be returned, as measured from the top left-hand corner of the screen to the hot spot of the current image. For example:

E> Load "AMOSPro_Tutorial:Objects/Bobs.abk"
   Curs Off : Cls 0: Rem Set up screen
   Flash Off : Get Bob Palette : Rem Grab Bob colours from image bank
   Double Buffer : Rem Engage double buffering
   Autoback 1: Rem Engage fast drawing mode
   Do
    Rem Move Bob1 with mouse
    Rem Convert hardware coords to screen coords
    Bob 1,X Screen(X Mouse),Y Screen(Y Mouse),1
    Rem Print new location on screen
    Locate 0,0 : Print X Bob(1);" ";Y Bob(1);" ";
   Loop
Back    Next
07.02.03