Jump to content

AudioName extends Phaser.Audio


Recommended Posts

module Sounds
    export class Timer extends Phaser.Sound
        public autoplay: boolean = false;

        public constructor(game: Phaser.Game)
            super(game, 'timerSound', 1);

I've sound class, which extends to Phaser.Sound

When I'm creating instance of this audio class and call play method, doesn't work.

var timerOudio: Phaser.Sound = new Sounds.Timer(game);

and this code bellow works fine:

var timerAudio: Phaser.Sound = game.add.audio('timerSound');

In case, when I'm creating sprite and extending it to Phaser.Sprite, I'm adding in constructor: 


But this doesn't work for audio.

What I'm doing wrong with audio?

Link to comment
Share on other sites


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...