Book description
Get to grips with programming techniques and game development using C++ libraries and Visual Studio 2019
Key Features
- Learn game development and C++ with a fun, example-driven approach
- Build clones of popular games such as Timberman, Zombie Survival Shooter, a co-op puzzle platformer, and Space Invaders
- Discover tips to expand your finished games by thinking critically, technically, and creatively
Book Description
The second edition of Beginning C++ Game Programming is updated and improved to include the latest features of Visual Studio 2019, SFML, and modern C++ programming techniques. With this book, you'll get a fun introduction to game programming by building five fully playable games of increasing complexity. You'll learn to build clones of popular games such as Timberman, Pong, a Zombie survival shooter, a coop puzzle platformer and Space Invaders.
The book starts by covering the basics of programming. You'll study key C++ topics, such as object-oriented programming (OOP) and C++ pointers, and get acquainted with the Standard Template Library (STL). The book helps you learn about collision detection techniques and game physics by building a Pong game. As you build games, you'll also learn exciting game programming concepts such as particle effects, directional sound (spatialization), OpenGL programmable shaders, spawning objects, and much more. Finally, you'll explore game design patterns to enhance your C++ game programming skills.
By the end of the book, you'll have gained the knowledge you need to build your own games with exciting features from scratch
What you will learn
- Set up your game development project in Visual Studio 2019 and explore C++ libraries such as SFML
- Explore C++ OOP by building a Pong game
- Understand core game concepts such as game animation, game physics, collision detection, scorekeeping, and game sound
- Use classes, inheritance, and references to spawn and control thousands of enemies and shoot rapid-fire machine guns
- Add advanced features to your game using pointers, references, and the STL
- Scale and reuse your game code by learning modern game programming design patterns
Who this book is for
This book is perfect for you if you have no C++ programming knowledge, you need a beginner-level refresher course, or you want to learn how to build games or just use games as an engaging way to learn C++. Whether you aspire to publish a game (perhaps on Steam) or just want to impress friends with your creations, you'll find this book useful.
Table of contents
- Beginning C++ Game Programming Second Edition
- Contributors
- Preface
-
Chapter 1: C++, SFML, Visual Studio, and Starting the First Game
- The games we will build
- Meet C++
- Microsoft Visual Studio
- SFML
- Setting up the development environment
- Planning Timber!!!
- The project assets
- Understanding screen and internal coordinates
- Getting started with coding the game
- Opening a window using SFML
- The main game loop
- Drawing the game’s background
- Handling errors
- Summary
- FAQ
- Chapter 2: Variables, Operators, and Decisions – Animating Sprites
- Chapter 3: C++ Strings and SFML Time – Player Input and HUD
- Chapter 4: Loops, Arrays, Switches, Enumerations, and Functions – Implementing Game Mechanics
- Chapter 5: Collisions, Sound, and End Conditions – Making the Game Playable
- Chapter 6: Object-Oriented Programming – Starting the Pong Game
- Chapter 7: Dynamic Collision Detection and Physics – Finishing the Pong Game
- Chapter 8: SFML Views – Starting the Zombie Shooter Game
- Chapter 9: C++ References, Sprite Sheets, and Vertex Arrays
- Chapter 10: Pointers, the Standard Template Library, and Texture Management
- Chapter 11: Collision Detection, Pickups, and Bullets
- Chapter 12: Layering Views and Implementing the HUD
- Chapter 13: Sound Effects, File I/O, and Finishing the Game
- Chapter 14: Abstraction and Code Management – Making Better Use of OOP
- Chapter 15: Advanced OOP – Inheritance and Polymorphism
- Chapter 16: Building Playable Levels and Collision Detection
- Chapter 17: Sound Spatialization and the HUD
- Chapter 18: Particle Systems and Shaders
-
Chapter 19: Game Programming Design Patterns – Starting the Space Invaders ++ Game
- Space Invaders ++
- Design patterns
- C++ smart pointers
- Casting smart pointers
- C++ assertions
- Creating the Space Invaders ++ project
- Where are we now?
- Coding the Screen class and its dependents
- Adding the WorldState.h file
- Coding the derived classes for the select screen
- Coding the derived classes for the game screen
- Running the game
- Summary
- Chapter 20: Game Objects and Components
-
Chapter 21: File I/O and the Game Object Factory
- The structure of the file I/O and factory classes
- Describing an object in the world
- Coding the GameObjectBlueprint class
- Coding the ObjectTags class
- Coding the BlueprintObjectParser class
- Coding the PlayModeObjectLoader class
- Coding the GameObjectFactoryPlayMode class
- Coding the GameObjectSharer class
- Coding the LevelManager class
- Updating the ScreenManager and ScreenManagerRemoteControl classes
- Where are we now?
- Summary
- Chapter 22: Using Game Objects and Building a Game
- Chapter 23: Before You Go...
- Other Books You May Enjoy
Product information
- Title: Beginning C++ Game Programming - Second Edition
- Author(s):
- Release date: October 2019
- Publisher(s): Packt Publishing
- ISBN: 9781838648572
You might also like
book
Beginning C++ Game Programming
Learn C++ from scratch and get started building your very own games About This Book This …
book
Learn C++ for Game Development
" If you're new to C++ but understand some basic programming, then Learn C++ for Game …
book
Exploring C++20: The Programmer's Introduction to C++
Discover everything you need to know about C++ in a logical progression of small lessons that …
book
Designing Software Synthesizer Plugins in C++, 2nd Edition
Designing Software Synthesizer Plugins in C++ provides everything you need to know to start designing and …