cang Posted September 23, 2013 Share Posted September 23, 2013 First off awesome engine, it is making game development with html5 so much easier. Now on to the problem. Basically I noticed that when I have two empty groups and I try to check collision it fails when I have a third group. After some debugging I found out that the problem is with whatever first or maybe it is just whatever _iNext is in the group's container if it is empty. Assuming first is supposed to be the first child I believe this is a bug. Here is a quick snippet I made that replicates the problem. Basically if you uncomment group C the collide function will break. If group A and B actually have children then it works normally.var phaser, groupA, groupB, groupC;(function () { phaser = new Phaser.Game(800, 600, Phaser.WEBGL, '', { preload: preload, create: create, update: update});})();function preload() {}function create() { groupA = phaser.add.group(); groupB = phaser.add.group(); // groupC = phaser.add.group(); // <-- Uncomment to see groupB's first._iNext change.}function update() { console.log(groupA._container.first._iNext); console.log(groupB._container.first._iNext); phaser.physics.collide(groupB, groupA, handleCollide, null, this);}function handleCollide(a, {} Link to comment Share on other sites More sharing options...
rich Posted September 23, 2013 Share Posted September 23, 2013 Nice find. I have added in some extra checks so that if any of the groups involved in collision are empty the collision loop won't run. This will be part of the 1.0.6 release (for now it's in the dev branch). Link to comment Share on other sites More sharing options...
Recommended Posts