Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

Problem with groups


Recommended Posts

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


  • Recently Browsing   0 members

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