O'Reilly logo

Learn Unity 4 for iOS Game Development by Philip Chu

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     8

Let’s Play! Scripting the Game

Our bowling game that has been taking shape over the past few chapters is starting to actually look like a bowling game! It has a bowling ball, bowling pins (or rather, the barrels added in the previous chapter), game controls, and game physics. But it’s still more a toy than a game, since it lacks game rules and scoring. That will be remedied in this chapter with a healthy dose of scripting. Most of that will take place in the game controller script, FuguBowl.js, which will be filled out with the complete logic for a bowling game laid out as states in a finite state machine (FSM). Just the scoring rules are complicated enough, so those will be encapsulated in a script named FuguBowlPlayer.js.

The ...

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