A sprite moving on the X axis.

The X Position is where the sprite is on the X axis (horizontal) of the stage. The value increases or decreases depending on how far right or left on the Stage the sprite is. Directly in the center is 0. The sprite's costume center is where the X and Y positions meet.

Related Blocks

The following blocks can be used in conjunction with this value:

Example Uses

Some common uses for the X Position value are below:

  • Sliders
  • Moving horizontally
  • Finding a sprite's X Position

In Detail

Some more uses for x in detail:

  • X can be used in triggers, such as if a sprites x position equals something, it will broadcast an event to do something. This can be done with the x position variable.
  • X can also set variables, and cause something to change if it is linked to the variable. This can be done with the = < and > blocks.
  • X can be used to follow objects with the use of the x position of block, or go to an objects x plus or minus a certain amount, with the +,- or = blocks.
  • X is an alternative way to walking, mostly used in-staid of move () steps, when the sprite is turned a certain way.
  • X can also be used if one would like their variable to appear in blue, so one could show the x position on the screen as a variable and change it, commonly used for a color-themed score.

See Also