Sam Posted January 3, 2015 Share Posted January 3, 2015 I also posted this under the Plugin-postFirst of all ~ thank you for this awesome plugin for this awesome framework ~Overlap / CollisionI have run into a problem which I do not know how to solve or why it happens.using latesest Phaser 2.1 and isoPlugin.no big GameCode, small for testing: When I check for overlap or collision in the update fun, nothing happens.the overlap / collision always returns: falseCreate:this.game.physics.startSystem(Phaser.Plugin.Isometric.ISOARCADE);this.game.physics.isoArcade.gravity.setTo(0, 0, -500); this.player = game.add.isoSprite(300, 200, 0, 'cube', 0, isoGroup);this.player.anchor.set(0.5, 1);game.physics.isoArcade.enable(this.player);this.player.body.collideWorldBounds = true;this.player.body.bounce.set(0,0,0.3);this.pillar = game.add.isoSprite(400, 100, 400, 'pillar', 0, isoGroup);this.pillar.anchor.set(0.5, 1);game.physics.isoArcade.enable(this.pillar);this.pillar.body.collideWorldBounds = true;this.pillar.body.immovable = true;Update:game.physics.isoArcade.collide(isoGroup);game.iso.topologicalSort(isoGroup); this.game.physics.isoArcade.collide(this.player, this.pillar, this.behindObj, this);console.debug(game.physics.isoArcade.overlap(this.player, this.pillar, this.behindObj, this)); //returns falseSo I think that I missed something, but don't know what, maybe someone else knows?Regards Link to comment Share on other sites More sharing options...
Sam Posted January 4, 2015 Author Share Posted January 4, 2015 Found it:this.player and this.pillar are in the same group.When I separate this.player into a second group and call: game.physics.isoArcade.collide(isoGroup);game.iso.topologicalSort(isoGroup);it works. But is this the common behavior?Do I have to check 2 different groups? And can I not check 2 Sprite in one group against each other?regards Link to comment Share on other sites More sharing options...
Sam Posted January 4, 2015 Author Share Posted January 4, 2015 okay problem was:callinggame.physics.isoArcade.collide(isoGroup);and then checking for collision between two sprites.remove the line above and it works. marked open topic as solved.just doing the collide with sprite vs. sprite and not the line above - double-checking seems that the second collision gets ignored.Regards Link to comment Share on other sites More sharing options...
Recommended Posts