|Point in Direction ()|
The blocks use the 360 degrees in a circle. The Default Value is 90 and can be replaced by any Number (360+x displays the same than 0+x).
There has been some confusion involving the number system due to the fact that 0 is straight up, rather than off to the right (the default direction) or off to the left (as in a protractor), and that it uses a -180 to 180 circle rather than a normal 360 degree circle. Despite complaints, no changes have been made.
If a sprite must be turned and its direction is not known, this block can be used.
Some common uses for the Point in Direction () block:
- Flipping a sprite
when I receive [Flip v] point in direction ((direction) + (180))
- Choosing where a cannon points
point in direction (answer)
- Pointing vehicles towards a destination
point in direction (wanted destination)
- Main article: List of Block Workarounds
The block can be replicated with the following code:
turn right ((wanted direction) - (direction)) degrees
Move () Steps • Turn () Degrees • Go to () • Go to X: () Y: () • Glide () Secs to () • Glide () Secs to X: () Y: () • Point in Direction () • Point Towards ()• Change X by () • Set X to () • Change Y by () • Set Y to () • If on Edge, Bounce • Set Rotation Style () • X Position • Y Position • DirectionMore blocks...