Beginning C++ Game Programming
eBook - ePub

Beginning C++ Game Programming

John Horton

Partager le livre
  1. 520 pages
  2. English
  3. ePUB (adapté aux mobiles)
  4. Disponible sur iOS et Android
eBook - ePub

Beginning C++ Game Programming

John Horton

DĂ©tails du livre
Aperçu du livre
Table des matiĂšres
Citations

À propos de ce livre

Learn C++ from scratch and get started building your very own games

About This Book

  • This book offers a fun way to learn modern C++ programming while building exciting 2D games
  • This beginner-friendly guide offers a fast-paced but engaging approach to game development
  • Dive headfirst into building a wide variety of desktop games that gradually increase in complexity
  • It is packed with many suggestions to expand your finished games that will make you think critically, technically, and creatively

Who This Book Is For

This book is perfect for you if any of the following describes you: You have no C++ programming knowledge whatsoever or need a beginner level refresher course, if you want to learn to build games or just use games as an engaging way to learn C++, if you have aspirations to publish a game one day, perhaps on Steam, or if you just want to have loads of fun and impress friends with your creations.

What You Will Learn

  • Get to know C++ from scratch while simultaneously learning game building
  • Learn the basics of C++, such as variables, loops, and functions to animate game objects, respond to collisions, keep score, play sound effects, and build your first playable game.
  • Use more advanced C++ topics such as classes, inheritance, and references to spawn and control thousands of enemies, shoot with a rapid fire machine gun, and realize random scrolling game-worlds
  • Stretch your C++ knowledge beyond the beginner level and use concepts such as pointers, references, and the Standard Template Library to add features like split-screen coop, immersive directional sound, and custom levels loaded from level-design files
  • Get ready to go and build your own unique games!

In Detail

This book is all about offering you a fun introduction to the world of game programming, C++, and the OpenGL-powered SFML using three fun, fully-playable games. These games are an addictive frantic two-button tapper, a multi-level zombie survival shooter, and a split-screen multiplayer puzzle-platformer.

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.

Style and approach

This book offers a fun, example-driven approach to learning game development and C++. In addition to explaining game development techniques in an engaging style, the games are built in a way that introduces the key C++ topics in a practical and not theory-based way, with multiple runnable/playable stages in each chapter.

Foire aux questions

Comment puis-je résilier mon abonnement ?
Il vous suffit de vous rendre dans la section compte dans paramĂštres et de cliquer sur « RĂ©silier l’abonnement ». C’est aussi simple que cela ! Une fois que vous aurez rĂ©siliĂ© votre abonnement, il restera actif pour le reste de la pĂ©riode pour laquelle vous avez payĂ©. DĂ©couvrez-en plus ici.
Puis-je / comment puis-je télécharger des livres ?
Pour le moment, tous nos livres en format ePub adaptĂ©s aux mobiles peuvent ĂȘtre tĂ©lĂ©chargĂ©s via l’application. La plupart de nos PDF sont Ă©galement disponibles en tĂ©lĂ©chargement et les autres seront tĂ©lĂ©chargeables trĂšs prochainement. DĂ©couvrez-en plus ici.
Quelle est la différence entre les formules tarifaires ?
Les deux abonnements vous donnent un accĂšs complet Ă  la bibliothĂšque et Ă  toutes les fonctionnalitĂ©s de Perlego. Les seules diffĂ©rences sont les tarifs ainsi que la pĂ©riode d’abonnement : avec l’abonnement annuel, vous Ă©conomiserez environ 30 % par rapport Ă  12 mois d’abonnement mensuel.
Qu’est-ce que Perlego ?
Nous sommes un service d’abonnement Ă  des ouvrages universitaires en ligne, oĂč vous pouvez accĂ©der Ă  toute une bibliothĂšque pour un prix infĂ©rieur Ă  celui d’un seul livre par mois. Avec plus d’un million de livres sur plus de 1 000 sujets, nous avons ce qu’il vous faut ! DĂ©couvrez-en plus ici.
Prenez-vous en charge la synthÚse vocale ?
Recherchez le symbole Écouter sur votre prochain livre pour voir si vous pouvez l’écouter. L’outil Écouter lit le texte Ă  haute voix pour vous, en surlignant le passage qui est en cours de lecture. Vous pouvez le mettre sur pause, l’accĂ©lĂ©rer ou le ralentir. DĂ©couvrez-en plus ici.
Est-ce que Beginning C++ Game Programming est un PDF/ePUB en ligne ?
Oui, vous pouvez accĂ©der Ă  Beginning C++ Game Programming par John Horton en format PDF et/ou ePUB ainsi qu’à d’autres livres populaires dans Ciencia de la computaciĂłn et ProgramaciĂłn en C++. Nous disposons de plus d’un million d’ouvrages Ă  dĂ©couvrir dans notre catalogue.

Informations

Année
2016
ISBN
9781786466198

Beginning C++ Game Programming


Beginning C++ Game Programming

Copyright © 2016 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: October 2016
Production reference: 3191016
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.
ISBN 978-1-78646-619-8
www.packtpub.com

Credits

Author
John Horton
Copy Editor
Safis Editing
Reviewer
Glen De Cauwsemaecker
Project Coordinator
Ulhas Kambali
Commissioning Editor
Wilson D'souza
Proofreader
Safis Editing
Acquisition Editor
Tushar Gupta
Indexer
Tejal Daruwale Soni
Content Development Editor
Onkar Wani
Production Coordinator
Aparna Bhagat
Technical Editor
Rashil Shah
Cover Work
Aparna Bhagat

About the Author

John Horton is a coding and gaming enthusiast based in the UK.
He has a passion for writing apps, games, books, and blog articles about programming, especially for beginners. He is the founder of Game Code School, http://www.gamecodeschool.com, which is dedicated to helping complete beginners get started coding using the language and platform that is best for them.
John sincerely believes that anyone can learn to code and that everybody has a game or an app inside of them, and that they just need to do enough work to bring it out.
He has authored around a dozen technology books, most recently the following:
Beginning C++ Game Programming: https://www.packtpub.com/game-development/beginning-c-game-programming
Android Programming for Beginners: https://www.packtpub.com/application-development/android-programming-beginners
Android Game programming by Example: https://www.packtpub.com/game-development/android-game-programming-example
Learning Java Building Android Games: https://www.packtpub.com/game-development/learning-java-building-android-games

About the Reviewer

Glen De Cauwsemaecker, commonly known as glendc, is an open source hacker from Belgium. Currently, he lives a nomadic life in South America, while working freelance for the UK games industry. Glen is passionate about open source technology, as much as exploring new cultures and countries. This is why he became in 2015 a digital nomad, after living and working in the UK for 2 years.
I would like to thank my girlfriend, Elizabeth Gonzales Belsuzarri, for her support and love. I would also like to thank Exient Ltd., my employer for the last 3 years, for providing me with the chance to work remotely, while living nomadically.

www.PacktPub.com

eBooks, discount offers, and more

Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
eBooks, discount offers, and more
https://www2.packtpub.com/books/subscription/packtlib
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can search, access, and read Packt's entire library of books.

Why subscribe?

  • Fully searchable across every book published by Packt
  • Copy and paste, print, and bookmark content
  • On demand and accessible via a web browser

Dedication

Dedicated to everyone who has no place to stay or insufficient strength to live. Especially to those who used up all their strength serving someone else.

Preface

This book is about learning C++ programming the fun way. Starting from zero experience, you will learn the basics of C++, such as variables and loops, through to advanced topics, such as inheritance and polymorphism. Everything you learn will be put into practice building three fully-playable games.
These are our three projects for the book.

Timber!!!

The first game is an addictive, fast-paced clone of the hugely successful Timberman, http://store.steampowered.com/app/398710/. Our game, Timber!!!, will allow us to be introduced to all the C++ basics at the same time as building a genuinely playable game.

Zombie Arena

Next we will build a frantic, zombie survival-shooter, not unlike the Steam hit, Over 9,000 Zombies, http://store.steampowered.com/app/273500/. The player will have a machine gun, and must fight off ever growing waves of zombies. All this will take place in a randomly generated, scrolling world. To achieve this, we will learn about object-oriented programming and how it enables us to have a large code base (lots of code) that is easy to write and maintain. Expect exciting features such as hundreds of enemies, rapid-fire weaponry, pick-ups and a character that can be "leveled-up" after each wave.

Thomas was Late

The third game will be a stylish and challenging, single player and co-op puzzle platformer. It is based on the very popular game, Thomas was Alone, http://store.steampowered.com/app/220780/. Expect to learn cool topics such as particle effects, OpenGL Shaders, and split-screen cooperative multiplayer.

What this book covers

Chapter 1, C++, SFML, Visual Studio, and Starting the First Game, this is quite a hefty first chapter, but we will learn absolutely everything we need in order to have the first part of our first game up and running. Here is what we will do:
  • Find out more about the games we will build
  • Learn a bit about C++
  • Explore SFML and its relationship with C++
  • Look at the software, Visual Studio, that we will use throughout the book
  • Set up a game development environment
  • Create a reusable project template, which will save a lot of time
  • Plan and prepare for the first game project, Timber!!!
  • Write the first C++ code of the book and make a runnable game that draws a background
Chapter 2, Variables, Operators, and Decisions – Animating Sprites, in this chapter, we will do quite a bit more drawing on the screen, and to achieve this we will need to learn some of the basics of C++. Here is what is in store:
  • Learn all about C++ variables
  • See how to manipulate the values stored in variables
  • Add a static tree, ready for the player to chop
  • Draw and animate a bee and three clouds
Chapter 3, C++ Strings, SFML Time – Player Input, and HUD, in this chapter, we will spend around half the time learning how to manipulate text and display it on the screen, and the other half looking at timing and how a visual tim...

Table des matiĂšres