Book Image

Unity 2017 2D Game Development Projects

By : Francesco Sapio, Lauren S. Ferro
Book Image

Unity 2017 2D Game Development Projects

By: Francesco Sapio, Lauren S. Ferro

Overview of this book

<p>2D games are everywhere! Timeless and popular, 2D games represent a substantial segment of the games market. The Unity engine has revolutionized the gaming industry, by making it easier for game developers to create quality games on a budget. If you are looking for a guide to create 2D games using Unity 2017, look no further. With this book, you will learn all the essentials of 2D game development by creating three epic games in a step-by-step manner throughout the course of this book. </p><p> </p><p>The first game will have you collecting as many cakes as possible. The second will transport you to outer space to traverse as far as possible while avoiding enemy spaceships. The last game will have you running and jumping across platforms to collect coins and other exotic items. </p><p> </p><p>Throughout all these three games, you will create characters, make them move, and create some enemies. And then, of course, write code to destroy them!. After showing you the necessities of creating a game, this book will then help you to porting the game to a mobile platform, and provide a path to publish it on the stores. </p><p> </p><p>By the end of this book, you will not only have created three complete great games, but be able to apply your knowledge to create and deploy your own games.</p>
Table of Contents (14 chapters)

Building the panda hero

In this section, we will go through the step to create our hero: an unstoppable panda! We will build it, keeping in mind how the Player Controller will act on the panda. If you have followed the steps in Chapter 9, Look, It Moves, you will already have a panda in the scene (which we can now rename Panda Hero), and the game object should already have, besides the Transform, a Sprite Renderer as well as an Animator component in which the Controller is the Panda_Animator_Finished:

First of all, the character is definitely out of proportion (and possibly also rendered behind the terrain, which is not good). Unless we want to make a variant of Godzilla or King Kong that features a panda, we'd best change this:

In order to fix the problem that the character is rendered behind the terrain, we need to change the sorting layer in its Sprite Renderer. We can...