You are previewing Beginning C++ Through Game Programming, Fourth Edition.
O'Reilly logo
Beginning C++ Through Game Programming, Fourth Edition

Book Description

When it comes to game programming, C++ is the name of the game. If you aspire to move from game player to game creator, it all starts with learning the fundamentals of C++ and game-programming basics. With BEGINNING C++ THROUGH GAME PROGRAMMING, FOURTH EDITION, you will find an up-to-date and thorough introduction to everything you need to get started-with no previous programming experience required. In the new fourth edition of this popular guide to learning C++, you will work with a complete program while learning each new concept and a game program at the end of each chapter. A final game project at the end of the book draws together everything you've learned. Written with the beginning programmer in mind, BEGINNING C++ THROUGH GAME PROGRAMMING, FOURTH EDITION is a great way to get started in game programming

Table of Contents

  1. Title Page
  2. Copyright Page
  3. Dedication
  4. Acknowledgments
  5. About the Author
  6. Contents
  7. Introduction
  8. Chapter 1 Types, Variables, and Standard I/O: Lost Fortune
    1. Introducing C++
    2. Writing Your First C++ Program
    3. Working with the std Namespace
    4. Using Arithmetic Operators
    5. Declaring and Initializing Variables
    6. Performing Arithmetic Operations with Variables
    7. Working with Constants
    8. Introducing Lost Fortune
    9. Summary
    10. Questions and Answers
    11. Discussion Questions
    12. Exercises
  9. Chapter 2 Truth, Branching, and the Game Loop: Guess My Number
    1. Understanding Truth
    2. Using the if Statement
    3. Using the else Clause
    4. Using a Sequence of if Statements with else Clauses
    5. Using the switch Statement
    6. Using while Loops
    7. Using do Loops
    8. Using break and continue Statements
    9. Using Logical Operators
    10. Generating Random Numbers
    11. Understanding the Game Loop
    12. Introducing Guess My Number
    13. Summary
    14. Questions and Answers
    15. Discussion Questions
    16. Exercises
  10. Chapter 3 for Loops, Strings, and Arrays: Word Jumble
    1. Using for Loops
    2. Understanding Objects
    3. Using string Objects
    4. Using Arrays
    5. Understanding C-Style Strings
    6. Using Multidimensional Arrays
    7. Introducing Word Jumble
    8. Summary
    9. Questions and Answers
    10. Discussion Questions
    11. Exercises
  11. Chapter 4 The Standard Template Library: Hangman
    1. Introducing the Standard Template Library
    2. Using Vectors
    3. Using Iterators
    4. Using Algorithms
    5. Understanding Vector Performance
    6. Examining Other STL Containers
    7. Planning Your Programs
    8. Introducing Hangman
    9. Summary
    10. Questions and Answers
    11. Discussion Questions
    12. Exercises
  12. Chapter 5 Functions: Mad Lib
    1. Creating Functions
    2. Using Parameters and Return Values
    3. Understanding Software Reuse
    4. Working with Scopes
    5. Using Global Variables
    6. Using Global Constants
    7. Using Default Arguments
    8. Overloading Functions
    9. Inlining Functions
    10. Introducing the Mad Lib Game
    11. Summary
    12. Questions and Answers
    13. Discussion Questions
    14. Exercises
  13. Chapter 6 References: Tic-Tac-Toe
    1. Using References
    2. Passing References to Alter Arguments
    3. Passing References for Efficiency
    4. Deciding How to Pass Arguments
    5. Returning References
    6. Introducing the Tic-Tac-Toe Game
    7. Summary
    8. Questions and Answers
    9. Discussion Questions
    10. Exercises
  14. Chapter 7 Pointers: Tic-Tac-Toe 2.0
    1. Understanding Pointer Basics
    2. Understanding Pointers and Constants
    3. Passing Pointers
    4. Returning Pointers
    5. Understanding the Relationship between Pointers and Arrays
    6. Introducing the Tic-Tac-Toe 2.0 Game
    7. Summary
    8. Questions and Answers
    9. Discussion Questions
    10. Exercises
  15. Chapter 8 Classes: Critter Caretaker
    1. Defining New Types
    2. Using Constructors
    3. Setting Member Access Levels
    4. Using Static Data Members and Member Functions
    5. Introducing the Critter Caretaker Game
    6. Summary
    7. Questions and Answers
    8. Discussion Questions
    9. Exercises
  16. Chapter 9 Advanced Classes and Dynamic Memory: Game Lobby
    1. Using Aggregation
    2. Using Friend Functions and Operator Overloading
    3. Dynamically Allocating Memory
    4. Working with Data Members and the Heap
    5. Introducing the Game Lobby Program
    6. Summary
    7. Questions and Answers
    8. Discussion Questions
    9. Exercises
  17. Chapter 10 Inheritance and Polymorphism: Blackjack
    1. Introducing Inheritance
    2. Controlling Access under Inheritance
    3. Calling and Overriding Base Class Member Functions
    4. Using Overloaded Assignment Operators and Copy Constructors in Derived Classes
    5. Introducing Polymorphism
    6. Using Abstract Classes
    7. Introducing the Blackjack Game
    8. Summary
    9. Questions and Answers
    10. Discussion Questions
    11. Exercises
  18. Appendix A Creating Your First C++ Program
  19. Appendix B Operator Precedence
  20. Appendix C Keywords
  21. Appendix D ASCII Chart
  22. Appendix E Escape Sequences
  23. Index