Amos Professional Manual  Contents  Index

AMAL


Individual AMAL instructions can be separated from one another by almost any of the unused characters, including spaces. But colons cannot be used for this purpose. You are recommended to use the semi-colon character ";" instead, like this:

X> "Move ; Pause ; Jump"

There is a choice between two ways of creating AMAL programs. One way is to define you animations from inside AMOS Professional Basic using strings, for which a special AMAL command is provided. The alternative method is to produce animation sequences with the AMAL accessory program, and save them into a memory bank.

The next part of this Chapter is a step-by-step guide through the basic principles of AMAL, and is intended as an introductory tutorial. This is followed by a full list of all the AMAL commands, along with detailed explanations of their use. Then advanced techniques will be dealt with. At the end of the Chapter, problems with AMAL errors are solved, followed by a final section that provides full compatibility for STOS programmers.

The AMAL guided tour
In this section, Sprites will be used to demonstrate the wonders of AMAL. All of these techniques work equally well with Bobs, so you can take full advantage of both types of Object in your AMAL programs.

Moving an Object

MOVE
AMAL instruction: move an Object
Move horizontal number,vertical number,step

The M command moves an Object by a specified number of units horizontally and vertically, in exactly the number of steps you select. Positive values will move the Object to the right and downwards, while negative values control movement to the left of the screen and upwards. Remember, as with most AMAL commands, this instruction is recognised by a single capital letter, so if it is entered as "Move" or a similar single word beginning with the letter M, all of the lower case letters will be completely ignored. To demonstrate Move, first place a Sprite on screen at coordinates 100,100 with this:

E> Load "AMOSPro Tutorial:Objects/Sprites.abk" : Get Sprite Palette
   Sprite 8,200,100,1

The range, direction and speed of how the Sprite will move now depends on the three chosen values given after the Move command. The size of the steps will particularly affect the Sprite's movement, with a large number of steps for a large distance resulting in very slow, very smooth movements, and very few steps giving jerky movements. Add the following lines to the last example:

E> Amal 8, "M 100,100,50" : Amal On 8 : Wait Key : Rem Slow diagonal movement
Back    Next
07.06.02