Jump to content

Showing body of a group of sprites in debug?


Recommended Posts

I'm using arcade physics and trying to disply the bodies of a group of sprites using debug. I figured it'd be: game.debug.body(group); in the renderer function but that doesn't work. 


As an alternative I've used game.debug.quadTree(game.physics.arcade.quadTree); in renderer
, but it doesn't allow as much control. that or I'm using it wrong... for instance, say I have 2 groups nested under one


group1 = game.add.group();

group1.enableBody = true;

group2 = game.add.group();

group2.enableBody = true;

mainGroup = game.add.group();

and under the update function add:
game.physics.arcade.collide(sprite, group1);
game.physics.arcade.collide(sprite, group2);
for some reason the debug function for quadTree will only display the last group in which collision is declared. So in the above case it'll only display the bodies of group2. If I were to declare group1 after group2, then it will display the bodies of group1.
So.... I figure I'd just use another function just to display the bodies of a group, but as I started this post out with, I can't figure out how to do so.
Any Ideas?
Link to comment
Share on other sites

  • 2 months later...
  • 2 years later...
  • 5 months later...

  • Recently Browsing   0 members

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