Game Development Reference
In-Depth Information
To solidify the idea, I am going to illustrate a second example with multiple states. Recall
the scene in Illustration 38, there is a fan on the wall and a switch standing in the middle
of the room. This switch is going to be used to turn the fan on and change its speed. Let's
begin with the script of the fan which is ControllableFan shown in Listing. This script sets
3 different speeds for the fan, as well as off state.
Listing 39: Fan script
Search WWH ::




Custom Search