Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Stencyl Essentials
  • Toc
  • feedback
Stencyl Essentials

Stencyl Essentials

By : Sneyd
4.4 (5)
close
Stencyl Essentials

Stencyl Essentials

4.4 (5)
By: Sneyd

Overview of this book

If you are a computer game enthusiast who has always wanted to know what it takes to build a playable game, or maybe you would like to expand your programming knowledge so that you can develop great computer games using a solid game engine and toolkit, then this book is for you.
Table of Contents (14 chapters)
close
13
Index

Playing sound FX and music in Stencyl


Well done! You have now successfully imported both music and sound FX files. Now all that remains is to trigger them in the code. Perform the following steps to do so:

  1. Open up the Player Handler behavior, and in the events pane, switch to Created, as shown in the following screenshot:

  2. In the blocks palette, go to Sound & Images | Sound | Playback, then drag out a Play Sound block, and add it to the stock of blocks in the when created event block, as shown in the following screenshot:

  3. Change Play to Loop, as shown in the following screenshot:

  4. Navigate to Sound | Choose Sound, as shown in the following screenshot, then select Country Music, and click on OK to commit, as shown in the following screenshot:

Now, when we test the game, Country Music will start looping at the beginning of every game level! Next, we need to trigger the Whip Away Sound FX whenever we whip a rock. Perform the following steps to do so:

  1. In the events pane, go to Custom Block in the...

bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete