(More alternatives.)
(Axis Range)
Line 8: Line 8:
  
 
==Example Uses==
 
==Example Uses==
Often in games, the player controls a sprite and moves it around, such as with velocity. In this way, the '''Change Y by ()''' block (and the [[Change X by () (block)|Change X by ()]] block) can become very useful.
+
Often in games, the player controls a sprite and moves it around, such as with velocity. In this way, the '''Change Y by ()''' block (and the [[Change X by () (block)|Change X by ()]] block) can become very useful. The y axis ranges from -180 to 180.
  
 
==Workaround==
 
==Workaround==

Revision as of 00:41, 27 September 2014

Change Y by ()
2.0 Change Y by ().png
Category Motion
Type Stack
The change y by () block is a Motion block and a Stack block. The block moves its sprite's Y position by the specified amount.

Example Uses

Often in games, the player controls a sprite and moves it around, such as with velocity. In this way, the Change Y by () block (and the Change X by () block) can become very useful. The y axis ranges from -180 to 180.

Workaround

Main article: List of Block Workarounds

This block can be replicated with the following scripts:

set y to ((y position) + (change))

go to x: (x position) y: ((y position) + (change))

define change y by (value) //run without screen refresh
set [pastDirection v] to (direction)
point in direction (0 v)
move (value) steps
point in direction (pastDirection)

See Also