The MOVEMENT
command allows you to define a movement of an object,
starting from a given ATLAS
and giving a destination, that can be
relative to the current position or absolute. Once defined, the
movement, IT can then be used at any time.
In order for this to work, you need to indicate a variable prefix that will be
associated with the trajectorty of the object that will have this movement.
This can be indicated with the USING
keyword.
The relative movement lasts as the number of the frames contained in the
ATLAS
given with the WITH
keyword. The absolute movement, instead,
depends on the original and destination position.
This statement will generate a series of variables: on relative movements,
'prefixSteps which will be decremented to zero when movement is ended;
prefixX and
prefixY, which will contain the position where
the object is located actually. If a movement to a position is required,
the
prefixTX and
prefixTY variables will contain the destination
position, white
prefixPath'' will be defined, to take track of the
movement itself.
MOVEMENT id [rel] WITH atlas [DELAY delay] USING player rel: LEFT|RIGHT|UP|DOWN MOVEMENT id TO POSITION [DELAY delay] USING player MOVEMENT id STEADY USING player
MOVEMENT left TLEFT WITH playerForward USING player
Join BASIC 10Liner Contest with ugBASIC!
An interesting competition is held at the beginning of each year: the
BASIC 10Liner Contest.
It is possible to use ugBASIC to participate in the next
"BASIC10Liner" competition, in the following categories:
MOVEMENT ↔ Mvv
If you have found a problem with this keyword, if you think there is a bug or, more
simply, you would like it to be improved, open an issue for this example on GitHub.
Thank you!
open an issue
BACK TO KEYWORDS