Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 151 - CodePilot V5.0 C4
P. 151

    Making Sprites Move

                     To make sprites move, you use motion blocks
                     available  in Sprite blocks such as:

                         Move  Sprite:  Move  a  sprite  in  directions  like
                         forward, backward, north, south, east or west,
                         with pixel values controlling speed and distance.

                          Turn right/left by X degrees: Rotate the sprite
                         in the specified direction by the given number

                         of degrees.

                     CREATING AN ANIMATED CHARACTER

                     To create an animated character, follow the given steps:

                     Step   1     Open Sprite Lab on Code.org.

                     Step   2      Drag the set background to block from the World blocks category and
                                   attach it below the when run block.

                     Step  3       Drag the set size to block from the Sprites block category and place it
                                   under the set background to block.

                     Step   4     Set the sprite size to 20.

                     Step  5       Drag the make new sprite at block and place it under the set size to
                                   block.

                     Step  6       Drag the sprite begins and growing block from the Behaviours block
                                   category and place it under the make new sprite at block.

                     Step   7      Click on the Run button to run the script.

                                                     Script         Output

                     You will observe that the size of the sprite gets increased.

                                                                                             Bonus Byte - 2 (Code.org)  149

| 146 147 148 149 150 151 152 153 154 |