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

Dopesheet 2D animation


Dopesheet is the user-interface approach used in the editor to create animation clips. The word Dopesheet is derived from its traditional use in cartoons and film/TV. Similar to a storyboard, it is used in planning animations using frames and sections.

To create a reusable animation clip for our character of it breathing, follow these steps:

  1. We select the character, click on the Create New Clip drop-down box, and then click on Create New Clip.

  2. We then select Idle as the name of our animation and click on Save.

  3. Now we select Add Curve.

  4. A drop-down box will appear giving us several options.

  5. We click on Transform to open all the transform properties and then select Position by clicking on the plus button next to it as shown in the following screenshot:

  6. We will animate our character breathing by moving its body's position up and down slightly.

  7. We need to reduce the frames per second (FPS) from 60 down to 10 so that the animation is slower and smoother as this property controls...