更新时间:2021-07-23 20:31:10
coverpage
Learning C++ by Creating Games with UE4
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files eBooks discount offers and more
Preface
What is a game engine anyway?
What will using UE4 cost me?
Why don't I just program my own engine and save the 5 percent?
A game's overview – the Play-Reward-Growth loop
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
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
Chapter 3. If Else and Switch
Branching
Controlling the flow of your program
Using logical operators
Our first example with Unreal Engine
Chapter 4. Looping
The while loop
The do/while loop
The for loop
Looping with Unreal Engine
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
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
Chapter 7. Dynamic Memory Allocation
Dynamic memory allocation
Regular arrays
C++ style dynamic size arrays (new[] and delete[])
Dynamic C-style arrays
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
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
Chapter 10. Inventory System and Pickup Items
Declaring the backpack
Base class PickupItem
Drawing the player inventory
Chapter 11. Monsters
Landscape
Monsters
Monster attacks on the player
Chapter 12. Spell Book
The particle systems
Spell class actor
Attaching right mouse click to cast spell
Creating other spells
Index