Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arcade Physics group create from array config result is incorrect #6519

Closed
samme opened this issue Jun 5, 2023 · 1 comment
Closed

Arcade Physics group create from array config result is incorrect #6519

samme opened this issue Jun 5, 2023 · 1 comment

Comments

@samme
Copy link
Contributor

samme commented Jun 5, 2023

Version

  • Phaser Version: 3.60.0

Description

If you pass an array of config objects as the children argument to add.physics.group() or new Phaser.Physics.Arcade.Group(), only the first config is used.

Example Test Code

Compare

this.add.group([
    { key: 'veg', frame: 0, setXY: { x: 0, y: 0 } },
    { key: 'veg', frame: 1, setXY: { x: 0, y: 32 } },
    { key: 'veg', frame: 2, setXY: { x: 0, y: 64 } },
]); // -> 3 sprites are created

and

this.physics.add.group([
    { key: 'veg', frame: 0, setXY: { x: 0, y: 0 } },
    { key: 'veg', frame: 1, setXY: { x: 0, y: 32 } },
    { key: 'veg', frame: 2, setXY: { x: 0, y: 64 } },
]); // -> 1 sprite is created

Additional Information

I think the problem is in https://github.com/photonstorm/phaser/blob/9e4d0ade2bfe6c6ec9e87ab65a57d05dd1b64332/src/physics/arcade/PhysicsGroup.js#L67-L81

photonstorm added a commit that referenced this issue Jul 21, 2023
…n an array of single configuration objects is given in the constructor. Fix #6519
@photonstorm
Copy link
Collaborator

Thank you for submitting this issue. We have fixed this and the fix has been pushed to the master branch. It will be part of the next release. If you get time to build and test it for yourself we would appreciate that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants