Jump to content

Move group with tween coordinates problem


misfit
 Share

Recommended Posts

Hello,

I want to move group of sprites toward the player:

var goBack = this.game.add.tween(this.pullGroup);
goBack.to({x: this.player.world.x,y: this.player.world.y},2000);
goBack.start();

But it seems that the group treats coordinates x, y as starting from group (like it has its own coordinate system) and not from Canvas' (0,0). How to make the tween movement work with world coordinate system and not in group (0,0)?  

Thanks for help,

 

Edit #1

Ok I have overcome this problem by dividing player.x - child[0].x and the same for y. 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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