Scratch Programming Playground: Learn to Program by Making Cool Games
E Make the Ball Bounce Off Bricks 104 6 Add the Bounce Code to the Brick Sprite 104 F Make You Win and Game Over Messages 105 7 Modify the Tennis Ball Sprite’s Code 105 8 Create the Game Over Sprite 106 9 Create the You Win Sprite 107 The Complete Program 108 Version 2 0 Polishing Time 109 Draw a Cool Backdrop 110 Add Music 111 Make the Paddle Flash When Hit 112 Add an Animated Entrance and Exit to the Bricks 112 Add a Sound Effect to the Brick Exit 115 Add a Sound Effect to the Tennis Ball 117 Add a Trail Behind the Tennis Ball 117 Add an Animated Entrance for the Game Over Sprite 119 Add an Animated Entrance for the You Win Sprite 120 Summary 122 Review Questions 123 6 Snaaaaaake 125 Sketch Out the Design 127 A Make a Snake Head That Moves Around 127 1 Create the Head Sprite 128 Explore when key pressed vs if key pressed then 130 B Make Apples Appear 131 2 Add the Apple Sprite 131 C Make a Body That Appears Behind the Snake Head 132 3 Create the Body Sprite 132 4 Create the Body Sprite’s Second Costume 133 5 Add the Code for the Body Sprite 133 6 Detect Whether the Snake Crashes into Itself or a Wall 135 The Complete Program 137 Version 2 0 Add Bonus Fruit 138 Cheat Mode Invincibility 140 Modify the Head 140 Modify the Body Code 141 Cheat Mode Chop Off Your Tail 142 Summary 142 Review Questions 143 xii COnTEnTS In DETAIL
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
E Make Asteroids Split in Two When Hit 196 6 Add the Asteroid’s Splitting Code 196 7 Add the Asteroid Blasted Message Code to the Energy Blast Sprite 198 F Keep Score and Make a Timer 199 8 Create the Out of Time Sprite 199 G Make the Spaceship Explode If It Is Hit 200 9 Upload the Explosion Sprite 201 10 Add the Code for the Explosion Sprite 201 11 Add the Explode Code to the Spaceship Sprite 202 Version 2 0 Limited Ammo 204 Cheat Mode Starburst Bomb 206 Summary 207 Review Questions 208 9 Making an Advanced Platformer 209 Sketch Out the Design 210 A Create Gravity Falling and Landing 212 1 Create the Ground Sprite 212 2 Add the Gravity and Landing Code 213 3 Make the Cat Walk and Wrap Around the Stage 215 4 Remove the Ground Lift Delay 216 B Handle Steep Slopes and Walls 218 5 Add the Steep Slope Code 218 C Make the Cat Jump High and Low 222 6 Add the Jumping Code 222 D Add Ceiling Detection 224 7 Add a Low Platform to the Ground Sprite 224 8 Add the Ceiling Detection Code 225 E Use a Hitbox for the Cat Sprite 228 9 Add a Hitbox Costume to the Cat Sprite 229 10 Add the Hitbox Code 230 F Add a Better Walking Animation 231 11 Add the new Costumes to the Cat Sprite 232 12 Create the Set Correct Costume Block 233 G Create the Level 239 13 Download and Add the Stage Backdrop 239 14 Create a Hitbox Costume for the Ground Sprite 240 15 Add the Ground Sprite’s Code 241 16 Add More Wrap-Around Code to the Cat Sprite 242 xiv COnTEnTS In DETAIL
H Add Crab Enemies and Apples 243 17 Add the Apple Sprite and Code 244 18 Create the Crab Sprite 245 19 Create the Enemy Artificial Intelligence 246 20 Add the Time’s Up Sprite 250 Summary 252 Review Questions 253 Where to Go from Here Index 255 257 COnTEnTS In DETAIL xv