Jump to content

Problem with essentials 'flash'


Ninjadoodle
 Share

Recommended Posts

Hi @enpu

I'm having a bit of a problem getting the essentials plugin's 'flash', working here.

It works correctly in every other case, but here I have the sprite alpha set to 0 and only set it to 1 just before doing the 'flash' - and it doesn't work.

If I have the alpha set to 0.5 and set it to 1 just before the 'flash', then the flash still happens.

game.createClass('S07PuzzleTile', {
    
    init: function(image, x, y, id) {
        
        this.id = id;
        this.sprite = new game.Sprite(image);
        
        this.sprite.position.set(x, y);
        this.sprite.anchorCenter();
        this.sprite.alpha = 0;
        this.sprite.interactive = true;
        this.sprite.addTo(game.scene.mg);
        
        this.sprite.mousedown = this.mousedown.bind(this);
    },
    
    mousedown: function() {
        
        if (!game.scene.solved) {
                
            game.audio.playSound('click.wav');
            
            if (game.scene.progress === 0) {
                
                if (this.id === 1) {
                    
                    this.sprite.alpha = 1;
                    this.sprite.interactive = false;
                    this.sprite.flash(250, '#ffffff');
                    game.scene.progress ++;

Thanks in advance for any feedback :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

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