phaser-ce-plugins icon indicating copy to clipboard operation
phaser-ce-plugins copied to clipboard

The flash effect in Juicy does not work

Open SomMeri opened this issue 10 years ago • 1 comments

I did not succeeded in making flash work. This is how I use it:

create: function() {
    this.juicy = this.game.plugins.add(new Phaser.Plugin.Juicy(this));
    this.flash = this.juicy.createScreenFlash('#ff0000');
    // .... 
},
update: function() {
        this.flash.flash(); //does not work
        this.juicy.shake(20, 20); //this works
    // .... 
}

Console contains no error, but nothing happen. Juicy is loaded correctly, because the shake function works fine.

The flash tween definition is also suspicious, because it does not use the duration variable.

SomMeri avatar Mar 13 '15 16:03 SomMeri

Hi,you'd better have a look this page: http://phaser-juicy.herokuapp.com/ And you can update your code like this:


create: function() {
    this.juicy = this.game.plugins.add(new Phaser.Plugin.Juicy(this));
    this.flash = this.juicy.createScreenFlash();
    this.add.existing(this.screenFlash);
    // .... 
},
update: function() {
        this.flash.flash(); // will ok
        this.juicy.shake(20, 20); //this works
    // .... 
}

Good luck.

duzhi5368 avatar Dec 03 '15 07:12 duzhi5368