Characters

Having a bunch of generic blocks is just the beginning of this game. Next, we are going to create a few characters to add some life to the game. We are going to need some evil pigs to destroy and some good birds to throw at them.

The enemy

Our first character will be the enemy pig. On their own, they don't actually do anything. So, they are really just the wooden blocks we made earlier that happen to look like pigs. To make their destruction the goal of the game, however, we are going to expand our LevelTracker script to watch them and trigger a Game Over event if they are all destroyed. We will also expand it to draw the score on the screen and make it save the score for later use. To demonstrate the use of 2D assets in the 3D environment, ...

Get Unity Android Game Development by Example Beginner's Guide 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.