O'Reilly logo

Haxe Game Development Essentials by Jeremy McCurdy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5. Adding Sound

In this chapter, we're going to add music and sound effects to make our new animations and gameplay really stand out. Good sound effects can make even simple animations have more punch, and music will focus players and keep them engaged. Luckily, OpenFL and HaxeFlixel make implementing music and sound incredibly easy.

Here's a rundown of the sections in this chapter:

  • Project updates
  • Creating sound constants
  • Building the sound manager class
  • Adding music
  • Adding menu sounds
  • Adding gameplay sounds

Project updates

To start, we'll update our project by adding the new sounds to the game. Then, we'll add a new section to our project settings XML file.

Adding new assets

In the assets folder, make a new folder named audio. Copy all of the new ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required