How do i extend the audio class?

I want to extend the audio class to play music.

function Music() {
}

Music.prototype.playDanger() {
}

Music.prototype.playNormal() {
}

I want to convert this file which can use cc.audioEngine
Please advice how to extend this class.

Thanks

why extending and don’t simply playing your audio files in your class?
Also this should be in the js part of the forum :smiley:

1 Like

:smile: Yes, Music script does not need any extend.
But it will be helpful to know how to extend menu, score which can be used in many other scenes.

Idk what you mean.