Amos Professional Manual  Contents  Index

the Joystick and Mouse


The three other function in this family are self-evident, as follows:

JRIGHT
function: test for joystick movement towards the right
x=Jright(port number)

JUP
function: test for joystick movement upwards
x=Jup(port number)

JDOWN
function: test for joystick movement downwards
x=Jdown(port number)

These functions can be demonstrated by the following example:

E> Do
    If Jleft(1) Then Print "WEST"
    If Jright(1) Then Print "EAST"
    If Jup(1) Then Print "NORTH"
    If Jdown(1) Then Print "SOUTH"
   Loop

FIRE
function: test status of fire-button
x=Fire(port number)

To set up a routine for testing to see if the fire-button has been pressed, use the FIRE function followed by the joystick port number. A value of -1 will be given only if the fire-button on the relevant joystick has been pressed.

E> Do
    F=Fire(1)
    If F=-1 Then Centre "BANG!": Shoot
    Print
   Loop

The mouse pointer
The mouse is often used in practical programming whereas joysticks have become associated with playing computer games, but they both do much the same thing. They can both control moving objects on screen and be used to select from a range of on-screen options, using a cursor.

The mouse cursor has been pre-programmed to look like a pointer arrow, along with two additional standard shapes that can be selected at any time. The standard shapes have been assigned the numbers one to three, as follows:

Back    Next
05.08.02