Jump to content

Add symbol animation


Ricky
 Share

Recommended Posts

Hi, i'm new on this forum and also new with pixijs

I've started to implement a new slot game, all work fine but i have some problems implementing symbols animations.

on stop spin, i'ma able to change symbols

stopSpin: function(){
            var offScreenCells = this.getOffScreenCells();
            var easeType = Power1.easeOut;
            for(var i = 0; i < this.numRows; i++){
                offScreenCells[i].updateSymbol(this.resultReel[i]);
                offScreenCells[i].stage.y = this.cellPosOriginal[i].y;
                TweenLite.to(
                    this.spinTrickCells[i].stage,
                    0.5,
                    {
                        y: this.spinTrickCells[i].stage.y + (this.reelCellHeight * this.numRows),
                        ease: easeType
                    }
                );
                // Tween onComplete callback to be added only to one Symbol.
                var callback = (i === this.numRows - 1) ? this.onSpinStop.bind(this) : null;
                TweenLite.to(
                    this.cells[i].stage,
                    0.5,
                    {
                        y: this.cells[i].stage.y + (this.reelCellHeight * this.numRows),
                        ease: easeType,
                        onComplete: callback
                    }
                );
            }
        },

 

Here i'm getting symbol from frame ex. S1

updateSymbol: function(symbolID){
            this.symbolID = symbolID;
            this.removeSymbol();
            this.symbol = new PIXI.Sprite(PIXI.Texture.fromFrame(symbolID));
            
            console.log(symbolID);
            this.stage.addChild(this.symbol);  
            
        },

 

But i'm not able to implement this part of code

updateSymbol: function(symbolID){
            this.symbolID = symbolID;
            this.removeSymbol();
            this.symbol = new PIXI.Sprite(PIXI.Texture.fromFrame(symbolID));
            this.symbol = new PIXI.extras.AnimatedSprite("osiris");
            this.symbol.animationSpeed = 0.100;                  // 6 fps
            this.symbol.scale.x=0.40;
            this.symbol.scale.y=0.40;
            this.symbol.play();
            console.log(symbolID);
            this.stage.addChild(this.symbol);  
            
        },

 

I'm getting always the same error:

Uncaught TypeError: Cannot read property '_updateID' of undefined on Sprite.js

Where is my mystake?

 

Thanks

 

Riccardo

 

 

 

 

 

 

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...