Jump to content

Rotation of whole groups of bodies


Reicher
 Share

Recommended Posts

Hi! I'm really starting to get into Phaser and would like to know it better. 

 

I have a couple of of bodies in a group, they all fall down nicely with the arcade physics. 

But I want to rotate them around a center point. I do this by tweening the group, the rotation looks great but once it's done they moving (falling?) in weird directions. 

 

A theory in #phaserio on freenode was that the bodies are still falling down relative to the group down? Why are they not falling down in the "world's down"?

this.physics.startSystem(Phaser.Physics.this.physics.arcade.gravity.y = var aGroup = this.add.group();aGroup.x = game.world.centerX;aGroup.y = game.world.centerY;var sprite = aGroup.create(-100, 0, 'phaser');sprite.anchor.set(0.5);this.physics.arcade.enable(sprite);    var sprite2 = aGroup.create(100, 0, 'phaser');sprite2.anchor.set(0.5);this.physics.arcade.enable(sprite2);    var tween = this.add.tween(aGroup).to ( {angle: '-90' }, 500, Phaser.Easing.Linear.None, true);	

Example on pastebin: http://jsbin.com/vesiha/1

 

Am I doing something wrong or is this how it's supposed to behave? How could you do this any other way?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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