Acknowledgments |
|
xv | |
Introduction |
|
1 | (12) |
|
|
1 | (1) |
|
|
2 | (1) |
|
|
3 | (1) |
|
Installing the Software on Raspberry Pi |
|
|
4 | (1) |
|
Installing Python on Windows |
|
|
4 | (1) |
|
Installing Pygame Zero on Windows |
|
|
5 | (1) |
|
Installing the Software on Other Machines |
|
|
6 | (1) |
|
Downloading the Game Files |
|
|
7 | (1) |
|
Downloading and Unzipping the Files on a Raspberry Pi |
|
|
7 | (1) |
|
Unzipping the File on a Windows PC |
|
|
8 | (1) |
|
|
8 | (1) |
|
|
9 | (1) |
|
Running Pygame Zero Programs on the Raspberry Pi |
|
|
9 | (1) |
|
Running Pygame Zero Programs in Windows |
|
|
10 | (1) |
|
|
11 | (2) |
|
|
13 | (20) |
|
Starting the Python Editor |
|
|
14 | (1) |
|
Starting IDLE in Windows 10 |
|
|
14 | (1) |
|
Starting IDLE in Windows 8 |
|
|
15 | (1) |
|
Starting IDLE on the Raspberry Pi |
|
|
15 | (1) |
|
Introducing the Python Shell |
|
|
15 | (1) |
|
|
16 | (1) |
|
|
17 | (1) |
|
Outputting and Using Numbers |
|
|
17 | (1) |
|
|
18 | (1) |
|
|
18 | (3) |
|
Understanding the Program So Far |
|
|
21 | (2) |
|
Stopping Your Pygame Zero Program |
|
|
23 | (1) |
|
Adding the Planet and Spaceship |
|
|
23 | (1) |
|
Changing Perspective: Flying Behind the Planet |
|
|
24 | (1) |
|
|
25 | (1) |
|
|
26 | (1) |
|
|
27 | (1) |
|
Understanding the Spacewalk Listing |
|
|
27 | (2) |
|
|
29 | (1) |
|
|
29 | (2) |
|
|
31 | (2) |
|
2 Lists Can Save Your Life |
|
|
33 | (14) |
|
Making Your First List: The Take-Off Checklist |
|
|
34 | (1) |
|
|
35 | (1) |
|
Adding and Removing Items |
|
|
35 | (1) |
|
|
36 | (1) |
|
|
36 | (1) |
|
Accessing an Individual Item |
|
|
36 | (1) |
|
|
37 | (1) |
|
|
37 | (1) |
|
|
37 | (1) |
|
Creating the Spacewalk Checklist |
|
|
38 | (1) |
|
|
38 | (1) |
|
A List of Lists: The Flight Manual |
|
|
38 | (1) |
|
|
38 | (1) |
|
|
39 | (1) |
|
Finding an Item in the Flight Manual |
|
|
39 | (1) |
|
|
40 | (1) |
|
Making Maps from Lists: The Emergency Room |
|
|
41 | (1) |
|
|
42 | (1) |
|
Finding an Emergency Item |
|
|
43 | (1) |
|
|
44 | (1) |
|
Swapping Items in the Room |
|
|
44 | (1) |
|
|
45 | (1) |
|
|
45 | (2) |
|
|
|
|
47 | (12) |
|
Displaying Maps with Loops |
|
|
48 | (1) |
|
|
48 | (1) |
|
Displaying the Map with a Loop |
|
|
49 | (1) |
|
|
50 | (1) |
|
|
50 | (1) |
|
Nesting Loops to Get Room Coordinates |
|
|
50 | (2) |
|
|
52 | (1) |
|
|
53 | (1) |
|
Displaying a 3D Room Image |
|
|
53 | (2) |
|
Understanding How the Room Is Drawn |
|
|
55 | (1) |
|
Working Out Where to Draw Each Item |
|
|
56 | (1) |
|
|
57 | (1) |
|
|
57 | (1) |
|
|
58 | (1) |
|
4 Creating The Space Station |
|
|
59 | (20) |
|
Automating the Map Making Process |
|
|
59 | (1) |
|
How the Automatic Map Maker Works |
|
|
60 | (1) |
|
|
60 | (2) |
|
Writing the Game_Map Code |
|
|
62 | (3) |
|
Testing and Debugging the Code |
|
|
65 | (1) |
|
Generating Rooms from the Data |
|
|
66 | (2) |
|
How the Room Generating Code Works |
|
|
68 | (1) |
|
Creating the Basic Room Shape |
|
|
69 | (2) |
|
|
71 | (1) |
|
|
72 | (1) |
|
|
72 | (1) |
|
Exploring the Space Station in 3D |
|
|
72 | (3) |
|
|
75 | (1) |
|
|
76 | (1) |
|
|
76 | (1) |
|
|
77 | (2) |
|
5 Preparing The Space Station Equipment |
|
|
79 | (18) |
|
Creating a Simple Planets Dictionary |
|
|
80 | (1) |
|
Understanding the Difference Between a List and a Dictionary |
|
|
80 | (1) |
|
Making an Astronomy Cheat Sheet Dictionary |
|
|
80 | (2) |
|
Error-Proofing the Dictionary |
|
|
82 | (1) |
|
|
82 | (1) |
|
Putting Lists Inside Dictionaries |
|
|
83 | (1) |
|
Extracting Information from a List Inside a Dictionary |
|
|
84 | (1) |
|
|
85 | (1) |
|
Making the Space Station Objects Dictionary |
|
|
85 | (2) |
|
Adding the First Objects in Escape |
|
|
87 | (2) |
|
Viewing Objects with the Space Station Explorer |
|
|
89 | (1) |
|
|
89 | (2) |
|
|
91 | (1) |
|
Adding the Rest of the Objects |
|
|
91 | (4) |
|
|
95 | (1) |
|
|
95 | (1) |
|
|
96 | (1) |
|
6 Installing The Space Station Equipment |
|
|
97 | (54) |
|
Understanding the Dictionary for the Scenery Data |
|
|
97 | (2) |
|
|
99 | (3) |
|
Adding the Perimeter Fence for the Planet Surface |
|
|
102 | (2) |
|
Loading the Scenery into Each Room |
|
|
104 | (3) |
|
Updating the Explorer to Tour the Space Station |
|
|
107 | (2) |
|
|
109 | (1) |
|
|
109 | (1) |
|
|
110 | (1) |
|
Moving Into The Space Station |
|
|
111 | (1) |
|
Arriving on the Space Station |
|
|
112 | (1) |
|
Disabling the Room Navigation Controls in the EXPLORER Section |
|
|
112 | (1) |
|
|
112 | (3) |
|
Teleporting onto the Space Station |
|
|
115 | (1) |
|
|
116 | (3) |
|
Understanding the Movement Code |
|
|
119 | (3) |
|
|
122 | (1) |
|
|
122 | (4) |
|
|
126 | |
|
|
8 | (119) |
|
Repairing The Space Station |
|
|
127 | (1) |
|
Sending Information to a Function |
|
|
128 | (1) |
|
Creating a Function that Receives Information |
|
|
128 | (1) |
|
|
129 | (1) |
|
|
129 | (1) |
|
Adding Variables for Shadows, Wall Transparency, and Colors |
|
|
130 | (2) |
|
Deleting the EXPLORER Section |
|
|
132 | (1) |
|
Adding the DISPLAY Section |
|
|
133 | (1) |
|
Adding the Functions for Drawing Objects |
|
|
134 | (2) |
|
|
136 | (2) |
|
Understanding the New draw() Function |
|
|
138 | (3) |
|
Positioning the Room on Your Screen |
|
|
141 | (1) |
|
Making the Front Wall Fade In and Out |
|
|
142 | (3) |
|
Displaying Hints, Tips, and Warnings |
|
|
145 | (1) |
|
Showing the Room Name When You Enter the Room |
|
|
146 | (2) |
|
|
148 | (1) |
|
|
149 | (2) |
|
9 Unpacking Your Personal Items |
|
|
151 | (20) |
|
Adding the Props Information |
|
|
151 | (3) |
|
Adding Props to the Room Map |
|
|
154 | (3) |
|
Finding an Object Number from the Room Map |
|
|
157 | (2) |
|
|
159 | (1) |
|
|
159 | (1) |
|
Adding the Keyboard Controls |
|
|
160 | (1) |
|
Adding the Inventory Functionality |
|
|
161 | (1) |
|
|
162 | (2) |
|
Adding the Tab Keyboard Control |
|
|
164 | (1) |
|
|
165 | (1) |
|
|
166 | (1) |
|
|
167 | (1) |
|
|
168 | (1) |
|
|
169 | (1) |
|
|
169 | (1) |
|
|
170 | (1) |
|
|
171 | (12) |
|
Adding the Keyboard Control for Using Objects |
|
|
172 | (1) |
|
Adding Standard Messages for Using Objects |
|
|
172 | (2) |
|
Adding the Game Progress Variables |
|
|
174 | (1) |
|
Adding the Actions for Specific Objects |
|
|
174 | (3) |
|
|
177 | (2) |
|
|
179 | (1) |
|
Adding the Game Completion Sequence |
|
|
180 | (1) |
|
|
180 | (1) |
|
|
181 | (2) |
|
11 Activating Safety Doors |
|
|
183 | (14) |
|
Planning Where to Put Safety Doors |
|
|
184 | (1) |
|
|
185 | (1) |
|
|
185 | (2) |
|
Making the Doors Open and Close |
|
|
187 | (2) |
|
Adding the Door Animation |
|
|
189 | (1) |
|
|
190 | (1) |
|
|
190 | (2) |
|
|
192 | (1) |
|
|
193 | (1) |
|
Activating the Airlock Security Door |
|
|
193 | (2) |
|
Removing Exits for Your Own Game Designs |
|
|
195 | (1) |
|
|
196 | (1) |
|
|
196 | (1) |
|
12 danger! Danger! Adding hazards |
|
|
197 | (20) |
|
|
198 | (1) |
|
Displaying the Air and Energy Bars |
|
|
198 | (1) |
|
Adding the Air Countdown Functions |
|
|
199 | (3) |
|
Starting the Air Countdown and Sounding the Alarm |
|
|
202 | (1) |
|
|
202 | (1) |
|
Adding the Moving Hazards |
|
|
203 | (1) |
|
|
204 | (1) |
|
Sapping the Player's Energy |
|
|
205 | (1) |
|
Starting and Stopping Hazards |
|
|
205 | (3) |
|
Setting Up the Hazard Map |
|
|
208 | (1) |
|
|
208 | (2) |
|
Displaying Hazards in the Room |
|
|
210 | (1) |
|
|
211 | (1) |
|
Stopping the Player from Walking Through Hazards |
|
|
212 | (1) |
|
|
212 | (1) |
|
Making the Finishing Touches |
|
|
213 | (1) |
|
|
213 | (1) |
|
|
213 | (1) |
|
|
214 | (1) |
|
Your Next Mission: Customizing the Game |
|
|
215 | (1) |
|
|
216 | (1) |
|
|
216 | (1) |
|
A Escape: The Complete Game Listing |
|
|
217 | (28) |
|
B Table Of Variables, Lists, And Dictionaries |
|
|
245 | (4) |
|
C Debugging Your Listings |
|
|
249 | (4) |
|
|
250 | (1) |
|
|
251 | (1) |
|
|
251 | (1) |
|
|
251 | (1) |
|
|
252 | (1) |
|
|
252 | (1) |
|
|
252 | (1) |
Index |
|
253 | |