avishek0307 Posted July 21, 2015 Share Posted July 21, 2015 hello friends, Can anyone tell me how to make a sprite rotate continuously around a fixed point. thnks Link to comment Share on other sites More sharing options...
Skeptron Posted July 21, 2015 Share Posted July 21, 2015 You can use tweens : http://phaser.io/examples/v2/sprites/rotate-and-scale(Put a very big angle if you want it to rotate forever) Code looks like :game.add.tween(sprite).to( { angle: 45 }, 2000, Phaser.Easing.Linear.None, true); avishek0307 1 Link to comment Share on other sites More sharing options...
rich Posted July 21, 2015 Share Posted July 21, 2015 sprite.position.rotate(fixedPoint.x, fixedPoint.y, a, true, distancePx);Put that in an update function. Where a = the amount of degrees to rotate per update (try a value like 1 or 2 to start with) and distancePx is the distance of the sprite from the fixed point, in pixels. Tilde 1 Link to comment Share on other sites More sharing options...
avishek0307 Posted July 21, 2015 Author Share Posted July 21, 2015 You can use tweens : http://phaser.io/examples/v2/sprites/rotate-and-scale(Put a very big angle if you want it to rotate forever) Code looks like :game.add.tween(sprite).to( { angle: 45 }, 2000, Phaser.Easing.Linear.None, true);thnks for replying me but its not actually what am searching for . Link to comment Share on other sites More sharing options...
avishek0307 Posted July 21, 2015 Author Share Posted July 21, 2015 thnks Rich for the answer .. exacly what i was searching for :D (Y) Link to comment Share on other sites More sharing options...
Recommended Posts