se7en Posted November 4, 2017 Share Posted November 4, 2017 Hello everyone. I create a sprite and set its pivot to rotate it around the center. Just wonder why not its position updated, as console log wrote its x and y position always at the center, but then it is rotating and moving. create: function { let sprite=game.create.sprite(game.world.centerX, game.world.centerY,"sprite"); sprite.pivot.y=500; }; update: function { sprite.rotation+=0.1; console.log(sprite.x); console.log(sprite.y); } Is it the way I do it improper? Can anyone help me out? Thanks. Link to comment Share on other sites More sharing options...
samme Posted November 4, 2017 Share Posted November 4, 2017 position and pivot are independent. Link to comment Share on other sites More sharing options...
se7en Posted November 5, 2017 Author Share Posted November 5, 2017 Thanks for the answer. The problem solved using sprite.angle and some math.sin and cos function. Thank a lot for your time. Link to comment Share on other sites More sharing options...
Recommended Posts