| |
| |
Preface | |
| |
| |
| |
Introduction to Standard C++ | |
| |
| |
| |
Introduction to Computers and Programming | |
| |
| |
| |
Introduction | |
| |
| |
| |
Hardware | |
| |
| |
| |
How Computers Store Data | |
| |
| |
| |
How a Program Works | |
| |
| |
| |
C++ and the App Game Kit Library | |
| |
| |
In The Spotlight: Writing Your First Program with Visual C++ 2010 Express | |
| |
| |
In The Spotlight: Opening and Executing an Example Program | |
| |
| |
Review Questions | |
| |
| |
Programming Exercises | |
| |
| |
| |
C++ Fundamentals | |
| |
| |
| |
The Parts of a C++ Program | |
| |
| |
| |
Displaying Screen Output | |
| |
| |
| |
More about the #include Directive | |
| |
| |
| |
A First Look at Variables | |
| |
| |
| |
Reading Keyboard Input | |
| |
| |
| |
Comments, Blank Lines, and Indentation | |
| |
| |
| |
Performing Calculations and Working with Numbers | |
| |
| |
In The Spotlight: Calculating Percentages and Discounts | |
| |
| |
In The Spotlight: Calculating an Average | |
| |
| |
| |
Named Constants | |
| |
| |
| |
Math Functions in the Standard Library | |
| |
| |
| |
Working with Strings | |
| |
| |
| |
The char Data Type | |
| |
| |
Review Questions | |
| |
| |
Programming Exercises | |
| |
| |
| |
Decision Structures and Boolean Logic | |
| |
| |
| |
Control Structures | |
| |
| |
| |
Writing a Decision Structure with the if Statement | |
| |
| |
In The Spotlight: Using the if Statement | |
| |
| |
| |
The if-else Statement | |
| |
| |
In The Spotlight: Using the if-else Statement | |
| |
| |
| |
Nested Decision Structures and the if-else-if Statement | |
| |
| |
In The Spotlight: Multiple Nested Decision Structures | |
| |
| |
| |
Logical Operators | |
| |
| |
| |
The switch Statement | |
| |
| |
In The Spotlight: Using a switch Statement | |
| |
| |
| |
bool Variables | |
| |
| |
| |
Comparing Strings | |
| |
| |
Review Questions | |
| |
| |
Programming Exercises | |
| |
| |
| |
Repetition Structures | |
| |
| |
| |
Introduction to Repetition Structures | |
| |
| |
| |
Condition-Controlled Loops: The while and do-while Loops | |
| |
| |
In The Spotlight: Writing a Program with a while Loop | |
| |
| |
| |
The Increment and Decrement Operators | |
| |
| |
| |
Count-Controlled Loops: The for Loop | |
| |
| |
In The Spotlight: Writing a Count-Controlled for Loop | |
| |
| |
| |
Calculating a Running Total | |
| |
| |
| |
Nested Loops | |
| |
| |
In The Spotlight: Using Nested Loops to Print Patterns | |
| |
| |
Review Questions | |
| |
| |
Programming Exercises | |
| |
| |
| |
Functions | |
| |
| |
| |
Introduction to Functions | |
| |
| |
| |
void Functions | |
| |
| |
| |
Local Variables | |
| |
| |
| |
Passing Arguments to Functions | |
| |
| |
| |
Global Variables and Global Constants | |
| |
| |
In The Spotlight: Using Global Constants and Reference Parameters | |
| |
| |
| |
Value-Returning Functions | |
| |
| |
In The Spotlight: Writing Value-Returning Functions | |
| |
| |
| |
Calling string Class Member Functions | |
| |
| |
Review Questions | |
| |
| |
Programming Exercises | |
| |
| |
| |
Arrays | |
| |
| |
| |
Array Basics | |
| |
| |
In The Spotlight: Using Array Elements in a Math Expression | |
| |
| |
| |
Sequentially Searching an Array | |
| |
| |
| |
Processing the Contents of an Array | |
| |
| |
In The Spotlight: Processing an Array | |
| |
| |
| |
Parallel Arrays | |
| |
| |
| |
Two-Dimensional Arrays | |
| |
| |
| |
Arrays of Three or More Dimensions | |
| |
| |
Review Questions | |
| |
| |
Programming Exercises | |
| |
| |
| |
Introduction to Game Programming With C++ and App Game Kit | |
| |
| |
| |
Using the App Game Kit with C++ | |
| |
| |
| |
The App Game Kit and the Structure of a Game Program | |
| |
| |
Tutorial: Copying the AGK Template Project and Opening It in Visual Studio | |
| |
| |
| |
The Screen Coordinate System | |
| |
| |
| |
Displaying Sprites | |
| |
| |
| |
Working in the Game Loop | |
| |
| |
| |
Working with Colors and Transparency | |
| |
| |
| |
Displaying Text in the AGK Window | |
| |
| |
| |
Generating Random Numbers | |
| |
| |
In The Spotlight: Using Random Numbers to Position a Sprite and Set its Transparency | |
| |
| |
Review Questions | |
| |
| |
Programming Exercises | |
| |
| |
| |
Input, Animation, and Sound | |
| |
| |
| |
The Mouse | |
| |
| |
| |
Virtual Buttons | |
| |
| |
| |
Virtual Joysticks | |
| |
| |
| |
The Keyboard | |
| |
| |
| |
Animation | |
| |
| |
| |
Music and Sound | |
| |
| |
| |
The Bug Zapper Game | |
| |
| |
In The Spotlight: The Bug Zapper Game | |
| |
| |
Review Questions | |
| |
| |
Programming Exercises | |
| |
| |
| |
Text, Collisions, and the Vulture Trouble Game | |
| |
| |
| |
Text Objects | |
| |
| |
| |
Sprite Collision Detection | |
| |
| |
In The Spotlight: The PizzaBot Game | |
| |
| |
| |
Simulating Falling Objects | |
| |
| |
| |
The Vulture Trouble Game | |
| |
| |
Review Questions | |
| |
| |
Programming Exercises | |
| |
| |
| |
Using Files and Arrays with the AGK | |
| |
| |
| |
File Input and Output | |
| |
| |
In The Spotlight: Saving a Game's High Score | |
| |
| |
In The Spotlight: Detecting the End of a File | |
| |
| |
In The Spotlight: Writing a Log File | |
| |
| |
| |
Using Arrays in an AGK Program | |
| |
| |
In The Spotlight: Using an Array as a Deck of Cards | |
| |
| |
In The Spotlight: Shuffling an Array | |
| |
| |
| |
Tile Maps | |
| |
| |
Review Questions | |
| |
| |
Programming Exercises | |
| |
| |
| |
Object-Oriented Programming | |
| |
| |
| |
Procedural and Object-Oriented Programming | |
| |
| |
| |
Classes and Objects | |
| |
| |
| |
Inheritance | |
| |
| |
In The Spotlight: An Object-Oriented Game: Balloon Target | |
| |
| |
Review Questions | |
| |
| |
Programming Exercises | |
| |
| |
| |
Downloading and Installing the Required Software | |
| |
| |
Index | |
| |
| |
Credits | |