Available on:

MOVEMENT

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.

SYNTAX

 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


Legend
  • id : identifier
  • type : datatype
  • v : value
  • "..." : string
  • [...] : optional

EXAMPLE

 MOVEMENT left TLEFT WITH playerForward USING player


ABBREVIATION: Mvv

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:

  • PUR-120 - A game in 10 lines of max 120 characters (w/abbrev.)
  • EXTREME-256 - A game in 10 lines of max 256 characters (w/abbrev.)
  • SCHAU - Any program in 10 lines of max 256 characters (w/abbrev.)
In order to reduce space you can use this abbreviation for this instruction:

MOVEMENT ↔ Mvv

Any problem?

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