Point Towards X and Y Positions
-
Prerequisite
Description
The “point towards x and y” block is a stack block in the “Motion” category.
Target X and Y Positions
The “point towards x ( ) y ( )” block changes the direction of the current sprite towards a target point on the stage. You can specify the x and y positions of that target point.
Suppose we place the “Arrow” sprite at the center of the stage, then when we run the “point towards” block with a target position, the arrow will turn to point towards that point on the stage.
Note that the sprite doesn’t have to be at the center of the stage. For example, we can drag the sprite around, but make it always point back to the center:
Time Period
Instead of turning the sprite right away, we can make it turn in animation, and we can specify the total number of seconds it takes to complete the turn.