Amos Professional Manual  Contents  Index

AMAL


Remember to call DOUBLE BUFFER during the initialisation procedure, to prevent unwanted flickers when your Bobs are moved.

The same channel can be used for STOS animations and AMAL programs, so it is easy to extend your routines once they have been successfully converted from STOS to AMOS Professional. The order of execution is AMAL ... MOVE X ... MOVE Y ... ANIM.

STOS compatibility is featured in the following ready-made demonstration program:

LD> Load "AMOSPro Tutorial:Tutorials/AMAL/AMAL_5.AMOS"

Here is the entire STOS-compatible range of commands.

MOVE X
instruction: move a Sprite horizontally
Move X number,"(speed,step,count)... (speed,step,count)L"
Move X number,"(speed,step,count)Enumber"

The MOVE X command defines a list of horizontal movements to be performed on the animation channel specified by the given number. This number can range from 0 to 15, and refers to an animation sequence for an Object already assigned by the CHANNEL command. The number is followed by a "movement string" containing a series of instructions which control the speed and direction of the Object. These movement commands are enclosed by brackets, and are entered as the following three parameters, separated by commas.

The speed parameter sets a delay between each step of the movement, given in 50ths of a second. Speed can vary from a value of 1 for very fast, all the way to 32767 for incredibly slow. This is followed by a step value, setting the number of pixels the Object is to be moved during each operation. A positive value moves the Object to the right, and a negative number to the left. The apparent speed of the Object will depend on the relationship between the speed and the step values, varying from slow and smooth, to rapid but jerky movements. A speed value of about 10 (or -10) is recommended. The last parameter is a count value, which determines the number of times the movement is to be repeated. Values range between 1 and 32767, with the additional value of zero causing an indefinite repetition.

It is vital to add an L (loop) instruction to the movement string after these parameters, if you want to force a jump to the start of the string, forcing the entire sequence to be run again. Here is an example:

E> Load "AMOSPro_Tutorial:Objects/Sprites.Abk" :Get Sprite Palette
   Sprite 1,360,100,1
   Move X1,"(1,1,60)(1,-5,60)L"
   Move On
   Direct

An alternative ending to the movement string is to use the E option, followed by the value of an x-coordinate.

Back    Next
07.06.22