Page 106 - 2502_Pakistan-kifayat_C-7
P. 106

BLOCKS USED FOR MOVING SPRITE


              Some other blocks that are used in moving a sprite are as follow:
              1.  Point in Direction [ ]: In Scratch, the “point in direction” block is used to set the direction in which
                 a sprite is facing. This block allows you to set the sprite’s facing direction by specifying an angle. The
                 direction is defined by an angle, with 0° being rightward (along the positive
                 x-axis), 90° being upwards (along the positive y-axis), 180° being leftward
                 (along the negative x-axis), and -90° being downwards (along the negative
                 y-axis).

              2.  Move [ ] Steps:  This block moves the sprite forward by a specific number of
                 steps in the direction it is facing.

              3.  Turn [ ] degrees: This block  rotates the  sprite clockwise  by  a specified
                 number of degrees. The sprite turns around its center. Positive values turn
                 it clockwise, and negative values turn it counterclockwise.

              4.  Turn [  ]  degrees  (counterclockwise):  This  block  rotates the  sprite
                 counterclockwise by a specified number of degrees.

                   MOVING SPRITE


              In Scratch, movement is a fundamental concept that allows sprites (the characters or objects on the
              stage) to interact with their environment, creating engaging and dynamic animations or games. The
              movement of a sprite in Scratch refers to how a sprite (a character or object) changes its position on
              the stage. Movement is a key element in creating interactive projects, animations, and games. Scratch
              offers various ways to move sprites, including manual movement, where the user controls the sprite,
              and automatic movement, where the sprite follows instructions from the code.

              Moving Sprite Automatically

              In Scratch, automatic movement allows a sprite to move on its own without needing any input from
              the user. This type of movement is usually programmed through a series of instructions. The sprite
              follows the instructions that you set in the code, such as moving in a specific direction, changing position
              after a certain amount of time, or following a set pattern.

              Different examples for moving sprite automatically are as follows:

              1.  Moving 10 Steps Forward













              This code automatically moves the sprite 10 steps forward.





                  104  Premium Edition-VII
   101   102   103   104   105   106   107   108   109   110   111