Explore modern game development and programming techniques to build 5 complete, playable games using C++ and its popular libraries
ISBN: 97818386485729781838647650
Paperback: 700 pages
Feature list
- Learn the basics of C++ such as variables and loops
- Animate game objects, respond to collisions, keep score, play sound effects
- Use classes, inheritance, and references to spawn and control thousands of enemies
- Learn to shoot with a rapid-fire machine gun, and realize random scrolling game-worlds
- Use pointers, references, and Standard Template Library to add various features
- Reuse code to make different games
Details
With this improved and extended 2nd edition, we will start with the very basics of programming, such as variables, loops, and conditions and you will become more skillful with each game as you move through the key C++ topics, such as OOP (Object-Orientated Programming), C++ pointers, and an introduction to the Standard Template Library. While building these games, you will also learn exciting game programming concepts like particle effects, directional sound (spatialization), OpenGL programmable Shaders, spawning thousands of objects, and more.
By the end of this book, you’ll have all the knowledge you need to get started with your game development and programming career with C++ and its libraries.
Features
- This book offers a fun way to learn modern C++ programming while building 5 exciting 2D games
- Immerse yourself in building a wide variety of desktop games that gradually increase in complexity
- Packed with suggestions to expand your finished games that will make you think critically, technically, and creatively
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 as well as 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.
Errata? In chapter 6, page 166 a “using namespace sf;” directive is used in the header file, which I’m told is not a good idea. The directive is also missing from the Bat.cpp file on page 169. I’m enjoying the book and already make my own two-player Pong game. Regards.
In the Player::update function in Zombie Arena where you calculate the angle the player is facing was giving me a C26451 Arithmetic Overflow warning. I changed the * 180 to * 180.0 and the warning went away.
Thanks James. I’ll leave this comment here to help others. And add to to the errata for the next edition. Thanks again, John
A few of us are having an issue on macOS, where without the apparently required event loop (), the game window never opens. It’s mentioned on this page: https://www.sfml-dev.org/tutorials/2.5/window-window.php
There’s a discussion about it here: https://github.com/SFML/SFML/issues/1677
On page 152 you mention an enhanced version of Timber.
“To see the code for these enhancements, take a look in the Timber Enhanced
Version folder of the download bundle.”
After downloading from Pakct website there is not a folder with the enhanced version. Where can I get this from please as you mention optimised code for the clouds?
Hi David,
Thanks for your mail and for reading my book. I have just looked at the code on github and it is missing. The exe is in the runnable folder. I am stuck in bed with a minor ailment at the moment so the solution that should work would be to use the code from the first version of the book. This should be the same apart from some header differences and also I think the text class is different. However, the use of arrays for clouds etc and the enhanced code should be the same.
Here is the link. https://github.com/PacktPublishing/Beginning-Cpp-Game-Programming/tree/master/Proj_01_Codes/Timber%20Enhanced%20Version/code
Hope this helps,
John
Dear John,
I have I’ve notice that in page 317 in the book when I type window.setMouseCursorVisible(true) both the crosshair and mouse display on my game but if set it to false it shows just he crosshair like in the pictures.
And also on page 323 I was having a really hard time to compile the game, the compiler was giving an error “the qualified named name is not allowed in member declaration” on the line Pickup::Pickup(int type); so I changed it to Pickup(int type)” and it actually compile with no errors.
I’m looking forward to finishing up the book so I can star to make my own games, thank you very much for the book.
Thanks Armando. Well done for beating the problem. This info will probably be useful to others.
Hi John the repository here https://github.com/PacktPublishing/Beginning-C-Game-Programming is empty where can I download the source codes of the book?
Hi there,
I think this is the correct URL
https://github.com/PacktPublishing/Beginning-Cpp-Game-Programming-Second-Edition