O'Reilly logo

Getting Started with Unity 5 by Dr. Edward Lavieri

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5. Scripting the Game

Our game is really taking shape. So far, we've completed the game design, game environment, player character, non-player characters, and animations. That is a lot of work for just four chapters. There are a few things we need to accomplish in order to complete our game. First on this list is scripting the game.

In this chapter, we will write scripts for:

  • Managing the amount of water and corn that Colt collects
  • Monitoring how much water and corn each farm animal is given
  • Managing when a piglet becomes a pig and when a baby chick becomes an adult chicken
  • Managing when pigs and chickens reach blue ribbon status

Before we dive right into scripting, I'll provide a C# programming primer for those that need it. We'll also review ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required