did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

We're the #1 textbook rental company. Let us show you why.

9781592000739

Python Programming for the Absolute Beginner

by
  • ISBN13:

    9781592000739

  • ISBN10:

    1592000738

  • Edition: CD
  • Format: Paperback
  • Copyright: 2003-08-11
  • Publisher: Cengage Learning Ptr
  • View Upgraded Edition

Note: Supplemental materials are not guaranteed with Rental or Used book purchases.

Purchase Benefits

  • Free Shipping Icon Free Shipping On Orders Over $35!
    Your order must be $35 or more to qualify for free economy shipping. Bulk sales, PO's, Marketplace items, eBooks and apparel do not qualify for this offer.
  • eCampus.com Logo Get Rewarded for Ordering Your Textbooks! Enroll Now
List Price: $29.99 Save up to $7.50
  • Buy Used
    $22.49

    USUALLY SHIPS IN 2-4 BUSINESS DAYS

Supplemental Materials

What is included with this book?

Summary

Ready to learn Python programming? Are you new to programming with Python? Do you need a solid introduction to the fundamental concepts? You've found it in "Python Programming for the Absolute Beginner, Second Edition," the updated version of the successful "Python Programming for the Absolute Beginner." As part of the for the absolute beginner series developed by computer science instructors exclusively for Thomson Course Technology PTR, this book will teach you the basics of Python programming through simple game creation. You can then take the skills you learn and use them for more practical Python programming applications and real-world programming scenarios. Better still, by the time you finish this book you will be able to apply the basic principles you've learned to the next programming language you tackle. Create simple, fun games while you learn to program with Python.

Table of Contents

Introduction xxvii
Getting Started: The Game Over Program
1(16)
Examining the Game Over Program
2(1)
Introducing Python
3(2)
Python Is Easy to Use
3(1)
Python Is Powerful
3(1)
Python Is Object-Oriented
4(1)
Python Is a ``Glue'' Language
4(1)
Python Runs Everywhere
4(1)
Python Has a Strong Community
5(1)
Python Is Free and Open Source
5(1)
Setting Up Python on Windows
5(2)
Installing Python on Windows
6(1)
Setting Up Python on Other Operating Systems
7(1)
Introducing the Python IDLE
8(5)
Programming in Interactive Mode
8(1)
Writing Your First Program
8(1)
Using the print Statement
9(1)
Learning the Jargon
9(1)
Generating an Error
10(1)
Understanding Color Coding
10(1)
Programming in Script Mode
11(1)
Writing Your First Program (Again)
11(1)
Saving and Running Your Program
11(2)
Back to the Game Over Program
13(2)
Using Comments
13(1)
Using Blank Lines
14(1)
Printing the String
14(1)
Waiting for the User
15(1)
Summary
15(2)
Types, Variables, and Simple I/O: The Useless Trivia Program
17(36)
Introducing the Useless Trivia Program
18(1)
Using Quotes with Strings
18(4)
Introducing the Game Over 2.0 Program
18(2)
Using Quotes Inside Strings
20(1)
Continuing a Statement on the Next Line
20(1)
Creating Triple-Quoted Strings
21(1)
Using Escape Sequences with Strings
22(3)
Introducing the Fancy Credits Program
22(1)
Sounding the System Bell
23(1)
Moving Forward a Tab Stop
23(1)
Printing a Backslash
23(1)
Inserting a Newline
24(1)
Inserting a Quote
24(1)
Concatenating and Repeating Strings
25(3)
Introducing the Silly Strings Program
25(2)
Concatenating Strings
27(1)
Suppressing a Newline
27(1)
Repeating Strings
28(1)
Working with Numbers
28(5)
Introducing the Word Problems Program
28(2)
Understanding Numeric Types
30(1)
Using Mathematical Operators
31(2)
Understanding Variables
33(2)
Introducing the Greeter Program
33(1)
Creating Variables
34(1)
Using Variables
34(1)
Naming Variables
34(1)
Getting User Input
35(3)
Introducing the Personal Greeter Program
36(1)
Using the raw_input() Function
36(2)
Using String Methods
38(3)
Introducing the Quotation Manipulation Program
38(1)
Creating New Strings with String Methods
39(2)
Using the Right Types
41(3)
Introducing the Trust Fund Buddy-Bad Program
41(2)
Tracking Down Logical Errors
43(1)
Converting Values
44(3)
Introducing the Trust Fund Buddy-Good Program
44(1)
Converting Strings to Integers
45(1)
Using Augmented Assignment Operators
46(1)
Printing Strings and Numbers Together
47(1)
Back to the Useless Trivia Program
47(4)
Creating the Initial Comments
48(1)
Getting the User Input
48(1)
Printing Lowercase and Uppercase Versions of name
49(1)
Calculating dog_years
49(1)
Calculating seconds
49(1)
Printing name Five Times
50(1)
Calculating moon_weight and sun_weight
50(1)
Waiting for the User
50(1)
Summary
51(2)
Branching, while Loops, and Program Planning: The Guess My Number Game
53(38)
Introducing the Guess My Number Game
54(1)
Generating Random Numbers
54(3)
Introducing the Craps Roller Program
55(1)
Using the import Statement
55(1)
Accessing randrange()
56(1)
Using randrange()
56(1)
Using the if Structure
57(4)
Introducing the Password Program
57(1)
Examining the if Structure
58(1)
Creating Conditions
59(1)
Understanding Comparison Operators
59(1)
Using Indentation to Create Blocks
60(1)
Building Your Own if Structure
61(1)
Using the if-else Structure
61(2)
Introducing the Granted or Denied Program
61(1)
Examining the else Statement
62(1)
Using the if-elif-else Structure
63(4)
Introducing the Mood Computer Program
63(2)
Examining the if-elif-else Structure
65(2)
Creating while Loops
67(3)
Introducing the Three-Year-Old Simulator Program
67(1)
Examining the while Structure
68(1)
Initializing the Sentry Variable
68(1)
Checking the Sentry Variable
69(1)
Updating the Sentry Variable
69(1)
Avoiding Infinite Loops
70(3)
Introducing the Losing Battle Program
70(1)
Tracing the Program
71(1)
Creating Conditions That Can Become False
72(1)
Treating Values as Conditions
73(2)
Introducing the Maitre D' Program
73(1)
Interpreting Any Value as True or False
74(1)
Creating Intentional Infinite Loops
75(3)
Introducing the Finicky Counter Program
75(1)
Understanding True and False
76(1)
Using the break Statement to Exit a Loop
77(1)
Using the continue Statement to Jump Back to the Top of a Loop
77(1)
Understanding When to Use break and continue
78(1)
Using Compound Conditions
78(5)
Introducing the Exclusive Network Program
78(3)
Understanding the not Logical Operator
81(1)
Understanding the and Logical Operator
81(2)
Understanding the or Logical Operator
83(1)
Planning Your Programs
83(2)
Creating Algorithms with Pseudocode
84(1)
Applying Stepwise Refinement to Your Algorithms
84(1)
Returning to the Guess My Number Game
85(3)
Planning the Program
85(1)
Creating the Initial Comment Block
86(1)
Importing the random Module
87(1)
Explaining the Game
87(1)
Setting the Initial Values
87(1)
Creating a Guessing Loop
87(1)
Congratulating the Player
88(1)
Waiting for the Player to Quit
88(1)
Summary
88(3)
for Loops, Strings, and Tuples: The Word Jumble Game
91(36)
Introducing the Word Jumble Game
92(1)
Using for Loops
92(2)
Introducing the Loopy String Program
93(1)
Understanding for Loops
93(1)
Creating a for Loop
94(1)
Counting with a for Loop
94(3)
Introducing the Counter Program
94(2)
Counting Forwards
96(1)
Counting by Fives
96(1)
Counting Backwards
97(1)
Using Sequence Operators and Functions with Strings
97(2)
Introducing the Message Analyzer Program
98(1)
Using the len() Function
98(1)
Using the in Operator
99(1)
Indexing Strings
99(5)
Introducing the Random Access Program
100(1)
Working with Positive Position Numbers
101(1)
Working with Negative Position Numbers
102(1)
Accessing a Random String Element
103(1)
Understanding String Immutability
104(1)
Building a New String
105(3)
Introducing the No Vowels Program
105(1)
Creating Constants
106(1)
Creating New Strings from Existing Ones
107(1)
Slicing Strings
108(5)
Introducing the Pizza Slicer Program
109(1)
Introducing None
110(1)
Understanding Slicing
111(1)
Creating Slices
112(1)
Using Slicing Shorthand
112(1)
Creating Tuples
113(3)
Introducing the Hero's Inventory Program
113(1)
Creating an Empty Tuple
114(1)
Treating a Tuple as a Condition
115(1)
Creating a Tuple with Elements
115(1)
Printing a Tuple
115(1)
Looping Through a Tuple's Elements
116(1)
Using Tuples
116(5)
Introducing the Hero's Inventory 2.0
116(1)
Setting Up the Program
117(1)
Using the len() Function with Tuples
118(1)
Using the in Operator with Tuples
118(1)
Indexing Tuples
118(1)
Slicing Tuples
119(1)
Understanding Tuple Immutability
120(1)
Concatenating Tuples
120(1)
Back to the Word Jumble Game
121(3)
Setting Up the Program
121(1)
Planning the Jumble Creation Section
121(1)
Creating an Empty Jumble String
122(1)
Setting Up the Loop
122(1)
Generating a Random Position in word
123(1)
Creating a New Version of jumble
123(1)
Creating a New Version of word
123(1)
Welcoming the Player
123(1)
Getting the Player's Guess
124(1)
Congratulating the Player
124(1)
Ending the Game
124(1)
Summary
124(3)
Lists and Dictionaries: The Hangman Game
127(36)
Introducing the Hangman Game
128(1)
Using Lists
129(5)
Introducing the Hero's Inventory 3.0 Program
129(1)
Creating a List
130(1)
Using the len() Function with Lists
131(1)
Using the in Operator with Lists
131(1)
Indexing Lists
131(1)
Slicing Lists
131(1)
Concatenating Lists
132(1)
Understanding List Mutability
132(1)
Assigning a New List Element by Index
132(1)
Assigning a New List Slice
133(1)
Deleting a List Element
133(1)
Deleting a List Slice
134(1)
Using List Methods
134(5)
Introducing the High Scores Program
134(1)
Setting Up the Program
135(1)
Displaying the Menu
135(1)
Exiting the Program
136(1)
Displaying the Scores
136(1)
Adding a Score with the append() Function
136(1)
Removing a Score with the remove() Function
137(1)
Sorting the Scores with the sort() Function
137(1)
Reversing the Scores with the reverse() Function
138(1)
Dealing with an Invalid Choice
138(1)
Waiting for the User
138(1)
Understanding When to Use Tuples Instead of Lists
139(1)
Using Nested Sequences
139(5)
Introducing the High Scores 2.0 Program
140(1)
Creating Nested Sequences
140(1)
Accessing Nested Elements
141(1)
Unpacking a Sequence
142(1)
Setting Up the Program
142(1)
Displaying the Scores by Accessing Nested Tuples
143(1)
Adding a Score by Appending a Nested Tuple
143(1)
Dealing with an Invalid Choice
144(1)
Waiting for the User
144(1)
Understanding Shared References
144(3)
Using Dictionaries
147(8)
Introducing the Geek Translator Program
147(1)
Creating Dictionaries
148(1)
Accessing Dictionary Values
149(1)
Using a Key to Retrieve a Value
149(1)
Testing for a Key with the in Operator Before Retrieving a Value
150(1)
Using the get() Method to Retrieve a Value
150(1)
Setting Up the Program
151(1)
Getting a Value
151(1)
Adding a Key-Value Pair
152(1)
Replacing a Key-Value Pair
153(1)
Deleting a Key-Value Pair
153(1)
Wrapping Up the Program
154(1)
Understanding Dictionary Requirements
154(1)
Back to the Hangman Game
155(7)
Setting Up the Program
155(1)
Creating Constants
156(3)
Initializing the Variables
159(1)
Creating the Main Loop
160(1)
Getting the Player's Guess
160(1)
Checking the Guess
161(1)
Ending the Game
161(1)
Summary
162(1)
Functions
163(34)
Introducing the ``Tic-Tac-Toe'' Game
164(1)
Creating Functions
165(3)
Introducing the Instructions Program
165(2)
Defining a Function
167(1)
Documenting a Function
167(1)
Calling a Programmer-Created Function
168(1)
Understanding Abstraction
168(1)
Using Parameters and Return Values
168(6)
Introducing the Receive and Return Program
169(1)
Receiving Information through Parameters
170(1)
Returning Information through Return Values
171(1)
Understanding Encapsulation
171(1)
Receiving and Returning Values in the Same Function
172(1)
Understanding Software Reuse
173(1)
Using Keyword Arguments and Default Parameter Values
174(4)
Introducing the Birthday Wishes Program
174(1)
Using Positional Parameters and Positional Arguments
175(1)
Using Positional Parameters and Keyword Arguments
176(1)
Using Default Parameter Values
176(2)
Using Global Variables and Constants
178(5)
Understanding Namespaces
178(1)
Introducing the Global Reach Program
179(2)
Reading a Global Variable from Inside a Function
181(1)
Shadowing a Global Variable from Inside a Function
181(1)
Changing a Global Variable from Inside a Function
182(1)
Understanding When to Use Global Variables and Constants
182(1)
Back to the Tic-Tac-Toe Game
183(13)
Planning the Tic-Tac-Toe Game
183(1)
Writing the Pseudocode
183(1)
Representing the Data
184(1)
Creating a List of Functions
184(2)
Setting Up the Program
186(1)
The display_instruct() Function
186(1)
The ask_yes_no() Function
187(1)
The ask_number() Function
187(1)
The pieces() Function
187(1)
The new_board() Function
188(1)
The display_board() Function
188(1)
The legal_moves() Function
189(1)
The winner() Function
189(1)
The human_move() Function
190(1)
The computer_move() Function
191(3)
The next_turn() Function
194(1)
The congrat_winner() Function
194(1)
The main() Function
195(1)
Starting the Program
195(1)
Summary
196(1)
Files and Exceptions: The Trivia Challenge Game
197(30)
Introducing the Trivia Challenge Game
198(1)
Reading from Text Files
198(7)
Introducing the Read It Program
199(2)
Opening and Closing a Text File
201(1)
Reading Characters from a Text File
202(1)
Reading Characters from a Line
203(1)
Reading All Lines into a List
204(1)
Looping through a Text File
205(1)
Writing to a Text File
205(3)
Introducing the Write It Program
205(1)
Writing Strings to a Text File
206(1)
Writing a List of Strings to a Text File
207(1)
Storing Complex Data in Files
208(5)
Introducing the Pickle It Program
209(1)
Pickling Data and Writing It to a File
209(2)
Reading Data from a File and Unpickling It
211(1)
Using a Shelf to Store Pickled Data
211(1)
Using a Shelf to Retrieve Pickled Data
212(1)
Handling Exceptions
213(5)
Introducing the Handle It Program
214(1)
Using a try Statement with an except Clause
214(1)
Specifying an Exception Type
215(2)
Handling Multiple Exception Types
217(1)
Getting an Exception's Argument
218(1)
Adding an else Clause
218(1)
Back to the Trivia Challenge Game
218(6)
Understanding the Data File Layout
219(1)
The open_file() Function
220(1)
The next_line() Function
221(1)
The next_block() Function
221(1)
The welcome() Function
222(1)
Setting Up the Game
222(1)
Asking a Question
223(1)
Getting an Answer
223(1)
Checking an Answer
223(1)
Getting the Next Question
224(1)
Ending the Game
224(1)
Starting the main() Function
224(1)
Summary
224(3)
Software Objects: The Critter Caretaker Program
227(32)
Introducing the Critter Caretaker Program
228(1)
Understanding Object-Oriented Basics
229(1)
Creating Classes, Methods, and Objects
230(3)
Introducing the Simple Critter Program
230(1)
Defining a Class
231(1)
Defining a Method
232(1)
Instantiating an Object
232(1)
Invoking a Method
233(1)
Using Constructors
233(2)
Introducing the Constructor Critter Program
233(1)
Creating a Constructor
234(1)
Creating Multiple Objects
235(1)
Using Attributes
235(4)
Introducing the Attribute Critter Program
235(2)
Initializing Attributes
237(1)
Accessing Attributes
238(1)
Printing an Object
239(1)
Using Class Attributes and Static Methods
239(4)
Introducing the Classy Critter Program
240(1)
Creating a Class Attribute
241(1)
Accessing a Class Attribute
241(1)
Creating a Static Method
242(1)
Invoking a Static Method
243(1)
Understanding Object Encapsulation
243(1)
Using Private Attributes and Private Methods
244(5)
Introducing the Private Critter Program
244(1)
Creating Private Attributes
245(1)
Accessing Private Attributes
245(1)
Creating Private Methods
246(1)
Accessing Private Methods
247(1)
Respecting an Object's Privacy
248(1)
Understanding When to Implement Privacy
248(1)
Understanding New-Style and Old-Style Classes
249(1)
Controlling Attribute Access
249(4)
Introducing the Property Critter
249(1)
Using Get Methods
250(1)
Using Set Methods
251(1)
Using Properties
251(2)
Back to the Critter Caretaker Program
253(4)
The Critter Class
253(1)
The Constructor Method
253(1)
The__pass_time() Method
254(1)
The mood Property
254(1)
The talk() Method
255(1)
The eat() Method
255(1)
The play() Method
255(1)
Creating the Critter
256(1)
Creating a Menu System
256(1)
Starting the Program
257(1)
Summary
257(2)
Object-Oriented Programming: The Blackjack Game
259(40)
Introducing the Blackjack Game
260(1)
Sending and Receiving Messages
261(3)
Introducing the Alien Blaster Program
261(2)
Sending a Message
263(1)
Receiving a Message
264(1)
Combining Objects
264(4)
Introducing the Playing Cards Program
264(1)
Creating the Card Class
265(1)
Creating the Hand Class
266(1)
Using Card Objects
267(1)
Combining Card Objects Using a Hand Object
267(1)
Using Inheritance to Create New Classes
268(1)
Extending a Class through Inheritance
269(6)
Introducing the Playing Cards 2.0 Program
269(1)
Creating a Base Class
270(1)
Inheriting from a Base Class
271(1)
Extending a Derived Class
272(1)
Using the Derived Class
273(2)
Altering the Behavior of Inherited Methods
275(5)
Introducing the Playing Cards 3.0 Program
275(1)
Creating a Base Class
276(1)
Overriding Base Class Methods
276(1)
Invoking Base Class Methods
277(2)
Using the Derived Classes
279(1)
Understanding Polymorphism
280(1)
Creating Modules
280(5)
Introducing the Simple Game Program
281(1)
Writing Modules
281(2)
Importing Modules
283(1)
Using Imported Functions and Classes
284(1)
Back to the Blackjack Game
285(13)
The Cards Module
285(2)
Designing the Classes
287(1)
Writing Pseudocode for the Game Loop
288(1)
Importing the cards and games Modules
289(1)
The BJ_Card Class
290(1)
The BJ_Deck Class
290(1)
The BJ_Hand Class
291(2)
The BJ_Player Class
293(1)
The BJ_Dealer Class
293(1)
The BJ_Game Class
294(1)
The__init__() Method
294(1)
The still_playing Property
295(1)
The __additional_cards() Method
295(1)
The play() Method
296(1)
The main() Function
297(1)
Summary
298(1)
GUI Development: The Mad Lib Program
299(38)
Introducing the Mad Lib Program
300(1)
Examining a GUI
301(1)
Understanding Event-Driven Programming
302(2)
Using a Root Window
304(3)
Introducing the Simple GUI Program
304(1)
Importing the Tkinter Module
305(1)
Creating a Root Window
306(1)
Modifying a Root Window
306(1)
Entering a Root Window's Event Loop
306(1)
Using Labels
307(2)
Introducing the Labeler Program
307(1)
Setting Up the Program
307(1)
Creating a Frame
308(1)
Creating a Label
308(1)
Entering the Root Window's Event Loop
309(1)
Using Buttons
309(2)
Introducing the Lazy Buttons Program
309(1)
Setting Up the Program
309(1)
Creating Buttons
310(1)
Entering the Root Window's Event Loop
311(1)
Creating a GUI Using a Class
311(3)
Introducing the Lazy Buttons 2 Program
311(1)
Importing the Tkinter Module
312(1)
Defining the Application Class
312(1)
Defining a Constructor Method
312(1)
Defining a Method to Create the Widgets
313(1)
Creating the Application Object
313(1)
Binding Widgets and Event Handlers
314(2)
Introducing the Click Counter Program
314(1)
Setting Up the Program
314(1)
Binding the Event Handler
315(1)
Creating the Event Handler
315(1)
Wrapping Up the Program
316(1)
Using Text and Entry Widgets and the Grid Layout Manager
316(6)
Introducing the Longevity Program
316(1)
Setting Up the Program
317(1)
Placing a Widget with the Grid Layout Manager
318(1)
Creating an Entry Widget
319(1)
Creating a Text Widget
320(1)
Getting and Inserting Text with Text-Based Widgets
320(1)
Wrapping Up the Program
321(1)
Using Check Buttons
322(4)
Introducing the Movie Chooser Program
322(1)
Setting Up the Program
322(1)
Allowing a Widget's Master to Be Its Only Reference
323(1)
Creating Check Buttons
324(1)
Getting the Status of a Check Button
325(1)
Wrapping Up the Program
326(1)
Using Radio Buttons
326(4)
Introducing the Movie Chooser 2 Program
326(1)
Setting Up the Program
327(1)
Creating Radio Buttons
328(1)
Getting a Value from a Group of Radio Buttons
329(1)
Wrapping Up the Program
330(1)
Back to the Mad Lib Program
330(4)
Importing the Tkinter Module
330(1)
The Application Class's Constructor Method
330(1)
The Application Class's create_widgets() Method
331(2)
The Application Class's tell_story() Method
333(1)
The Main Part of the Program
334(1)
Summary
334(3)
Graphics: The Pizza Panic Game
337(40)
Introducing the Pizza Panic Game
338(1)
Introducing the Pygame and LiveWires Packages
339(1)
Creating a Graphics Window
340(3)
Introducing the New Graphics Window Program
340(1)
Importing the games Module
341(1)
Defining Global Constants
342(1)
Creating a Screen Object
342(1)
Invoking a Screen Object's mainloop() Method
343(1)
Setting a Background Image
343(2)
Introducing the Background Image Program
344(1)
Loading an Image
344(1)
Setting the Background
345(1)
Understanding the Graphics Coordinate System
345(1)
Displaying Text
346(2)
Introducing the Big Score Program
346(1)
Importing the color Module
347(1)
Creating a Text Object
347(1)
Displaying a Message
348(2)
Introducing the You Won Program
348(1)
Creating a Message Object
349(1)
Understanding the Games_Object Class
350(1)
Displaying a Sprite
350(6)
Introducing the Pizza Sprite Program
352(1)
Setting Up the Program
353(1)
Creating the Pizza Class
353(1)
Setting Up the Screen
353(1)
Loading an Image for a Sprite
354(2)
Creating a Sprite
356(1)
Wrapping Up
356(1)
Moving Sprites
356(2)
Introducing the Falling Pizza Program
357(1)
Modifying the Pizza Class
357(1)
Passing Values to dx and dy
358(1)
Dealing with Screen Boundaries
358(2)
The Bouncing Pizza Program
359(1)
Writing the moved() Method
359(1)
Creating the Bouncing Pizza Object
360(1)
Handling Mouse Input
360(3)
Introducing the Moving Pan Program
361(1)
Setting Up the Program
361(1)
Creating the Pan Class
362(1)
Writing the Main Program
362(1)
Detecting Collisions
363(3)
Introducing the Slippery Pizza Program
363(1)
Setting Up the Program
364(1)
Creating the Pan Class
364(1)
Creating the Pizza Class
365(1)
Writing the Main Program
366(1)
Back to the Pizza Panic Game
366(9)
Setting Up the Program
367(1)
The Pan Class
367(1)
Loading the Pan Image
367(1)
The _init_() Method
368(1)
The moved() Method
368(1)
The check_for_catch() Method
369(1)
The handle_caught() Method
369(1)
The Pizza Class
369(1)
The _init_() Method
370(1)
The moved() Method
370(1)
The handle_caught() Method
370(1)
The game_over() Method
371(1)
The Chef Class
372(1)
The _init_() Method
372(1)
The moved() Method
373(1)
The reverse() Method
373(1)
The drop_pizza() Method
374(1)
The main() Function
374(1)
Summary
375(2)
Sound, Animation, and Program Development: The Astrocrash Game
377(46)
Introducing the Astrocrash Game
378(1)
Reading the Keyboard
379(3)
Introducing the Read Key Program
379(1)
Setting Up the Program
380(1)
Creating the Ship Class
380(1)
Testing for Keystrokes
381(1)
Wrapping Up the Program
382(1)
Rotating a Sprite
382(2)
Introducing the Rotate Sprite Program
383(1)
Rotating a Sprite by a Number of Degrees
383(1)
Rotating a Sprite to a Specific Orientation
384(1)
Creating an Animation
384(3)
Introducing the Explosion Program
384(1)
Examining the Explosion Images
385(1)
Setting Up the Program
386(1)
Creating a List of Image Files
386(1)
Creating an Animation Object
387(1)
Working with Sound and Music
387(6)
Introducing the Sound and Music Program
388(1)
Working with Sounds
388(1)
Loading a Sound
388(1)
Playing a Sound
389(1)
Looping a Sound
390(1)
Stopping a Sound
390(1)
Working with Music
391(1)
Loading Music
391(1)
Playing Music
391(1)
Looping Music
392(1)
Stopping Music
392(1)
Wrapping Up the Program
392(1)
Planning the Astrocrash Game
393(1)
Game Features
393(1)
Game Classes
394(1)
Game Assets
394(1)
Creating Asteroids
394(3)
The Astrocrash01 Program
394(1)
Setting Up the Program
395(1)
The Asteroid Class
395(2)
The Main Section
397(1)
Rotating the Ship
397(2)
The Astrocrash02 Program
397(1)
The Ship Class
398(1)
Instantiating a Ship Object
399(1)
Moving the Ship
399(3)
The Astrocrash03 Program
399(1)
Importing the math Module
400(1)
Adding Ship Class Variables
400(1)
Updating Ship's moved() Method
400(2)
Firing Missiles
402(3)
The Astrocrash04 Program
402(1)
Updating Ship's moved() Method
402(1)
The Missile Class
403(2)
Controlling the Missile Fire Rate
405(2)
The Astrocrash05 Program
405(1)
Adding a Ship Class Constant
406(1)
Updating Ship's Constructor Method
406(1)
Updating Ship's moved() Method
407(1)
Handling Collisions
407(3)
The Astrocrash06 Program
407(1)
Updating Missile's moved() Method
408(1)
Adding Missile's die() Method
408(1)
Updating Ship's moved() Method
409(1)
Adding Ship's die() Method
409(1)
Adding Asteroid's die() Method
409(1)
Adding Explosions
410(5)
The Astrocrash07 Program
410(1)
The Wrapper Class
411(1)
The Collider Class
411(1)
Updating the Asteroid Class
412(1)
Updating the Ship Class
413(1)
Updating the Missile Class
413(1)
The Explosion Class
414(1)
Adding Levels, Scorekeeping, and Theme Music
415(6)
The Astrocrash08 Program
415(1)
Adding an Asteroid Class Variable
415(1)
Updating Asteroid's Constructor Method
416(1)
Updating Asteroid's die() Method
416(1)
Adding a Ship Class Variable
416(1)
Updating Ship's moved() Method
416(1)
Adding Ship's die() Method
417(1)
Adding Ship's game_over() Method
417(1)
The Game Class
417(3)
The main() Function
420(1)
Starting the Program
421(1)
Summary
421(2)
APPENDIX A LiveWires Reference
423(14)
games Module Classes
424(6)
The Screen Class
424(1)
The Games_Object Class
424(3)
The Text Class
427(1)
The Message Class
428(1)
The Sprite Class
429(1)
The Animation Class
429(1)
games Module Functions
430(2)
games Module Constants
432(4)
color Module Constants
436(1)
Index 437

Supplemental Materials

What is included with this book?

The New copy of this book will include any supplemental materials advertised. Please check the title of the book to determine if it should include any access cards, study guides, lab manuals, CDs, etc.

The Used, Rental and eBook copies of this book are not guaranteed to include any supplemental materials. Typically, only the book itself is included. This is true even if the title states it includes any access cards, study guides, lab manuals, CDs, etc.

Rewards Program