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

decrease collision box size


moe091
 Share

Recommended Posts

Is there any way to decrease the size of the bounding box used for collisions in phaser? Right now I am just implementing my own collision inside phasers callback, essentially using phasers collision as a (slightly)-broad phase collision detection but it'd be cleaner and more efficient if I could just scale the collision box somehow without scaling the actual sprite.

 

Honestly I'm not sure which version of phaser I'm currently using, I downloaded it about a month and a half ago and didn't even pay much attention to it because I didn't expect to make any serious games yet. my current project was just too much fun and I blew it up into a big game(by html5 mobile game standards).

 

Anyway, thanks for any help. And thanks to Rich and everyone who worked on Phaser, it's awesome to work with!

Link to comment
Share on other sites

  • 1 year later...

there are so many guys replying to those questions with "sprite.body.setSize(width, height, x, y);" but its so bugged. if you set a different anchor for your sprite, the thing flies all over the screen into some corner and i cant seem to find a way around it :(

 

Edit:

i found the solution. you have to reset the players position after changing the size: player.body.reset(player.x, player.y);

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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