Jump to content

How do you show the hitbox of a sprite?


Puzz3l
 Share

Recommended Posts

  • 8 months later...

Just to help anyone that happens to need to do this to a group, you can call game.debug.body using forEachAlive but you need to set the context to game.debug otherwise you'll receive an error about there being no start() method in the existing context (since sprites have no start method, and the function game.debug.body assumes the scope of 'this' is the parent scope).

 

ex:
 

debugMode: function () {		game.debug.body(this.captain, "#9090ff", false);		this.enemy.forEachAlive(game.debug.body,game.debug,"#ff9090",false);		this.redLasers.forEach(game.debug.body,game.debug,"#dd00dd",false);		this.blueLasers.forEach(game.debug.body,game.debug,"#00dd00",false);	},
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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