Jump to content

Rotate all elements of a group , not individually


marius98
 Share

Recommended Posts

var config = {
    type: Phaser.AUTO,
    width: 800,
    height: 600,
    scene: {
        preload: preload,
        create: create,
        update: update
    }
};

var group;

var game = new Phaser.Game(config);

function preload ()
{
    this.load.image('ball', 'assets/sprites/shinyball.png');
}

function create ()
{
    var circle = new Phaser.Geom.Circle(300, 300, 260);

    group = this.add.group({ key: 'ball', frameQuantity: 32 });

    Phaser.Actions.PlaceOnCircle(group.getChildren(), circle);
}
var p = new Phaser.Geom.Point(300,300);
function update ()
{
    Phaser.Actions.RotateAround(group.getChildren(), p, 0.01, 100);
}

Hello! I am new in phaser.

How can i rotate the hole group together?

In this code snippet they rotate each individually, but i don't want that.

How can i do that?

Thank you!

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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