Jump to content

Jittering Collision


Telash
 Share

Recommended Posts

Hey Guys,

I have having a bit of an odd issue with the collision physics, I have stacked 3 blocks onto of each other (after having them dropped from above) they are all part of the same group and I have them set to collide with themselves, however they seem to jitter about of the stop, almost like they are stuck in a mini bounce, however I have set bounce to 0 and I still seem to be getting this error, does anybody know why this is happening?

BasicGame.Roll.prototype = {	create: function () {			var dice1 		= Math.floor((Math.random()*6)+1);		var dice2 		= Math.floor((Math.random()*6)+1);		var dice3 		= Math.floor((Math.random()*6)+1);		var diceImage;				this.diceSet = this.add.group();				for(var i = 1; i <= 2; i++) {					switch(i) {				case 1:					diceImage 	= dice1;				break;				case 2:					diceImage 	= dice2;				break;				case 3:					diceImage 	= dice3;				break;			}					var dice = this.diceSet.create(100, -170*i, diceImage);			dice.scale.setTo(2, 2);					}				this.diceSet.setAll('body.gravity.y', 1000);		this.diceSet.setAll('body.bounce.y', 0);		this.diceSet.setAll('body.minBounceVelocity', 0);			this.add.sprite(0, 0, 'frame');				this.floor = this.add.sprite(0, this.world.bounds.height-75, 'floor');		this.floor.body.immovable = true;	},	update: function () {		this.physics.collide(this.diceSet, this.diceSet);		this.physics.collide(this.diceSet, this.floor);	}

Thanks in advance.

Telash

 

Edit: From what I can tell it appears to be an issue with the scaling.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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