Learning C++ by Creating Games with UE4

Learn C++ programming with a fun, real-world application that allows you to create your own games!

Learning C++ by Creating Games with UE4

This ebook is included in a Mapt subscription
William Sherif

6 customer reviews
Learn C++ programming with a fun, real-world application that allows you to create your own games!
$10.00
$44.99
RRP $26.99
RRP $44.99
eBook
Print + eBook
Preview in Mapt

Book Details

ISBN 139781784396572
Paperback342 pages

Book Description

Unreal Engine 4 is used to create top notch, exciting games by AAA studios, and learning to program in C++ needs some serious motivation.

Learning C++ by Creating Games With UE4 will start with the basics of C++: installing a code editor so you can begin to write C++ code. You will then learn how to write small, self-contained C++ programs that show you how to use the C++ language, without overwhelming you with too much code at the beginning. As we dig into more advanced C++ concepts, you will start to explore the functionality the UE4 engine has to offer. You will use the UE4 editor to create your own world, and then program in some seriously fun gameplay. By the end of this book, you should have a good grasp of how to program in C++.

Table of Contents

Chapter 1: Coding with C++
Setting up our project
Creating your first C++ program
What is building and compiling?
Summary
Chapter 2: Variables and Memory
Variables
Summary
Chapter 3: If, Else, and Switch
Branching
Controlling the flow of your program
Using logical operators
Our first example with Unreal Engine
Summary
Chapter 4: Looping
The while loop
The do/while loop
The for loop
Looping with Unreal Engine
Summary
Chapter 5: Functions and Macros
Functions
An example of a <cmath> library function – sqrt()
Writing our own functions
Functions with arguments
Functions that return values
Variables, revisited
Macros
Macros with arguments
Summary
Chapter 6: Objects, Classes, and Inheritance
struct objects
class versus struct
Getters and setters
Constructors and destructors
Class inheritance
Multiple inheritance
Putting your classes into headers
Summary
Chapter 7: Dynamic Memory Allocation
Dynamic memory allocation
Regular arrays
C++ style dynamic size arrays (new[] and delete[])
Dynamic C-style arrays
Summary
Chapter 8: Actors and Pawns
Actors versus pawns
Creating a world to put your actors in
The UE4 editor
Starting from scratch
Adding an actor to the scene
Creating a player entity
Writing C++ code that controls the game's character
Creating non-player character entities
Displaying a quote from each NPC dialog box
Summary
Chapter 9: Templates and Commonly Used Containers
Debugging the output in UE4
UE4's TArray<T>
TSet<T>
TMap<T, S>
C++ STL versions of commonly used containers
Summary
Chapter 10: Inventory System and Pickup Items
Declaring the backpack
Base class PickupItem
Drawing the player inventory
Summary
Chapter 11: Monsters
Landscape
Monsters
Monster attacks on the player
Summary
Chapter 12: Spell Book
The particle systems
Spell class actor
Attaching right mouse click to cast spell
Creating other spells
Summary

What You Will Learn

  • Visualize and truly understand C++ programming concepts, such as how data is saved in computer memory and how program flow works
  • Write reusable code by grouping lines of code into functions
  • Learn how inheritance works-how traits of a base class are passed on to derived classes
  • Learn about dynamic allocation of new memory for your program
  • Design your own world using the UE4 editor
  • Practice programming by coding behaviors into your game world, including player inventory tracking, monsters, and NPCs

Authors

Table of Contents

Chapter 1: Coding with C++
Setting up our project
Creating your first C++ program
What is building and compiling?
Summary
Chapter 2: Variables and Memory
Variables
Summary
Chapter 3: If, Else, and Switch
Branching
Controlling the flow of your program
Using logical operators
Our first example with Unreal Engine
Summary
Chapter 4: Looping
The while loop
The do/while loop
The for loop
Looping with Unreal Engine
Summary
Chapter 5: Functions and Macros
Functions
An example of a <cmath> library function – sqrt()
Writing our own functions
Functions with arguments
Functions that return values
Variables, revisited
Macros
Macros with arguments
Summary
Chapter 6: Objects, Classes, and Inheritance
struct objects
class versus struct
Getters and setters
Constructors and destructors
Class inheritance
Multiple inheritance
Putting your classes into headers
Summary
Chapter 7: Dynamic Memory Allocation
Dynamic memory allocation
Regular arrays
C++ style dynamic size arrays (new[] and delete[])
Dynamic C-style arrays
Summary
Chapter 8: Actors and Pawns
Actors versus pawns
Creating a world to put your actors in
The UE4 editor
Starting from scratch
Adding an actor to the scene
Creating a player entity
Writing C++ code that controls the game's character
Creating non-player character entities
Displaying a quote from each NPC dialog box
Summary
Chapter 9: Templates and Commonly Used Containers
Debugging the output in UE4
UE4's TArray<T>
TSet<T>
TMap<T, S>
C++ STL versions of commonly used containers
Summary
Chapter 10: Inventory System and Pickup Items
Declaring the backpack
Base class PickupItem
Drawing the player inventory
Summary
Chapter 11: Monsters
Landscape
Monsters
Monster attacks on the player
Summary
Chapter 12: Spell Book
The particle systems
Spell class actor
Attaching right mouse click to cast spell
Creating other spells
Summary

Book Details

ISBN 139781784396572
Paperback342 pages
Read More
From 6 reviews

Read More Reviews