Time for action – configuring the behavior
The game file to import and load for this session is 5961_02_07.stencyl
.
Ensure that we can see the attributes for the Run and Jump Movement behavior by opening the monkey actor and clicking on the Behaviors button at the upper-center of the screen.
Let's get the keyboard and animation information into the behavior:
- Click on the drop-down arrow next to the heading Left Control and select the item labeled left.
- Click on the drop-down arrow next to the heading Right Control and select the item labeled right.
- Click on the drop-down arrow next to the heading Jump Control and select the item labeled up.
- Scroll down the configuration screen so that the section with the red warning triangle icons can be seen.
- Click on the Choose Animation… button next to the first icon, which is labeled Idle Left Animation.
- In the Choose Animation dialog box that appears, click on the thumbnail for the monkey's Idle Left animation.
- Click on OK to confirm your choice.
- Click on the Choose Animation… button next to the second icon, which is labeled Idle Right Animation.
- In the Choose Animation… dialog box that appears, click on the monkey thumbnail image labeled Idle Right.
- Click on OK to confirm your choice.
What just happened?
We have selected the keys that we are going to use to control the monkey—arrow left, arrow right, and arrow up—and we have specified which animations are going to be displayed when the monkey actor is idle facing left or idle facing right.
However, we haven't quite finished configuring the Jump and Run Movement behavior yet—we need to specify the last few animations, and that's our next task.
Have a go hero – configuring the remaining animations
We have already configured the first two animations, so go ahead and configure the final four:
- Run left
- Run right
- Jump left
- Jump right
Just click on the Choose Animation… buttons and select the appropriate animation from the dialog box.
If we make a mistake when choosing the animations, it doesn't matter! We can simply click on the Choose Animation… button again, and select the appropriate animation.
Save the game!
Always save the game after changes have been made!