Page 15 - Scratch Programming Playground
P. 15

7
          Fruit slicer                                                             145
          Sketch Out the Design  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . 147
          A . Make the Start Screen Backdrop   . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . 148
                1 . Draw the Backdrops  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . 148
                2 . Add the Code for the Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . 150
          B . Make the Slice Trail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . 151
                3 . Draw the Slice Sprite  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . 151
                Explore: Making Lists  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
                4 . Create Lists and Variables for the Slice Sprite . . . . . . . . . . . . . .  . 155
                5 . Record the Mouse Movements  . . . . . . . . . . . . . . . . . . . . . . . . . . .  . 156
                6 . Make a Custom Block to Draw the Slice  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . 157
          C . Make the Begin Button  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . 160
                7 . Create the Begin Button Sprite  . . . . . . . . . . . . . . . . . . . . . . . . . .  . 160
          D . Make the Fruit and Bombs Throw Themselves  . . . . . . . . . . . . . . . . . .  . 162
                8 . Create the Fruit Sprite  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . 163
                9 . Make the Sliced Fruit Costumes  . . . . . . . . . . . . . . . . . . . . . . . . .  . 164
                10 . Add the Code to the Fruit Sprite  . . . . . . . . . . . . . . . . . . . . . . . .  . 167
                11 . Add the Code for the Fruit Sprite’s Clones  . . . . . . . . . . . . . . . .  . 170
          E . Make the Health Sprites  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . 173
                12 . Create the Health Sprite   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . 173
          F . Make the Game’s Ending . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . 176
                13 . Create the White Fade Out Sprite  . . . . . . . . . . . . . . . . . . . . . . .  . 176
          Version 2 .0: High Score   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . 179
          Cheat Mode: Recover Health  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . 180
          Summary  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . 181
          Review Questions  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . 182

          8
          asteroid Breaker . . . in space!                                         183

          Sketch Out the Design  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . 184
          A . Make a Spaceship That Is Pushed Around . . . . . . . . . . . . . . . . . . . . . .  . 186
                1 . Create the Spaceship Sprite . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . 186
          B . Make the Spaceship Wrap Around the Edges   . . . . . . . . . . . . . . . . . . .  . 188
                2 . Add the Wrap-Around Code to the Spaceship Sprite  . . . . . . . . .  . 188
                3 . Add the Random-Push Code to the Spaceship Sprite  . . . . . . . . .  . 190
          C . Aim with the Mouse and Fire with the Spacebar . . . . . . . . . . . . . . . . .  . 190
                4 . Create the Energy Blast Sprite  . . . . . . . . . . . . . . . . . . . . . . . . . .  . 191
          D . Make Asteroids That Float Around   . . . . . . . . . . . . . . . . . . . . . . . . . . .  . 194
                5 . Create the Asteroid Sprite  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . 194






                                                                        COnTEnTS In DETAIL   xiii
   10   11   12   13   14   15   16   17   18   19   20