|
|
|
Copyright
|
|
|
|
Acknowledgments
|
|
|
|
Introduction
|
|
|
|
|
What's Different About This Book
|
|
|
|
|
What's in This Book?
|
|
|
|
|
System Requirements
|
|
|
|
|
Free Stuff on the CD
|
|
|
|
|
Who Am I?
|
|
|
|
Part 1: The Really Basic Stuff
|
|
|
|
|
Chapter 1. What it Takes to be a Game Programmer
|
|
|
|
|
Programming Skills
|
|
|
|
|
Computer Graphics Skills
|
|
|
|
|
Game Design Skills
|
|
|
|
|
Art Skills
|
|
|
|
|
Sound and Music Skills
|
|
|
|
|
Summary
|
|
|
|
|
Chapter 2. Writing C++ Programs
|
|
|
|
|
Introducing the Dev-C++ Compiler
|
|
|
|
|
Programming in C++
|
|
|
|
|
Essential Math Operators
|
|
|
|
|
Loops
|
|
|
|
|
While Loops
|
|
|
|
|
Do-while loops
|
|
|
|
|
Windows Programming
|
|
|
|
|
Game Programming
|
|
|
|
|
Summary
|
|
|
|
Part 2: ObjectOriented Programming in Games
|
|
|
|
|
Chapter 3. Introducing Object-Oriented Programming
|
|
|
|
|
Software Objects
|
|
|
|
|
Classes
|
|
|
|
|
Logical Operators
|
|
|
|
|
The If-Else Statement
|
|
|
|
|
Namespaces and Scope Resolution
|
|
|
|
|
A Brief Word About Structures
|
|
|
|
|
Summary
|
|
|
|
|
Chapter 4. Introducing the LlamaWorks2D Game Engine
|
|
|
|
|
A Step-by-Step Overview
|
|
|
|
|
How Does Llamaworks2D Work?
|
|
|
|
|
A Stationary Ball
|
|
|
|
|
A Bouncing Ball
|
|
|
|
|
Getting Good Results
|
|
|
|
|
Summary
|
|
|
|
|
Chapter 5. Function and Operator Overloading
|
|
|
|
|
What Is Overloading?
|
|
|
|
|
Implementing a Vector Class with Overloading
|
|
|
|
|
Summary
|
|
|
|
|
Chapter 6. Inheritance: Getting a Lot for a Little
|
|
|
|
|
What Is Inheritance?
|
|
|
|
|
Deriving Classes
|
|
|
|
|
Protected Members
|
|
|
|
|
Overriding Base Class Functions
|
|
|
|
|
Customizing Your Game with Inheritance
|
|
|
|
|
Summary
|
|
|
|
Part 3: The Essentials of Game Development
|
|
|
|
|
Chapter 7. Program Structure
|
|
|
|
|
Program Structure
|
|
|
|
|
File Structure
|
|
|
|
|
A Game Called Ping
|
|
|
|
|
Summary
|
|
|
|
|
Chapter 8. Sound Effects and Music
|
|
|
|
|
Sound Effects and Music Are Emotion
|
|
|
|
|
Storing Sound Data
|
|
|
|
|
Sound Effects in LlamaWorks2D
|
|
|
|
|
Noise, Sweet Noise
|
|
|
|
|
Play That Funky Music, Geek Boy
|
|
|
|
|
Summary
|
|
|
|
Part 4: Graduating to Better C++
|
|
|
|
|
Chapter 9. Floating-Point Math in C++
|
|
|
|
|
Getting into the Guts of Floating-Point Numbers
|
|
|
|
|
Case Study: Floating-Point Numbers and Gamespaces
|
|
|
|
|
Summary
|
|
|
|
|
Chapter 10. Arrays
|
|
|
|
|
What Are Arrays?
|
|
|
|
|
Declaring and Using Arrays
|
|
|
|
|
Initializing Arrays
|
|
|
|
|
Problems with Array Boundaries
|
|
|
|
|
Summary
|
|
|
|
|
Chapter 11. Pointers
|
|
|
|
|
Why Are Pointers Important to Games?
|
|
|
|
|
Declaring and Using Pointers
|
|
|
|
|
Pointers and Dynamic Memory Allocation
|
|
|
|
|
Pointers and Inheritance
|
|
|
|
|
Arrays Are Pointers in Disguise
|
|
|
|
|
Summary
|
|
|
|
|
Chapter 12. File Input and Output
|
|
|
|
|
Games and File I/O
|
|
|
|
|
Types of Files
|
|
|
|
|
Summary
|
|
|
|
|
Chapter 13. Moving into Real Game Development
|
|
|
|
|
Sprites that Come Alive
|
|
|
|
|
High-Speed Input
|
|
|
|
|
Summary
|
|
|
|
Part 5: The Big Payoff
|
|
|
|
|
Chapter 14. No Slime Allowed: Invasion of the Slugwroths
|
|
|
|
|
What It Takes to Make a Real Game
|
|
|
|
|
Essential Game Design
|
|
|
|
|
Designing Invasion of the Slugwroths
|
|
|
|
|
Summary
|
|
|
|
|
Chapter 15. Captain Chloride Gets Going
|
|
|
|
|
Introducing Captain Chloride
|
|
|
|
|
Pulling It Together In The Game Class
|
|
|
|
|
Summary
|
|
|
|
|
Chapter 16. The World of Captain Chloride
|
|
|
|
|
The New Captain Chloride
|
|
|
|
|
Levels in LlamaWorks2D
|
|
|
|
|
Summary
|
|
|
|
|
Chapter 17. Captain Chloride Encounters Solid Objects
|
|
|
|
|
Bumping into a Solid Door
|
|
|
|
|
Picking Up a Key
|
|
|
|
|
Making the Door Open and Close
|
|
|
|
|
Summary
|
|
|
|
|
Chapter 18. That's a Wrap!
|
|
|
|
|
Time for Consolidation
|
|
|
|
|
Enter
villains
, Stage Left
|
|
|
|
|
Additions to the Game
|
|
|
|
|
Epilogue: Not the End
|
|
|
|
Glossary
|
|
|
|
Index
|