Howdy and welcome! Take a seat and grab a drink. There you go. So, you say you want to learn all about this old-fashioned 2D stuff in that new-fangled Unity game engine? Well, you've come to the right place. Er, book. This here book? It's all about using those awesome 2D updates that Unity added in v4.3 to make an entire game. Yup, a whole, basic platformer, complete with parallax scrolling, enemy logic, UI, and a boss battle. Pretty sweet deal, eh?
Chapter 1, Introduction to the 2D World of Unity, covers the basics of getting Unity up and running for 2D games and setting up a simple, animated, sprite-based player character.
Chapter 2, It Lives!, is all about camera control, 2D triggers, player death and resurrection, firing a weapon, and a bit about state machines for good measure.
Chapter 3, No Longer Alone, adds enemies! Shoot them, get killed by them, and watch them patrol. It's a party where everyone wants to kill you!
Chapter 4, Give It Some Sugar, shows you how to build dynamic, endless enemy generation and a bigger game world, introduces parallax scrolling, and adds a scoring system.
Chapter 5, The Ultimate Battle of Ultimate Destiny, lets you know that the enemies have a friend, and he's angry! In this chapter, you will build an entire boss battle.
Chapter 6, The Finishing Touches, is exactly what it sounds like—the final gravy on this awesome mountain of 2D goodness. You'll be adding in game rounds and a start screen.
This book is intentionally developed for only those who need one piece of software—Unity 4.3 or newer. That's it. Don't have Unity? No worries, you can nab a free version of this most excellent game engine from www.Unity3D.com.
This book is ideal for anyone who wants to learn how to build 2D video games or wants to expand their knowledge of the Unity game engine. To get the most from this book, having knowledge of C# and Unity is important, however, if you are less experienced in these areas, this book still gives you all the necessary tools to create your own game.
In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.
Code words in text are shown as follows: "Import the image labeled Platform.png
."
A block of code is set as follows:
case PlayerStateController.playerStates.idle: playerAnimator.SetBool("Walking", false); break; case PlayerStateController.playerStates.left: playerAnimator.SetBool("Walking", true); break;
New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "To do this, select playerSpriteSheet in the Project tab and look over at the inspector."
Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.
To send us general feedback, simply send an e-mail to <[email protected]>
, and mention the book title via the subject of your message.
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
We also provide you a PDF file that has color images of the screenshots/diagrams used in this book. The color images will help you better understand the changes in the output. You can download this file from https://www.packtpub.com/sites/default/files/downloads/2564OT_ColorGraphics.pdf.
You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.
Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.
Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.
Please contact us at <[email protected]>
with a link to the suspected pirated material.
We appreciate your help in protecting our authors, and our ability to bring you valuable content.
You can contact us at <[email protected]>
if you are having a problem with any aspect of the book, and we will do our best to address it.