You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bodies are still pushable when both pushable values are set to false when either one of them is a circle.
Works fine only when both are rectangles.
Example Test Code
varconfig={type: Phaser.AUTO,width: 864,height: 632,parent: 'phaser-example',backgroundColor: '#2d2d2d',physics: {default: 'arcade',arcade: {gravity: {y: 0},debug: true}},scene: {preload: preload,create: create,update: update,}};vargame=newPhaser.Game(config);functionpreload(){this.load.setPath('assets/sprites');this.load.image('blockANP');this.load.image('blockBNP');}varcursorsvarleftfunctioncreate(){this.physics.world.setBounds(0,0,864,632);cursors=this.input.keyboard.createCursorKeys();left=this.physics.add.image(200,196-16,'blockANP').setCollideWorldBounds().setInteractive();varright=this.physics.add.image(600,196-16,'blockBNP').setCollideWorldBounds().setInteractive();left.setBounce(0.5);right.setBounce(0.5);// If either one of these are a circle they will get pushed.left.setCircle(32)right.setCircle(32)left.setPushable(false);right.setPushable(false);this.physics.add.collider(left,right);}functionupdate(){if(cursors.left.isDown){left.setVelocityX(-160);}elseif(cursors.right.isDown){left.setVelocityX(160);}elseif(cursors.up.isDown){left.setVelocityY(-160);}elseif(cursors.down.isDown){left.setVelocityY(160);}else{left.setVelocity(0)}}
The text was updated successfully, but these errors were encountered:
Arcade body circles setPushable method updated to include collisions between two circles. Setting the Arcade Body setPushable(false) method for circle bodies prevents them from being pushed by other circle bodies.
This will be included in the next update. Thank you for bringing this to our attention!
Version
Description
Bodies are still pushable when both
pushable
values are set tofalse
when either one of them is a circle.Works fine only when both are rectangles.
Example Test Code
The text was updated successfully, but these errors were encountered: