Jump to content

Position of rotating sprite around a point


se7en
 Share

Recommended Posts

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

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...