Jump to content

How to set the world bounds in Phaser framework to circle


Hitman666
 Share

Recommended Posts

Hi,

 

I actually posted this question on StackOverflow but it got really just few views (only 6 since yesterday) so I'm posting it here in hope I would get help. Here's my question:

 

In Phaser framework I can set the world bounds by using:

this.game.physics.p2.setBounds(90, 90, 400, 400, true, true, true, true, false);

 

This will make world bounds in a rectangle shape. What I need, however, is to make a circle shaped world bounds (I have a drum in which I want the balls to "jump"). One idea I have (if more elegant solution won't be found) is to make a bunch of static objects around the image of the drum (similar to this example) but I would like to avoid that if possible, so if someone knows how to solve this help would be appreciated.

Also, I did see this pinball example but I couldn't find a way to get this in p2 physics.

So, a nudge in the right direction would be great!

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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