更新时间:2021-03-26 16:13:12
封面
版权信息
献辞
Why subscribe?
Contributors
About the author
About the reviewer
Packt is searching for authors like you
Preface
Who this book is for
What this book covers
To get the most out of this book
Get in touch
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
C++ variables
Manipulating variables
Adding clouds a tree and a buzzing bee
Random numbers
Making decisions with if and else
Timing
Moving the clouds and the bee
Chapter 3: C++ Strings and SFML Time – Player Input and HUD
Pausing and restarting the game
C++ Strings
SFML's Text and Font classes
Implementing the HUD
Adding a time-bar
Chapter 4: Loops Arrays Switches Enumerations and Functions – Implementing Game Mechanics
Loops
Arrays
Making decisions with switch
Class enumerations
Getting started with functions
Growing the branches
Chapter 5: Collisions Sound and End Conditions – Making the Game Playable
Preparing the player (and other sprites)
Drawing the player and other sprites
Handling the player's input
Handling death
Simple sound FX
Improving the game and the code
Chapter 6: Object-Oriented Programming – Starting the Pong Game
OOP
The theory of a Pong Bat
Creating the Pong project
Coding the Bat class
Using the Bat class and coding the main function
Chapter 7: Dynamic Collision Detection and Physics – Finishing the Pong Game
Coding the Ball class
Using the Ball class
Collision detection and scoring
Running the game
Chapter 8: SFML Views – Starting the Zombie Shooter Game
Planning and starting the Zombie Arena game
OOP and the Zombie Arena project
Building the player – the first class
Controlling the game camera with SFML View
Starting the Zombie Arena game engine
Managing the code files
Starting to code the main game loop
Chapter 9: C++ References Sprite Sheets and Vertex Arrays
C++ references
SFML vertex arrays and sprite sheets
Creating a randomly generated scrolling background
Using the background
Chapter 10: Pointers the Standard Template Library and Texture Management
Learning about Pointers
The Standard Template Library