Jump to content

Rotate all elements of a group , not individually


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

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.

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.


  • Recently Browsing   0 members

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