Creating a 2D player
The player character is a small, green alien-looking creature that can be controlled and guided by the gamer through a level using many conventional platforming game mechanics, such as walking and jumping. In the previous section, we built a white box (prototype) character to test physical interactions with the environment, but here, we'll develop the player character in more depth. We'll look at the following aspects:
- Using Unity's Sprite Editor to unpack the player sprite sheet, thus creating multiple sprites from one texture.
- Creating the player GameObject. The process of creating a GameObject has been shown several times in this book already, as it's a core concept for any Unity game. However, the player object will be slightly more complex than previous objects, as we need to add different sprites for each limb of the player.
- Adjusting the sorting order of the player's sprites so that they are drawn in the correct order...