Chapter 2
Game Objects and 2D Graphics
Most games have many different characters and other objects, and an important decision is how to represent these objects. This chapter first covers different methods of object representation. Next, it continues the discussion of 2D graphics techniques by introducing sprites, sprite animations, and scrolling backgrounds. This chapter culminates with a side-scrolling demo that applies the covered techniques.
Game Objects
The Pong game created in Chapter 1 does not use separate classes to represent the wall, paddles, and ball. Instead, the Game
class uses member variables to track the position and velocity of the different elements of the game. While this can work for a very simple game, it’s not a scalable ...
Get Game Programming in C++: Creating 3D Games, First Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.