- Cocos2d-x by Example:Beginner's Guide(Second Edition)
- Roger Engelbert
- 69字
- 2025-04-04 21:05:35
Extending Sprite
No, there is nothing wrong with Sprite
. I just picked a game where we need a bit more information from some of its sprites. In this case, we want to store where a sprite is and where it will be once the current iteration of the game is completed. We will also need a helper method to get the sprite's radius.
So let's create our GameSprite
class.