Game Development Reference
In-Depth Information
EnemiesInBattle : Int
PlayerHealth : Int
EnemyHealth : Int
PlayerSeen : Bool
PlayerAttacking : Bool
Now that we have some input parameters, next up we need our states. So, create the states
shown in the following screenshot on the current animation layer by right-clicking and
navigating to Create State | Empty :
The states to be added are as follows:
• Idle
• Run Away
• Attack
• Defend
Note
You should note that the first state will be colored orange, whereas the rest are colored
grey. This is simply because the first one you create becomes the default state (the state
the state machine will start with). You can change the default state at any time by right-
clicking on it and selecting Set As Default .
So with the parameters and states in place, all that is left is to connect everything up and
finalize the state machine. So as we did in Chapter 3 , Getting Animated , we need to create
Search WWH ::




Custom Search