sinanqd10 Posted October 29, 2014 Share Posted October 29, 2014 var tween;function create() { var win = game.add.sprite(game.world.centerX,game.world.centerY,'win'); win.anchor.set(0.5); tween = game.add.tween(win.scale.set(0)); tween.to({x:1,y:1},800, Phaser.Easing.Elastic.Out,true,1800);}How can I remove the tween after it tween completed?I have tried this method,but it seems not working.tween.onComplete.add(function(){ tween.destroy();}); Link to comment Share on other sites More sharing options...
eguneys Posted October 29, 2014 Share Posted October 29, 2014 tween doesn't have a "destroy" function. Why do you want to remove a tween, you don't have to do that. Link to comment Share on other sites More sharing options...
sinanqd10 Posted October 30, 2014 Author Share Posted October 30, 2014 Yes sorry for my mistake eguneys. Now I have solved it. However, can I ask you 1 more question about button reset and play the game again.Here is the link for flash site http://www.happymeal.com.au/en_AU/index.html#/Home .Click games menu and scroll find the Rock Paper Scissors game. Can you show me the tricks? Link to comment Share on other sites More sharing options...
Shankspranks Posted November 4, 2014 Share Posted November 4, 2014 Hi sinanqd10 You want to investigate game states. Here's a great example game: https://developer.mozilla.org/en-US/docs/Games/Workflows/HTML5_Gamedev_Phaser_Device_Orientation Link to comment Share on other sites More sharing options...
Recommended Posts