Page 83 - ThinkGPT_V2.1_C3_Flipbook
P. 83

Add the mouse Sprite from the Sprite library. Let us now create a Script to make the two
                 Sprites move and talk to each other.

                 Step 1     Click on the Cat Sprite. Drag the when clicked block from the Events category.
                          Then, drag say for 2 seconds block to the coding area. Type the message in the text

                          box of the block. Drag move block from the Motion category.










                                                              Cat Sprite


                 Step 2     Click on the Mouse Sprite. Drag the when clicked block from the Events category.
                          Then, drag think for 1 seconds block to the coding area. Type the message in the
                          text box of the block.

                 Step 3     Click on Motion category and drag the move block to the coding area. When you
                          bring this block below the speech block, it will attach itself. Change the number of
                          steps to 20 in the text box of the block.












                                                               Mouse Sprite

                 Step 4     Click on the Green flag and see your cat and mouse talk and move.































                                                                                           More on Scratch     81
   78   79   80   81   82   83   84   85   86   87   88