Sign in to follow this  
Reicher

Rotation of whole groups of bodies

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?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.