Time for action — add some music to our game
Our player doesn't have anything to listen to while playing our game. We're going to change that by adding a looped MP3 music file to the game.
1. Find a song file of the MP3 format (
.mp3
) that you would like to play in the background of your game.2. Rename this file to
Game.mp3
(or simplyGame
if you do not have file extensions visible).3. Put the renamed song file in the same folder as our game project, and then open up the game in Construct Classic.
4. In the Layout Editor, select the layer Game and then insert a new object into the layout.
5. Choose the object XAudio2 from the object group Audio and click on Insert.
6. Now switch over to the Event Sheet Editor and insert a new event. Choose the highlighted event Start of layout from the
System
object and click on Finish.7. Add an action for this event and choose the XAudio2 object. Select the highlighted action Play music from file and click on Next.
8. In the next screen, enter the text
AppPath...