Copyright by Michelle Menard

Safari, the world’s most comprehensive technology and business learning platform.

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required

O'Reilly logo

Chapter 9. Writing the Character and State Controller Scripts

To get Widget up and running, he needs both a character controller and a state controller script. The former will define exactly how he moves and behaves while parsing the input from the player to direct him. The state controller holds all his necessary vitals and information, such as his current health and energy points and which functions can directly affect these stats. The state controller could also define more broad aspects of the character, such as whether he is controllable, dead, or alive. To get started, load your last save from Chapter 7 with the newly imported Widget character. All the scripts for this chapter are included on the DVD and can be simply imported into the scene ...

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required