Time for action – adding an event and renaming the behavior
The game file that needs to be imported and loaded for this session is 5961_04_03.stencyl
.
If we're following on immediately from the previous instructions, we should be looking at the monkey actor's behavior page. However, we need to return to the behavior editor so, click on the Collect Fruit
tab or, if the tab is not visible, go to the Dashboard, click on Actor Behaviors (under LOGIC in the left-hand panel) and double-click on the Collect Fruit behavior, which is currently represented by an image of a hammer.
We can now see the orange when … block that we created earlier. Now perform the following steps:
Click on the + Add Event button at the top of the left-hand panel.
In the pop-up menu, move the mouse over the Collisions option, and select Member of Group.
Double-click the new Actor – Group item in the left panel.
Change the text to
Collides with Enemies
and press Enter on the keyboard.On the orange when Self hits a… block, change...