Book Image

Mastering Unity 5.x

By : Alan Thorn
Book Image

Mastering Unity 5.x

By: Alan Thorn

Overview of this book

Mastering Unity 5.x is for developers wishing to optimize the features of Unity 5.x. With an in-depth focus on a practical project, learn all about Unity architecture and impressive animation techniques. With this book, produce fun games with confidence.
Table of Contents (16 chapters)
Mastering Unity 5.x
Credits
About the Author
Acknowledgment
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

Player score


In many games, the player has a score to express their achievement and progress. Dead Keys will be no different and we'll use a traditional scoring system. Specifically, the player will earn points for each zombie killed; we'll create the potential for assigning different scores (points) to different zombies, depending on difficulty and strength. To implement this, we'll work with UI elements and script, as before.

Creating a score display

The score feature will essentially be a text object displaying a numerical score, representing the kill count for zombies. Most games complement a score with some animation and effects. Our score will feature two behaviors: firstly, it'll expand and contract in scale as the score changes; and secondly, the score will catch up and Lerp. That is, the numbers in the score text will animate upwards as the score changes to represent the latest value, as opposed to changing instantly. Creating the throb animation works much like the damage panel...