Time for action – triggering a custom event
The game file that needs to be imported and loaded for this session is 5961_04_17.stencyl
. Execute the following instructions:
Open the Manage Player Collisions actor behavior.
In the left-hand panel, click on the Collides with Enemies event title.
Right-click on the kill Self block and select Remove in the pop-up menu.
In the block palette, click on the Behavior section button and ensure that the Triggers category is selected.
Drag the trigger event text in behavior text for self instruction block into the orange when Self hits a … block. Double-check that the correct instruction block has been selected (there are several blocks with similar names).
In the left-hand textbox of the trigger event … in behavior … for Self block, type
RestartLevel
—this must be typed so that it is identical to the name entered into the custom event block that we created previously, so check the capitalization.In the right-hand textbox of the trigger event RestartLevel in...