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
I just changed the initial velocities to make them do the weird collide bug.
var config = {
type: Phaser.AUTO,
width: 800,
height: 600,
parent: 'phaser-example',
physics: {
default: 'arcade',
arcade: {
debug: true,
gravity: { y: 100 }
}
},
scene: {
preload: preload,
create: create
}
};
var game = new Phaser.Game(config);
function preload ()
{
this.load.image('wizball', 'assets/sprites/wizball.png');
}
function create ()
{
var ball1 = this.physics.add.image(100, 240, 'wizball');
var ball2 = this.physics.add.image(700, 240, 'wizball');
ball1.setCircle(46);
ball2.setCircle(46);
ball1.setCollideWorldBounds(true);
ball2.setCollideWorldBounds(true);
ball1.setBounce(1);
ball2.setBounce(1);
// here are the changed velocities
ball1.setVelocity(150, 0);
ball2.setVelocity(-150, 0);
this.physics.add.collider(ball1, ball2);
}
Additional Information
I'm currently building a game of "bumper ships", where the collisions should work like a billard game. This weird bounce is the only thing that is holding me back.
Billard games are very common, and I wonder if anyone has tried to make one with the arcade physics engine. If you did, I'll be glad to hear how you managed the collisions.
The text was updated successfully, but these errors were encountered:
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.
Version
Description
This concerns the arcade physics engine.
If you have two Circles colliding "sideways" while both having a velocity, the bounce will be extremely weird, like if they are "bouncing back".
Example Test Code
This code is almost exactly the same than this example : http://labs.phaser.io/view.html?src=src\physics\arcade\circular%20body.js&v=3.15.1
I just changed the initial velocities to make them do the weird collide bug.
Additional Information
I'm currently building a game of "bumper ships", where the collisions should work like a billard game. This weird bounce is the only thing that is holding me back.
Billard games are very common, and I wonder if anyone has tried to make one with the arcade physics engine. If you did, I'll be glad to hear how you managed the collisions.
The text was updated successfully, but these errors were encountered: