Skip to Content
Programming 2D Games
book

Programming 2D Games

by Charles Kelly
June 2012
Beginner
438 pages
15h 26m
English
A K Peters/CRC Press
Content preview from Programming 2D Games
1295.5. The Image Class
spriteData.flipHorizontal = flip;
}
// Flip image vertically
virtual void flipVertical(bool flip)
{
spriteData.flipVertical = flip;
}
Listing 5.24. e image’s ip functions.
e next three functions are explained in more detail in Section 5.7 later in this chapter.
Let’s go over them briey here just to complete the code in the
Image class.
• e update function receives the current frameTime as a parameter. e update
function is where all code that needs to be synchronized with elapsed time should
be placed. e update function sets which frame from the texture image should be
displayed, and it calls setRect to select the current ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Beginning 3D Game Programming

Beginning 3D Game Programming

Tom Miller

Publisher Resources

ISBN: 9781466508705