X position: Difference between revisions

From PenguinMod Wiki
X position
Jump to navigation Jump to search
Content added Content deleted
(Added a bunch of stuff, and replaced table with infobox block template)
m (See also)
 
Line 5: Line 5:
|title = x position
|title = x position
}}
}}
The '''x position''' block is a reporter block in the [[Motion]] category that reports the current x position of the sprite that the block is in. It originates from [[Scratch]]. The default value for non-paint/blank sprites is a random position, while the default value for paint/blank sprites is 36.
The '''x position''' block is a reporter block in the [[Motion]] category that reports the current x position of the sprite that the block is in. It originates from [[Scratch]]. The default value for non-paint/blank sprites is a random position, while the default value for paint/blank sprites is 36. In the default project, the Penguin sprite starts at a position of (0, 0).
==Workaround==
==Workaround==
This block can be worked around by using the [[() of () (Sensing)|() of ()]] sensing reporter block, with x position selected, and getting the 2nd dropdown to be the sprite that the block is in. This can be achieved by using a reporter that reports the name of the sprite, or by copying the block from another sprite to the sprite wanted. However, this always gets the x position of the main sprite, and not any of the clones:<br>
This block can be worked around by using the [[() of () (Sensing)|() of ()]] sensing reporter block, with x position selected, and getting the 2nd dropdown to be the sprite that the block is in. This can be achieved by using a reporter that reports the name of the sprite, or by copying the block from another sprite to the sprite wanted. However, this always gets the x position of the main sprite, and not any of the clones:<br>
Line 11: Line 11:
Or:<br>
Or:<br>
<sb>[x position v] of (join [se] [lf])</sb>
<sb>[x position v] of (join [se] [lf])</sb>
==See also==
*[[y position]]
*[[x stretch]]
*[[x velocity]]
*[[x scroll]]
*[[() position of object named ()]]
{{DISPLAYTITLE:x position}}
{{DISPLAYTITLE:x position}}
{{Blockcat|type=Reporter|cat=Motion|sc=y}}
{{Blockcat|type=Reporter|cat=Motion|sc=y}}

Latest revision as of 16:19, 5 July 2024

x position
x position
Caption
Block Type Reporter Block
Category / Extension Motion
Status Who tf uses status

The x position block is a reporter block in the Motion category that reports the current x position of the sprite that the block is in. It originates from Scratch. The default value for non-paint/blank sprites is a random position, while the default value for paint/blank sprites is 36. In the default project, the Penguin sprite starts at a position of (0, 0).

Workaround

This block can be worked around by using the () of () sensing reporter block, with x position selected, and getting the 2nd dropdown to be the sprite that the block is in. This can be achieved by using a reporter that reports the name of the sprite, or by copying the block from another sprite to the sprite wanted. However, this always gets the x position of the main sprite, and not any of the clones:
[x position v] of (self v)
Or:
[x position v] of (join [se] [lf])

See also