sansa Posted June 13, 2017 Share Posted June 13, 2017 (edited) Hello, I'm having an issue with the tween. For example a card flip. this.cardChoice = game.add.sprite(213, 255, 'normal_cards', 'back_card'); this.cardChoice.anchor.setTo(0.5, 0.5); this.cardChoice.scale.setTo(0.84, 0.80); this.cardChoice.scale.setTo(0.84, 0.80); public cardFlip() { this.tweenPCard = this.game.add.tween(this.cardChoice.scale).to( { x: 0 }, 200, 'Quart.easeOut'); this.tweenPCard.start(); this.tweenPCard.onComplete.add(this.choiceCardFlip, this); } public choiceCardFlip() { this.tweenChoice = this.game.add.tween(this.choice.scale).to( { x: 0.84 }, 200, 'Quart.easeOut'); this.tweenChoice.start(); } In the first few plays the tween is good but after several plays the card is not flipping and it's like the this.tweenCard = this.game.add.tween(this.cardChoice.scale).to( { x: 0 }, 200, 'Quart.easeOut'); is disappearing. Thanks. Edited June 14, 2017 by sansa Put the code in code snippet, corrected the variable Link to comment Share on other sites More sharing options...
Abhishek Singhal Posted June 13, 2017 Share Posted June 13, 2017 can't figure out any issue in the above code section. can you add some reference or link , to demo the issue you are facing ? Link to comment Share on other sites More sharing options...
sansa Posted June 14, 2017 Author Share Posted June 14, 2017 13 hours ago, Abhishek Singhal said: can't figure out any issue in the above code section. can you add some reference or link , to demo the issue you are facing ? Hello, Abhishek Singhal. Please see the attached image. So every gameset has 5 rounds. We have this feature of autoplay so it's like looping the gameset. For example i set the autoplay with 99 so it will loop 99 times. In first few plays(or in first few gamesets) it tweens smoothly but the longer you play this it's like the card is not flipping anymore like it is now blinking. Thank you so much. Link to comment Share on other sites More sharing options...
samme Posted June 14, 2017 Share Posted June 14, 2017 Is tweenCard supposed to be the same as tweenPCard? Link to comment Share on other sites More sharing options...
sansa Posted June 14, 2017 Author Share Posted June 14, 2017 50 minutes ago, samme said: Is tweenCard supposed to be the same as tweenPCard? Hi, yes, sorry for the typo. I'll edit it. Thanks. Link to comment Share on other sites More sharing options...
Recommended Posts