Time for action – implementing a pickup sound effect

The game file to import and load for this session is 5961_07_03.stencyl.

  1. Download Stencyl Book Pickup Effect from StencylForge, and then close the tabs for the sound effect and StencylForge.
  2. In the Sound Management behavior, add a new custom event called Pickup SFX.
  3. Configure the new Pickup SFX event as shown in the following screenshot:
    Time for action – implementing a pickup sound effect
  4. Open the Manage Player Collisions actor behavior, and ensure that the Collides with Collectibles event is selected.
  5. Add a trigger for the PickupSFX event as highlighted in the following screenshot, which shows an extract from the Collides with Collectibles event:
    Time for action – implementing a pickup sound effect
  6. Test the game and collect some fruit!

What just happened?

We now have a second sound effect in our game: a pickup sound effect is played as each piece of fruit is collected.

After downloading the sound effect from StencylForge, the process to make the sound play took only a few changes.

We have created a Pickup SFX event in the Sound Management behavior, which plays the appropriate sound effect when the custom event PickupSFX is triggered. Now, whenever we need to play the pickup sound effect in our game, we can simply trigger the PickupSFX event in the Sound Management behavior! In our game, this sound effect is going to be played whenever the monkey collects a piece of fruit.

We already have a Fruit Collected event in the Manage Player Collisions behavior, so our final step was to insert a trigger for the PickupSFX event.

Have a go hero

The game file to import and load for this session is 5961_08_04.stencyl.

We've created a behavior for managing sounds within our game, and we have worked step-by-step through the process of adding sound effects to different actions: jumping and collecting fruit.

Using the resources in StencylForge, try implementing sound effects for the following actions that occur within the game:

  • Monkey collides with an enemy
  • Player runs out of lives
  • Level completed successfully
  • Timer is running low

Also consider which other actions within the game would benefit from accompanying sound effects.

Note

Appendix, Planning, Resources and Legal Issues, contains information about locating and creating new sound effects for use within our games.

Be aware that too many sound effects can be very distracting for the player!

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.116.63.174