📜 ⬆️ ⬇️

The book "Learning C + + through game programming"

image
If you want to learn how to program first-class games, you just need to learn the C ++ language. This book will help you master the development of games from the very beginning, regardless of whether you have any programming experience. It is much more interesting to learn when learning turns into a game. Each chapter of the book describes an independent game project. In the final chapter you have to write a complex game that combines all the programming techniques discussed in previous chapters. The book is ideal for a novice programmer who plans not only how to master the difficult C ++ language, but also to practice programming games. The purpose of this book is to introduce you to the C ++ language in the context of game programming. Although it is impossible to imagine a book that would make you a master in two such voluminous topics as game programming and C ++, this edition will be useful to you as an introductory course.


Who is this book for?

This book is for everyone who wants to learn how to program games. It is designed for beginners, no programming experience is required for reading. If you are good at using your own computer, you can start an odyssey in the world of game programming right now. But the fact that this book is designed for beginners does not mean that it will be easier to learn C ++ for programming games. We'll have to carefully read, work, experiment. After reading this book, you will acquire solid basic knowledge of the most important language for professional game programming.

How the book is built

I start a story about programming C ++ games from the very beginning, assuming that the reader has no experience in programming games or in C ++. Each new chapter deals with increasingly complex topics, each subsequent chapter is based on material from previous ones.
')
Each chapter discusses a specific topic or several related topics. I move from one concept to another, accompanying text with small game programs that illustrate each idea. At the end of each chapter I unite the most important concepts considered in it, offering you a ready-made game. The final chapter ends with the most non-trivial project, where we use all the main phenomena studied in the book.

After reading this book, you will not just learn the language C ++ and get an idea about the programming of games. You will also learn how to organize your work, to subdivide problems into small digestible subtasks, to hone the code. On the pages of the book you will have to constantly face the challenges, but none of them will not be insurmountable. In general, you will find fun and interesting learning. Along the way, you will write some cool computer games and learn the craft of game programming.

Chapter 1. Types, variables, standard I / O. Game "Lost Treasure". Here you will learn the basics of C ++ - the most important programming language used in the gaming industry. You will learn to display the output in the console window, perform arithmetic calculations, work with variables, and receive user input typed on the keyboard.

Chapter 2. Truth, branching and game cycle. Game "Guess the number." Many interesting games are based on programs that execute, skip or re-execute certain blocks of code, depending on certain conditions. You will learn how to generate random numbers, which will add an element of unpredictability to your games. In addition, you will be introduced to a fundamental phenomenon called the “game cycle”. This cycle allows you to organize the game and build a series of events in it.

Chapter 3. For loops, strings, and arrays. Slovoeska game. You will learn about game sequences and learn how to work with strings. A string is a sequence of characters, indispensable when playing words. In addition, you will learn about software objects - entities that allow you to represent creatures or objects in your game. Examples of entities are alien spacecraft, healing potion pot, or the character itself.

Chapter 4. Library of standard templates. Game "Hangman". Here you will get acquainted with a powerful library - a toolkit for game developers (and not just games). This library allows you to combine items in the collection and store them in this form, for example, as equipment in a backpack for a character. In addition, there will be considered techniques that allow you to create larger game programs.

Chapter 5. Functions. Crazy Librarians game. In this chapter, you will learn how to break game programs into compact blocks that are convenient to work with. To do this, you will get acquainted with the functions - elementary logical units used in programs.

Chapter 6. References. The game "Tic-tac-toe". Here we will talk about how to simultaneously use certain information in different parts of your program, and to do it clearly and efficiently. In addition, here you will learn about artificial intelligence and learn how to make a computer opponent a little more inventive.

Chapter 7. Pointers. The game "Tic-tac-toe 2.0". In this chapter, you will learn about some of the most low-level and powerful features of the C ++ language. In particular, we will talk about how to directly access and manipulate computer memory.

Chapter 8. Classes. The game "Tamagotchi". Here you will learn how to create your own objects and describe how they should interact with each other. To do this, apply the paradigm of object-oriented programming. You will create your own pet-Tamagotchi, which will take care of.

Chapter 9. More complex classes and working with dynamic memory. Game lobby. In this chapter, you will learn to interact even more closely with the computer, in particular, to occupy and free up memory, if the game process requires it. You will also learn about the pitfalls associated with such dynamic memory use, and learn how to bypass them.

Chapter 10. Inheritance and polymorphism. Blackjack game. In this chapter we will talk about how to create objects using other objects. Then summarize all the material studied in a large final game. You will see how a fairly voluminous game is being designed and implemented, namely, the virtual simulator of the classic gambling card game Blackjack (without a worn cloth on the platform table, we'll manage somehow).

Source code for the book

The entire source code for the examples in this book is available online at www.cengageptr.com/downloads

about the author

Michael Dawson is an author who writes computer games and a teacher who teaches students in the art and science of computer games. Michael developed and taught courses on game programming at the UCLA Extension faculty at the University of California, Los Angeles (students in this faculty receive a second degree). Michael also lectured at the Academy of Digital and Media Technologies (DMA) and the Los Angeles Film School. Dawson books are part of the compulsory program at many universities and colleges in the United States.

Michael began his career in the gaming industry as a producer and designer. In parallel, he began to develop an adventure game where the user controls the main character named Mike Dawson. According to the plot of the game, Dawson’s digital double must prevent an alien invasion before an alien alien implant is hatched from his head.

In reality, Michael is known as the author of several books: Beginning C ++ Through Game Programming, Python Programming for the Absolute Beginner, C ++ Projects: Programming with Text-Based Games and Guide to Programming with Python. Dawson earned a bachelor’s degree in cybernetics from the University of Southern California. You can read more about the author and his books on the author’s personal site , here you will find answers to many questions about Michael’s books.

More information about the book can be found on the publisher's website.
Table of contents
Excerpt

For Habrozhiteley a 25% discount on coupon - Learn C ++

Source: https://habr.com/ru/post/270559/


All Articles