Jump to content

How to set the world bounds in Phaser framework to circle


Recommended Posts



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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

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