The game file to import and load for this session is 5961_07_12.stencyl
.
Main Menu
, with a background of blue; any blue will do as we'll be changing it later!Clicked
.We have implemented the required instructions to enable our game to respond appropriately, based upon which button the player pressed when they completed a level.
Firstly, we created a temporary Main Menu scene, which is displayed when the player clicks on the Menu button.
The next step was to attach an event directly to the Stencyl Book Menu Button actor. We did not create a behavior and attach it to the actor, or place the instruction block in an existing behavior that was already attached to the actor. When an instruction block (or series of instruction blocks) is only relevant to a specific actor, it can be useful to attach the instructions directly to the relevant actor as an event, rather than specially creating a behavior that will only be used once. In this case, the Stencyl Book Menu Button actor is only going to be used for a single purpose—switching to the Main Menu scene. So we simply attached that instruction to the actor. We also inserted an unpause game instruction block into the Clicked event for the Stencyl Book Menu Button actor, because the Display Success Banner event that creates the success banner, pauses the game. If we don't use the unpause game instruction at this point, then the game will not function correctly when the next level starts!
We then followed a similar process for the Stencyl Book Next Button actor, but this time we copied and pasted the two required instruction blocks from the Score Management
behavior's Fruit Collected
event. We did this not just to save the trouble of rebuilding the two instruction blocks, but mainly because we have already tested these instructions in an earlier version of game, and we know that they work as required!
The game file to import and load for this session is 5961_07_13.stencyl
.
In the previous two sections, Time for action – displaying the message and buttons and Time for action – responding to the player's selection, we implemented a system whereby, on completion of a level, the player is presented with a success message and two options: Menu and Next. We have tested the game, and we can now be confident that this newly implemented feature is working as required. However, there are some refinements that can be made to the behaviors and events that we have created:
Display Success Banner
event, so that the positioning of the banner and buttons is not hardcoded; the relevant instructions should take into account the screen size.Fruit Collected
event to allow time for the fruit to disappear before the success banner is displayed.Display Success Banner
event can resolve this problem.Suggested solutions to the above modifications along with comments have been implemented in the download file named 5961_07_14.stencyl
.
18.218.114.244