Chapter 24. Sprite-sheet animations, Controllable Player and Parallax Scrolling Backgrounds
In this chapter we will look at how basic animation occurs by "flipping" through different images to create a moving effect. This is the same technique used to make a simple cartoon. Of course, we will then need to code a solution to achieve this simple animation in our game objects and will do so by coding an Animator
class and adding one to any graphics-related component class that needs it. We will also implement another scrolling background but slightly differently to the scrolling background in the previous project because this time it will need to be positioned both horizontally and vertically, each frame, relative to the position of the camera.
- Code the
Animator
class - Code the component classes related to the player
- Code the component classes related to backgrounds
- Update the
LevelManager
andGameObjectFacrory
to handle the new game objects and their components.
Let's get...