Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 63 - 2505_CoreGPT(Podar)_Flipbook_C4
P. 63

    Let’s now create a script to make two sprites move and talk to each other.

                     Step 1  Click on the cat sprite from the sprite list to create its script.

                     Step 2  Drag the blocks for the cat sprite.

                     Step 3  Add the mouse sprite to the stage.
                     Step 4  Select the mouse sprite. A separate script area will appear.

                     Step 5  Drag the blocks for the mouse sprite.

                                            Cat sprite                                 Mouse sprite

                     Step 6  Click on the Green flag to start the project.

                     You will get the following output:

                           CHANGING THE LOCATION OF A SPRITE

                     Changing the location of a sprite means to move the sprite from one place to

                     another. To change the location of a sprite, follow the given steps:

                     Step 1  Select the sprite you want to move.
                     Step 2  Drag the go to x: [ ] y: [ ] block from the Motion category.

                     Step 3  Enter the new x and y values to set the new location of the sprite.

                     Step 4  Click on the Green flag button.

                     You will notice the position of a sprite changes to the given coordinates.

                                                                                     Working with Multiple Sprites       61

| 58 59 60 61 62 63 64 65 66 67 68 |