Intersection of custom boundaries

I am using setBoundsRectangle([bounds]) method to set multiple custom boundaries. However I need to allow the character to move between boundaries at their intersection points. Just like setBounds: [ Phaser.Physics.Matter.World] method to do this I’d like to disable the collision check for some parts of the boundaries.

The below image shows some of the boundaries and how they connect to each other:


The game has birdseye view but I don’t want to use tile map so I thought I may be able to use custom boundaries. However, after looking at examples and reading the API document I couldn’t find a way to do this?

If the player is the only body with a boundary then you can change the physics world checkCollision properties each time you change the boundary.

If not then you may have to use static body collisions instead.

Thank you for your answer. I don’t know if this is what you meant but I think I’ve done something similar. I am using a collider with a static group object which includes rectangles. These rectangles are like custom boundaries and the moving game object changes direction when collision happens.

1 Like