Jump to content

Jittering Collision


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.



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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

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