How to make player restrict of boundries in phaser js game?

Viewed 24
1 Answers

Just call the method setCollideWorldBounds on the players physics object, than the player should not be able to leave, teh Zone.

In the create function just add this line of code: this.player.body.setCollideWorldBounds(true);

Related