Point in Direction ()
point in direction ()
Category Motion
Type Stack
The direction selector.

The point in direction () block is a stack block and a Motion block. The block points its sprite in the specified direction, rotating the sprite. 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). When the input is clicked, a circle appears where one can select a direction.

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,[1] no changes have been made.

Direction dependent of value

Example Uses

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 are:

  • 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)

Workaround

Main article: List of Block Workarounds

The blocks can be replicated by turning the needed amount of degrees:

turn right ( ( wanted direction ) - ( direction ) ) degrees
turn right ( ( wanted direction ) +  (360)  ) degrees

See Also

References

Cookies help us deliver our services. By using our services, you agree to our use of cookies.