Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

Overlapping Arcade Physics bodies don't separate


Recommended Posts



I've set up a group of sprites and they generally collide with each other fine, but if they are overlapping they don't separate (ie force each other apart). Is this only available with other physics types like Box2D or have I missed something?

create() {    this.enemiesGroup = this.game.add.group();    this.enemiesGroup.enableBody = true;    this.enemiesGroup.physicsBodyType = Phaser.Physics.ARCADE;    for(var i=0; i < 20; i++) {      var enemy:Phaser.Sprite = this.enemiesGroup.create(game.rnd.integerInRange(100, 770), game.rnd.integerInRange(0, 570), "gameboy", game.rnd.integerInRange(2,5))      enemy.name="enemy"+i;      enemy.body.bounce.y=0.8        enemy.body.collideWorldBounds=true;    }}update() {    this.game.physics.arcade.collide(group, group, this.groupCollisionHandler, null, this);}





Link to comment
Share on other sites


  • Recently Browsing   0 members

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