Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 131 - 2505_CoreGPT(Podar)_Flipbook_C5
P. 131

    POSITIONING A SPRITE

                     The stage in Scratch is 480 pixels wide and 360 pixels high. It is divided into a
                     grid of coordinates, made up of both x and y values. These values determine the

                     exact position of a sprite on the stage. The x value controls the horizontal position
                     (left to right), while the y value controls the vertical position (top to bottom). The
                     centre of the stage is marked as (0, 0), which is the origin.

                                                                      Y
                                                                    3
                                                                              (2,2)
                                                                    2
                                                        (-2,1)      1
                                                                                         X
                                                       -3   -2   -1 Y  -1  (0,0) 1  2  3

                                                                 3  -2
                                                                 2  -3    (2,2)
                                                      (-2,1)     1
                                                                                    X
                                                                   (0,0)
                                                         -2
                                                                               3
                                                             -1
                                                     -3
                                                                           2
                                                                       1
                     When positioning a sprite, you use  coordinates in the format  (x, y). The  x
                                                                -1
                     coordinate comes first, followed by the y coordinate, separated by a comma.
                                                                -2
                                                                -3
                     For example, an X- coordinate of 2 and a Y-coordinate of 2 would look like this:
                     (x:2,y:2).
                     In the same way, Scratch determines the positions on its screen. Positions are
                     known as pixels in Scratch. The ‘X’ and ‘Y’ positions in Scratch are used to determine
                     the location of a Sprite (object) on the stage. The ‘X’ position can range from 240
                     to -240. 'Y' position can range from 180 to –180.

                           USING OPERATORS

                     These blocks are  colour-coded  as light-green.  Operator  Blocks are  used to do
                     arithmetic and logical calculations. Blocks in the Operators category are oval and
                     hexagon in shape.

                                                                                     Basic Programming in Scratch       129

| 126 127 128 129 130 131 132 133 134 135 136 |