Add Sound Track

add sound track

How to implement this Pattern in MakeCode

Sound Track for One Level

If you want to keep the same music looping or if you only have one level then you can add a soundTrack in a simple way using the code blocks shown below.

Sound Track

Sound Effect for Enemy getting Zapped

If you already have more than one level then you may want to change the tune for different levels. You can see how to do this in the screenshot below.

Sound Track

Test your Changes and Next Steps

Test your game to check that your changes have the desired behaviour and that there are no side effects.

This Game Pattern is one of many allowing you to make improvements to your platform game and to learn coding and wider computing concepts. Find more on the Game Pattern page.

A next step you might want to try is to add sound effects when things happen.