Hour 16. Creating a Sprite/Actor Class

What You’ll Learn in This Hour

• The difference between a prop and an actor

• Encapsulating sprite functionality in a class

• Testing the Sprite class in the referenced engine project

A sprite, from a video game perspective, is an individual, distinct game object that can be moved or drawn separately from the background. I hesitate to use the word “object” because a sprite can be nothing more than scenery that the player can only see but not touch. For instance, a cloud might be treated as a sprite, without having any interaction with the player. In this hour, you learn how to encapsulate the basic functionality of a sprite that will make it possible to begin writing gameplay code on the Android platform. ...

Get Sams Teach Yourself Android 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.