Y position: Difference between revisions
Y position
Content deleted Content added
Y do you need to know? (buh dum tish) Added Page for Y reporter |
No edit summary |
||
Line 1: | Line 1: | ||
{{Infobox Block |
|||
Mainly known as Y or Y Pos it represents the current Y position of the sprite |
|||
|block_type = Reporter Block |
|||
{| class="wikitable" |
|||
⚫ | |||
|+ |
|||
|title = y position |
|||
! colspan="2" |Y Position |
|||
|block_name = y position |
|||
|- |
|||
⚫ | |||
!Block Type |
|||
The '''y position''' block is a reporter block that reports the current y position of the sprite. It originates from [[Scratch]]. |
|||
|Reporter |
|||
==Workaround== |
|||
|- |
|||
This block can be worked around by using a [[Variables (subcategory)|variable]] to save the y position when the [[set y to ()]] or [[change y by ()]] blocks are used: |
|||
!Category / Extension |
|||
<scratchblocks> |
|||
⚫ | |||
define set y to (number1) |
|||
⚫ | |||
set [y pos v] to (number1) |
|||
set y to (number1) |
|||
define change y by (number1) |
|||
set y to ((number1) + (y pos))::custom |
|||
</scratchblocks> |
|||
However, this workaround does not account for the y position limit if offscreen, or "Remove Fencing" is disabled. |
|||
{{DISPLAYTITLE:y position}} |
|||
{{Blockcat|type=Reporter|cat=Motion|sc=y}} |
Revision as of 22:44, 8 July 2024
y position | |
---|---|
y position | |
Block Type | Reporter Block |
Category / Extension | Motion |
The y position block is a reporter block that reports the current y position of the sprite. It originates from Scratch.
Workaround
This block can be worked around by using a variable to save the y position when the set y to () or change y by () blocks are used:
define set y to (number1) set [y pos v] to (number1) set y to (number1) define change y by (number1) set y to ((number1) + (y pos))::custom
However, this workaround does not account for the y position limit if offscreen, or "Remove Fencing" is disabled.