O'Reilly logo

Game Programming in C++: Creating 3D Games, First Edition by Sanjay Madhav

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required