Book Image

Learning Unity 2D Game Development by Example

By : Venita Pereira
Book Image

Learning Unity 2D Game Development by Example

By: Venita Pereira

Overview of this book

<p>If you are looking for a guide to create 2D games using Unity, look no further. With this book, you will learn all the essentials of 2D game development by creating five real-world games in a step-by-step manner throughout the course of this book.</p> <p>Starting with a blank scene, you will learn all about the new Unity 2D toolset, which will enable you to bring your scene to life. You will create characters, make them move, create some enemies, and then write code to destroy them. After figuring out all the necessities of creating a game, this book will then assist you in making several different games: games with collision, parallax scrolling, Box2D, and more.</p> <p>By the end of this book, you will not only have created several small games, but you will also have the opportunity to put all your new-found knowledge into creating and deploying a larger, full game.</p>
Table of Contents (17 chapters)
Learning Unity 2D Game Development by Example
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Sprite Renderer


When we select the character parent or any of its children, the Sprite Renderer component will display this selection within the Inspector toolbar. It contains all the settings that affect how the image will be rendered (in other words, how the image's appearance is displayed). The following screenshot shows us the Sprite Renderer component in Unity:

The Sprite field contains the reference to the sprite asset that the GameObject is using. Should we want to replace the image that the GameObject is using, we simply need to click on the circle (highlighted) as in the following screenshot:

This will open the sprite asset folder allowing us to pick any asset that we have added to our project. This is shown in the following screenshot:

The Color field is a blend mode that multiplies the color selected with the sprite's original color. As we would like to keep the sprite's original color, we leave this setting at the default white. If we wanted to change the color, we simply click...