Navigation

    CreatiCode Scratch Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • CreatiCode

    Point Towards X and Y Positions

    2D Blocks
    1
    1
    396
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • info-creaticode
      CreatiCode last edited by admin

       

      Prerequisite

      • X and Y Positions

       

      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.

      p6.gif

      1 Reply Last reply Reply Quote 0
      • First post
        Last post