Acknowledgments |
|
xiv | |
Introduction |
|
xv | |
Who This Book Is For |
|
xvi | |
About This Book |
|
xvii | |
How to Use This Book |
|
xviii | |
Online Resources |
|
xix | |
Errata and Updates |
|
xix | |
|
1 Getting Started With Scratch |
|
|
1 | (14) |
|
|
3 | (1) |
|
Scratch Desktop: The Offline Editor |
|
|
4 | (1) |
|
The Scratch Editor and Sprites |
|
|
5 | (1) |
|
|
6 | (2) |
|
|
8 | (2) |
|
|
8 | (1) |
|
|
8 | (2) |
|
|
10 | (1) |
|
Showing Off Your Programs |
|
|
10 | (2) |
|
|
12 | (1) |
|
|
12 | (1) |
|
|
12 | (1) |
|
|
13 | (2) |
|
2 Rainbow Lines... In Space! |
|
|
15 | (18) |
|
|
16 | (2) |
|
A Create the Space Backdrop |
|
|
18 | (2) |
|
1 Clean Up and Set the Stage |
|
|
18 | (2) |
|
B Create Three Bouncing Dots |
|
|
20 | (5) |
|
|
20 | (1) |
|
3 Add Code for the Dot 1 Sprite |
|
|
21 | (1) |
|
Explore: Direction and Degrees |
|
|
22 | (2) |
|
4 Duplicate the Dot 1 Sprite |
|
|
24 | (1) |
|
|
25 | (3) |
|
5 Add the Code for the Drawing Dot Sprite |
|
|
25 | (3) |
|
|
28 | (1) |
|
|
29 | (1) |
|
|
30 | (1) |
|
|
31 | (2) |
|
|
33 | (24) |
|
|
34 | (2) |
|
A Make the Cat Walk Around |
|
|
36 | (5) |
|
Explore: X- and Y-coordinates |
|
|
36 | (2) |
|
1 Add Movement Code to the Player Sprite |
|
|
38 | (1) |
|
2 Duplicate the Movement Code for the Cat Sprite |
|
|
39 | (2) |
|
|
41 | (1) |
|
3 Download the Maze Images |
|
|
41 | (1) |
|
|
41 | (1) |
|
5 Start at the First Maze |
|
|
41 | (1) |
|
C Keep the Cat from Walking Through Walls |
|
|
42 | (2) |
|
6 Check Whether the Cat Is Touching the Walls |
|
|
42 | (2) |
|
D Make a Goal at the End of the Maze |
|
|
44 | (3) |
|
7 Create the Apple Sprite |
|
|
45 | (1) |
|
8 Detect When the Player Reaches the Apple |
|
|
45 | (2) |
|
9 Add the Broadcast Handling Code to the Maze Sprite |
|
|
47 | (1) |
|
|
47 | (2) |
|
Version 2.0: Two-Player Mode |
|
|
49 | (5) |
|
Duplicate the Apple Sprite |
|
|
49 | (1) |
|
Modify the Apple2 Sprite's Code |
|
|
50 | (1) |
|
Duplicate the Orange Cat Sprite |
|
|
50 | (1) |
|
Modify the Code for the Blue Cat Sprite |
|
|
51 | (2) |
|
Go Back to the Starting Position |
|
|
53 | (1) |
|
Cheat Mode: Walk Through Walls |
|
|
54 | (1) |
|
Add the Walk-Through-Walls Code to Orange Cat |
|
|
54 | (1) |
|
Add the Walk-Through-Walls Code to Blue Cat |
|
|
54 | (1) |
|
|
55 | (1) |
|
|
56 | (1) |
|
4 Shooting Hoops With Gravity |
|
|
57 | (28) |
|
|
58 | (1) |
|
A Make the Cat Jump and Fall |
|
|
59 | (7) |
|
1 Add the Gravity Code to the Cat Sprite |
|
|
59 | (2) |
|
Explore: For all sprites vs. For this sprite only |
|
|
61 | (3) |
|
2 Add the Ground-Level Code |
|
|
64 | (1) |
|
3 Add the Jumping Code to the Cat Sprite |
|
|
65 | (1) |
|
B Make the Cat Move Left and Right |
|
|
66 | (1) |
|
4 Add the Walking Code to the Cat Sprite |
|
|
66 | (1) |
|
C Make a Hovering Basketball Hoop |
|
|
67 | (5) |
|
|
67 | (2) |
|
6 Create the Hitbox Sprite |
|
|
69 | (3) |
|
D Make the Cat Shoot Hoops |
|
|
72 | (8) |
|
7 Create the Basketball Sprite |
|
|
72 | (1) |
|
8 Add the Code for the Basketball Sprite |
|
|
73 | (2) |
|
9 Detect Whether a Basket Is Made |
|
|
75 | (2) |
|
|
77 | (3) |
|
|
80 | (2) |
|
Cheat Mode: Freeze the Hoop |
|
|
82 | (1) |
|
|
83 | (1) |
|
|
84 | (1) |
|
5 A Polished Brick Breaker Game |
|
|
85 | (34) |
|
|
86 | (1) |
|
A Make a Paddle That Moves Left and Right |
|
|
87 | (3) |
|
1 Create the Paddle Sprite |
|
|
88 | (1) |
|
|
89 | (1) |
|
B Make a Ball That Bounces Off the Walls |
|
|
90 | (1) |
|
2 Create the Tennis Ball Sprite |
|
|
90 | (1) |
|
C Make the Ball Bounce Off the Paddle |
|
|
91 | (3) |
|
3 Add the Bounce Code to the Tennis Ball Sprite |
|
|
91 | (2) |
|
|
93 | (1) |
|
D Make Clones of the Brick |
|
|
94 | (3) |
|
|
94 | (1) |
|
|
95 | (2) |
|
E Make the Ball Bounce Off Bricks |
|
|
97 | (1) |
|
6 Add the Bounce Code to the Brick Sprite |
|
|
97 | (1) |
|
F Make "You Win" and "Game Over" Messages |
|
|
98 | (3) |
|
7 Modify the Tennis Ball Sprite's Code |
|
|
98 | (1) |
|
8 Create the Game Over Sprite |
|
|
98 | (2) |
|
9 Create the You Win Sprite |
|
|
100 | (1) |
|
|
101 | (1) |
|
Version 2.0: Polishing Time |
|
|
102 | (13) |
|
|
103 | (1) |
|
|
104 | (1) |
|
Make the Paddle Flash When Hit |
|
|
104 | (1) |
|
Add an Animated Entrance and Exit to the Bricks |
|
|
105 | (3) |
|
Add a Sound Effect to the Brick Exit |
|
|
108 | (2) |
|
Add a Sound Effect to the Tennis Ball |
|
|
110 | (1) |
|
Add a Trail Behind the Tennis Ball |
|
|
110 | (2) |
|
Add an Animated Entrance for the Game Over Sprite |
|
|
112 | (1) |
|
Add an Animated Entrance for the You Win Sprite |
|
|
113 | (2) |
|
|
115 | (2) |
|
|
117 | (2) |
|
6 Asteroid Breaker In Space |
|
|
119 | (28) |
|
|
120 | (2) |
|
A Make a Spaceship That Is Pushed Around |
|
|
122 | (2) |
|
1 Create the Spaceship Sprite |
|
|
122 | (2) |
|
B Make the Spaceship Wrap Around the Edges |
|
|
124 | (3) |
|
2 Add the Wrap-Around Code to the Spaceship Sprite |
|
|
125 | (1) |
|
3 Add the Random-Push Code to the Spaceship Sprite |
|
|
126 | (1) |
|
C Aim with the Mouse and Fire with the Spacebar |
|
|
127 | (3) |
|
4 Create the Energy Blast Sprite |
|
|
127 | (3) |
|
D Make Asteroids That Float Around |
|
|
130 | (3) |
|
5 Create the Asteroid Sprite |
|
|
131 | (2) |
|
E Make Asteroids Split in Two When Hit |
|
|
133 | (3) |
|
6 Add the Asteroid's Splitting Code |
|
|
133 | (2) |
|
7 Add the Asteroid Blasted Message Code to the Energy Blast Sprite |
|
|
135 | (1) |
|
F Keep Score and Make a Timer |
|
|
136 | (2) |
|
8 Create the Out of Time Sprite |
|
|
136 | (2) |
|
G Make the Spaceship Explode If It Is Hit |
|
|
138 | (3) |
|
9 Upload the Explosion Sprite |
|
|
138 | (1) |
|
10 Add the Code for the Explosion Sprite |
|
|
138 | (1) |
|
11 Add the Explode Code to the Spaceship Sprite |
|
|
139 | (2) |
|
Version 2.0: Limited Ammo |
|
|
141 | (2) |
|
Cheat Mode: Starburst Bomb |
|
|
143 | (1) |
|
|
144 | (2) |
|
|
146 | (1) |
|
7 Making An Advanced Platformer |
|
|
147 | (48) |
|
|
148 | (2) |
|
A Create Gravity, Falling, and Landing |
|
|
150 | (7) |
|
1 Create the Ground Sprite |
|
|
150 | (1) |
|
2 Add the Gravity and Landing Code |
|
|
151 | (2) |
|
3 Make the Cat Walk and Wrap Around the Stage |
|
|
153 | (2) |
|
4 Remove the Ground Lift Delay |
|
|
155 | (2) |
|
B Handle Steep Slopes and Walls |
|
|
157 | (4) |
|
5 Add the Steep Slope Code |
|
|
157 | (4) |
|
C Make the Cat Jump High and Low |
|
|
161 | (2) |
|
|
161 | (2) |
|
|
163 | (4) |
|
7 Add a Low Platform to the Ground Sprite |
|
|
163 | (1) |
|
8 Add the Ceiling Detection Code |
|
|
164 | (3) |
|
E Use a Hitbox for the Cat Sprite |
|
|
167 | (3) |
|
9 Add a Hitbox Costume to the Cat Sprite |
|
|
168 | (1) |
|
|
169 | (1) |
|
F Add a Better Walking Animation |
|
|
170 | (9) |
|
11 Add the New Costumes to the Cat Sprite |
|
|
171 | (1) |
|
12 Create the Set Correct Costume Block |
|
|
172 | (7) |
|
|
179 | (5) |
|
13 Download and Add the Stage Backdrop |
|
|
179 | (1) |
|
14 Create a Hitbox Costume for the Ground Sprite |
|
|
180 | (1) |
|
15 Add the Ground Sprite's Code |
|
|
181 | (1) |
|
16 Add More Wrap-Around Code to the Cat Sprite |
|
|
182 | (2) |
|
H Add Crab Enemies and Apples |
|
|
184 | (8) |
|
17 Add the Apple Sprite and Code |
|
|
184 | (1) |
|
18 Create the Crab Sprite |
|
|
185 | (1) |
|
19 Create the Enemy Artificial Intelligence |
|
|
186 | (5) |
|
20 Add the Time's Up Sprite |
|
|
191 | (1) |
|
|
192 | (1) |
|
|
193 | (2) |
Where To Go From Here |
|
195 | (2) |
Index |
|
197 | |