The game file that needs to be imported and loaded for this session is 5961_04_10.stencyl
.
Ensure that the Manage Statues
behavior is displayed on screen.
Towards the end of this Time for action section, there is a screenshot displaying the completed behavior, and this can be referred to while completing the following steps:
1
into the over textbox.1
.We have modified the behavior so that, instead of just killing the statue instantly, it will gently fade the statue out of view and then kill the actor.
It's important to note that when the statue has completely faded out of view, it still exists (it's just invisible!), which is why we need the kill Self block. We also need to understand that while the fade out Self over 1 sec using None block is doing its job, it does not wait for the fading to complete before the behavior moves on to the next instruction. That's why we have had to put the kill Self block inside an additional do after 1 seconds block. If we fail to delay the kill Self instruction, then the fade out Self over 1 sec using None block will start to fade the statue, but the kill Self block will instantly remove the statue after the fade process has started and before the fade out Self over 1 sec using None block has completed its work.
By introducing this new behavior, we have fixed two problems—the gameplay problem, whereby statues could block the monkey's path, and also the technical problem, which caused the game to lag when too many statues were on the screen. Lateral thinking such as this, will often help us to resolve gameplay and technical problems. So, bear this in mind in the cases when a difficult technical or gameplay issue occurs during the development process. Consider that there might be a straightforward solution that can also make the game more interesting and fun to play.
The game file that needs to be imported and loaded for this session is 5961_04_11.stencyl
.
In the Kill statues
event, we have three different timings to consider:
do after 5 seconds
event block, which determines how long the event should wait after the creation of the statue and before triggering the enclosed instruction blocks.fade out Self over 1 sec using None
block, which determines over how long the fade will occur.do after 1 seconds
block, which specifies how long to wait before the statue is removed from the scene. In practice, for this effect, the delay should always be the same as the delay for the fade out Self over 1 sec using None
block.Experiment with the timings of the blocks to get a feel of how it affects the gameplay, and decide upon a set of timings that works well in the game.
Another interesting experiment would be to edit the Drop Actors Randomly
scene behavior, so the statues appear more quickly. Reducing the do every … seconds
delay in the Drop statues
event will make the statues appear more frequently, and, if the fade and kill delays are sped up, the game becomes far more manic. Consider how changes to these arguments (the numbers and textual information that affect the way that some instruction blocks work) can change the gameplay. Often, an increase in difficulty in later levels can easily be achieved, simply by changing the timings in a behavior.
It might be a good idea to ask someone else to test the game in its current state, and listen to what they have to say about their first impressions of the game. Make a note of these comments and keep them. There will always be an opportunity to come back to this behavior at a later stage of the development to make further adjustments.
Ensure that, after experimenting, the game is tested thoroughly and is working correctly.
The game file that needs to be imported and loaded for this session is 5961_04_11.stencyl
.
Earlier in this chapter, we created an actor behavior called Manage Player Collisions
, in which the Collides with Collectibles
event removes the fruit from the scene when the monkey collides with it.
Try modifying the Collides with Collectibles
event so that it fades out the fruit rather than killing it instantly. Refer to the previous Time for action – making the statues disappear after a delay section, in which we changed the Manage Statues
behavior to fade out the statues. The code is very similar.
Right-clicking on an existing instruction block in a behavior, and selecting Copy from the drop-down menu, places the block into the Stencyl clipboard. The copied blocks can then be pasted (right-click, Paste) into the gray background area of a different behavior, and then dragged and dropped into the required location.
Try different timings for the fading of the fruit and note that timings do not have to be whole numbers. It is acceptable to specify fractions of a second, for example, do after 0.5 seconds
.
18.218.91.239