How to set world boundaries in Phaser for environment

In the Phaser framework, I can set the boundaries of the world using:

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

      

This will make the borders of the world rectangular. I need, however, to make a circle on a global scale (I have a drum in which I want the balls to "jump"). One of my ideas (unless a more elegant solution is found) is to create a bunch of static objects around the drum image (similar to this example ), but I would like to avoid this if possible, so if anyone knows, how to solve this help will be appreciated.

+3


source to share





All Articles