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

Extra Views


Other than the six main Views of the editor interface that are shown by default, there are extra Views that are also very useful. We can select them by clicking on the Window menu:

Console

The Console View is useful when you write code to output messages and to check for any problems with the code. Any warnings and errors in the code will be displayed here.

These messages only appear to us developers to test and debug our game and will not be shown in the final game to the players. The following screenshot displays the Console View:

Animation

The Animation View is used to animate the GameObjects in our scene using an animation timeline with frames, as shown in the following screenshot:

We will discuss this in great detail in the later chapters.

Sprite Editor

Sprite Editor enables us to separate merged images (known as a sprite sheet or The sprite atlas) from a single image (or sprite as it is often called in the world of 2D). It is useful, for example, for animations and when we want different parts of our character to move independently, as shown in the following screenshot:

Animator

Animator controls the order of an animation. It provides an easy way to set up animations by visually representing the flow of the animation, such as the completion of a jump animation leading to a standing animation. It enables us to create animation states. We can then order the flow of animations and decide when one animation state transitions or blends into the next state, as shown in the following screenshot:

Profiler

Profiler (a feature that comes with the Pro version) is used to check on a game's performance (how fast it runs) and on what could be slowing it down with regards to memory usage, object count (total objects), draw calls, and so forth. Different things can slow down a game, such as too many sprites on the screen at the same time, very complex AI or scripts, and so on.

The standard benchmark for a game is to run at 60 FPS (frames per second). It is recommended that anything less than this should be optimized and improved. This ideal frame rate varies from genre to genre and platform to platform. For instance, an RPG game is generally acceptable at 30 FPS, whereas a racing game is best at 60 FPS.

The following is a screenshot of Profiler: