Chapter 18. Creating Backgrounds for Your Sprites

If you’ve ever watched an animated movie, you are familiar with the importance of backgrounds. If you pay careful attention the next time you watch an animated movie, notice how the characters move on top of a background that doesn’t tend to change much. This is because the characters are overlaid on the background, very much like sprites. Although you’ve already seen how to use an image as a background, this hour shows you how to create a general background class that you can use in your games. Not only that, but you learn how to create animated backgrounds that can be used to display a starry night complete with twinkling stars.

In this hour, you’ll learn:

  • Why backgrounds are so important in games ...

Get Sams Teach Yourself Game Programming in 24 Hours 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.