چه کسانی این کتاب را می‌خوانند

دانشجوعلاقه‌مند یادگیری
کتابخوان حرفه‌ایلذت مطالعه
نویسندهالهام‌گیری

Beginning C++ Through Game Programming, 3rd Edition

Dawson, Michael

قیمت نهایی

۴۹٬۰۰۰ تومان

نسخه اصلی و اورجینال

بلافاصله پس از خرید، فایل کتاب روی دستگاه شما آمادهٔ دانلود است.

تحویل فوری
پرداخت امن
ضمانت فایل
پشتیبانی

مشخصات کتاب

نویسنده
Dawson, Michael
سال انتشار
۲۰۱۱
فرمت
PDF
زبان
انگلیسی
حجم فایل
۴٫۵ مگابایت
شابک
9781435457423، 9781435457430، 1435457420، 1435457439

دربارهٔ کتاب

BEGINNING C++ THROUGH GAME PROGRAMMING, THIRD EDITION approaches learning C++ from the unique and fun perspective of games. Written for the beginning game developer or programmer, the book assumes no previous programming experience and each new skill and concept is taught using simple language and step-by-step instructions. Readers will complete small projects in each chapter to reinforce what they've learned and a final project at the end combines all of the major topics covered in the book. Featuring twenty five percent new material, this third edition covers all the latest technology and advances. Contents 7 Introduction 19 Chapter 1 Types, Variables, and Standard I/O: Lost Fortune 24 Introducing C++ 24 Using C++ for Games 25 Creating an Executable File 25 Dealing with Errors 27 Understanding the ISO Standard 28 Writing Your First C++ Program 28 Introducing the Game Over Program 28 Commenting Code 30 Using Whitespace 30 Including Other Files 30 Defining the main() Function 31 Displaying Text through the Standard Output 31 Terminating Statements 32 Returning a Value from main() 33 Working with the std Namespace 33 Introducing the Game Over 2.0 Program 33 Employing a using Directive 34 Introducing the Game Over 3.0 Program 34 Employing using Declarations 35 Understanding When to Employ using 35 Using Arithmetic Operators 36 Introducing the Expensive Calculator Program 36 Adding, Subtracting, and Multiplying 37 Understanding Integer and Floating Point Division 37 Using the Modulus Operator 38 Understanding Order of Operations 38 Declaring and Initializing Variables 39 Introducing the Game Stats Program 39 Understanding Fundamental Types 41 Understanding Type Modifiers 41 Declaring Variables 42 Naming Variables 43 Assigning Values to Variables 44 Initializing Variables 45 Displaying Variable Values 45 Getting User Input 46 Defining New Names for Types 46 Understanding Which Types to Use 47 Performing Arithmetic Operations with Variables 47 Introducing the Game Stats 2.0 Program 47 Altering the Value of a Variable 49 Using Combined Assignment Operators 49 Using Increment and Decrement Operators 50 Dealing with Integer Wrap Around 51 Working with Constants 52 Introducing the Game Stats 3.0 Program 52 Using Constants 54 Using Enumerations 54 Introducing Lost Fortune 55 Setting Up the Program 55 Getting Information from the Player 56 Telling the Story 57 Summary 58 Questions and Answers 59 Discussion Questions 61 Exercises 61 Chapter 2 Truth, Branching, and the Game Loop: Guess My Number 62 Understanding Truth 62 Using the if Statement 63 Introducing the Score Rater Program 64 Testing true and false 65 Interpreting a Value as true or false 66 Using Relational Operators 67 Nesting if Statements 67 Using the else Clause 68 Introducing the Score Rater 2.0 Program 69 Creating Two Ways to Branch 70 Using a Sequence of if Statements with else Clauses 71 Introducing the Score Rater 3.0 Program 72 Creating a Sequence of if Statements with else Clauses 73 Using the switch Statement 74 Introducing the Menu Chooser Program 75 Creating Multiple Ways to Branch 77 Using while Loops 77 Introducing the Play Again Program 77 Looping with a while Loop 78 Using do Loops 79 Introducing the Play Again 2.0 Program 79 Looping with a do Loop 80 Using break and continue Statements 81 Introducing the Finicky Counter Program 81 Creating a while (true) Loop 83 Using the break Statement to Exit a Loop 83 Using the continue Statement to Jump Back to the Top of a Loop 84 Understanding When to Use break and continue 84 Using Logical Operators 84 Introducing the Designers Network Program 84 Using the Logical AND Operator 88 Using the Logical OR Operator 88 Using the Logical NOT Operator 89 Understanding Order of Operations 90 Generating Random Numbers 91 Introducing the Die Roller Program 91 Calling the rand() Function 92 Seeding the Random Number Generator 93 Calculating a Number within a Range 94 Understanding the Game Loop 95 Introducing Guess My Number 96 Applying the Game Loop 97 Setting Up the Game 97 Creating the Game Loop 99 Wrapping Up the Game 99 Summary 99 Questions and Answers 101 Discussion Questions 103 Exercises 103 Chapter 3 For Loops, Strings, and Arrays: Word Jumble 104 Using for Loops 104 Introducing the Counter Program 105 Counting with for Loops 107 Using Empty Statements in for Loops 108 Nesting for Loops 109 Understanding Objects 110 Using String Objects 112 Introducing the String Tester Program 112 Creating string Objects 114 Concatenating string Objects 115 Using the size() Member Function 115 Indexing a string Object 116 Iterating through string Objects 116 Using the find() Member Function 117 Using the erase() Member Function 118 Using the empty() Member Function 119 Using Arrays 119 Introducing the Hero's Inventory Program 119 Creating Arrays 121 Indexing Arrays 122 Accessing Member Functions of an Array Element 123 Being Aware of Array Bounds 123 Understanding C-Style Strings 124 Using Multidimensional Arrays 126 Introducing the Tic-Tac-Toe Board Program 126 Creating Multidimensional Arrays 128 Indexing Multidimensional Arrays 128 Introducing Word Jumble 129 Setting Up the Program 130 Picking a Word to Jumble 130 Jumbling the Word 131 Welcoming the Player 132 Entering the Game Loop 132 Saying Goodbye 133 Summary 133 Questions and Answers 134 Discussion Questions 136 Exercises 137 Chapter 4 The Standard Template Library: Hangman 138 Introducing the Standard Template Library 138 Using Vectors 139 Introducing the Hero's Inventory 2.0 Program 140 Preparing to Use Vectors 142 Declaring a Vector 142 Using the push_back() Member Function 143 Using the size() Member Function 143 Indexing Vectors 144 Calling Member Functions of an Element 144 Using the pop_back() Member Function 145 Using the clear() Member Function 145 Using the empty() Member Function 145 Using Iterators 146 Introducing the Hero's Inventory 3.0 Program 146 Declaring Iterators 148 Looping through a Vector 149 Changing the Value of a Vector Element 151 Accessing Member Functions of a Vector Element 152 Using the insert() Vector Member Function 153 Using the erase() Vector Member Function 153 Using Algorithms 154 Introducing the High Scores Program 154 Preparing to Use Algorithms 156 Using the find() Algorithm 157 Using the random_shuffle() Algorithm 157 Using the sort() Algorithm 158 Understanding Vector Performance 159 Examining Vector Growth 159 Examining Element Insertion and Deletion 161 Examining Other STL Containers 161 Planning Your Programs 162 Using Pseudocode 162 Using Stepwise Refinement 163 Introducing Hangman 164 Planning the Game 164 Setting Up the Program 165 Initializing Variables and Constants 166 Entering the Main Loop 166 Getting the Player's Guess 167 Ending the Game 168 Summary 168 Questions and Answers 169 Discussion Questions 171 Exercises 171 Chapter 5 Functions: Mad Lib 174 Creating Functions 174 Introducing the Instructions Program 175 Declaring Functions 176 Defining Functions 177 Calling Functions 177 Understanding Abstraction 178 Using Parameters and Return Values 178 Introducing the Yes or No Program 178 Returning a Value 180 Accepting Values into Parameters 181 Understanding Encapsulation 183 Understanding Software Reuse 184 Working with Scopes 184 Introducing the Scoping Program 184 Working with Separate Scopes 186 Working with Nested Scopes 188 Using Global Variables 189 Introducing the Global Reach Program 189 Declaring Global Variables 191 Accessing Global Variables 191 Hiding Global Variables 192 Altering Global Variables 192 Minimizing the Use of Global Variables 193 Using Global Constants 193 Using Default Arguments 194 Introducing the Give Me a Number Program 194 Specifying Default Arguments 196 Assigning Default Arguments to Parameters 196 Overriding Default Arguments 197 Overloading Functions 197 Introducing the Triple Program 197 Creating Overloaded Functions 199 Calling Overloaded Functions 200 Inlining Functions 200 Introducing the Taking Damage Program 200 Specifying Functions for Inlining 202 Calling Inlined Functions 202 Introducing the Mad Lib Game 203 Setting Up the Program 204 The main() Function 204 The askText() Function 205 The askNumber() Function 205 The tellStory() Function 206 Summary 206 Questions and Answers 207 Discussion Questions 209 Exercises 209 Chapter 6 References: Tic-Tac-Toe 210 Using References 210 Introducing the Referencing Program 210 Creating References 212 Accessing Referenced Values 213 Altering Referenced Values 213 Passing References to Alter Arguments 214 Introducing the Swap Program 214 Passing by Value 216 Passing by Reference 217 Passing References for Efficiency 218 Introducing the Inventory Displayer Program 218 Understanding the Pitfalls of Reference Passing 219 Declaring Parameters as Constant References 220 Passing a Constant Reference 220 Deciding How to Pass Arguments 221 Returning References 221 Introducing the Inventory Referencer Program 222 Returning a Reference 223 Displaying the Value of a Returned Reference 224 Assigning a Returned Reference to a Reference 225 Assigning a Returned Reference to a Variable 225 Altering an Object through a Returned Reference 225 Introducing the Tic-Tac-Toe Game 226 Planning the Game 226 Setting Up the Program 228 The main() Function 230 The instructions() Function 231 The askYesNo() Function 231 The askNumber() Function 232 The humanPiece() Function 232 The opponent() Function 233 The displayBoard() Function 233 The winner() Function 234 The isLegal() Function 235 The humanMove() Function 236 The computerMove() Function 236 The announceWinner() Function 240 Summary 240 Questions and Answers 241 Discussion Questions 243 Exercises 244 Chapter 7 Pointers: Tic-Tac-Toe 2.0 246 Understanding Pointer Basics 246 Introducing the Pointing Program 247 Declaring Pointers 249 Initializing Pointers 250 Assigning Addresses to Pointers 250 Dereferencing Pointers 251 Reassigning Pointers 252 Using Pointers to Objects 253 Understanding Pointers and Constants 254 Using a Constant Pointer 254 Using a Pointer to a Constant 255 Using a Constant Pointer to a Constant 256 Summarizing Constants and Pointers 257 Passing Pointers 257 Introducing the Swap Pointer Version Program 257 Passing by Value 259 Passing a Constant Pointer 260 Returning Pointers 261 Introducing the Inventory Pointer Program 262 Returning a Pointer 263 Using a Returned Pointer to Display a Value 264 Assigning a Returned Pointer to a Pointer 265 Assigning to a Variable the Value Pointed to by a Returned Pointer 265 Altering an Object through a Returned Pointer 266 Understanding the Relationship between Pointers and Arrays 267 Introducing the Array Passer Program 267 Using an Array Name as a Constant Pointer 269 Passing and Returning Arrays 270 Introducing the Tic-Tac-Toe 2.0 Game 271 Summary 271 Questions and Answers 273 Discussion Questions 275 Exercises 275 Chapter 8 Classes: Critter Caretaker 278 Defining New Types 278 Introducing the Simple Critter Program 279 Defining a Class 280 Defining Member Functions 281 Instantiating Objects 282 Accessing Data Members 282 Calling Member Functions 283 Using Constructors 283 Introducing the Constructor Critter Program 284 Declaring and Defining a Constructor 285 Calling a Constructor Automatically 286 Setting Member Access Levels 287 Introducing the Private Critter Program 287 Specifying Public and Private Access Levels 289 Defining Accessor Member Functions 290 Defining Constant Member Functions 291 Using Static Data Members and Member Functions 292 Introducing the Static Critter Program 293 Declaring and Initializing Static Data Members 295 Accessing Static Data Members 295 Declaring and Defining Static Member Functions 296 Calling Static Member Functions 296 Introducing the Critter Caretaker Game 297 Planning the Game 298 Planning the Pseudocode 299 The Critter Class 300 The main() Function 303 Summary 304 Questions and Answers 306 Discussion Questions 308 Exercises 308 Chapter 9 Advanced Classes and Dynamic Memory: Game Lobby 310 Using Aggregation 310 Introducing the Critter Farm Program 311 Using Object Data Members 313 Using Container Data Members 314 Using Friend Functions and Operator Overloading 315 Introducing the Friend Critter Program 315 Creating Friend Functions 318 Overloading Operators 318 Dynamically Allocating Memory 319 Introducing the Heap Program 320 Using the new Operator 322 Using the delete Operator 323 Avoiding Memory Leaks 324 Working with Data Members and the Heap 326 Introducing the Heap Data Member Program 326 Declaring Data Members that Point to Values on the Heap 330 Declaring and Defining Destructors 331 Declaring and Defining Copy Constructors 332 Overloading the Assignment Operator 336 Introducing the Game Lobby Program 338 The Player Class 339 The Lobby Class 341 The Lobby::AddPlayer() Member Function 343 The Lobby::RemovePlayer() Member Function 345 The Lobby::Clear() Member Function 345 The operator

قیمت نهایی

۴۹٬۰۰۰ تومان