We start by loading the jump sound in the preload() function.
game.load.audio('jump','assets/jump.wav');
Click to enlarge
Now we add the sound in the game by putting this in the create() function.
this.jumpSound = game.add.audio('jump');
Click to enlarge
Last thing, we add this line in the jump() function to actually play the jump sound.
this.jumpSound.play();
Click to enlarge
And that's it, we now have animations and sounds in the game! In only a few lines of code we managed to make the game a lot better, that's the power of Phaser!