universaljs Posted December 18, 2015 Share Posted December 18, 2015 I have simple question, how to check if currently collision occurs with any object (not only from the map)?function update(){ if(player.body.ifNowCollisin==true) console.log('Right now there is a collision');} Link to comment Share on other sites More sharing options...
drhayes Posted December 18, 2015 Share Posted December 18, 2015 Depends on the physics you're using. If you're using Arcade, do "if (game.physics.arcade.overlap(player, otherSprite)) { }". BTW: in Phaser-speak, you probably mean overlap and not collide. "collide" will automatically separate the two sprites, while "overlap" will see if they're touching each other right now. Link to comment Share on other sites More sharing options...
universaljs Posted December 18, 2015 Author Share Posted December 18, 2015 x Link to comment Share on other sites More sharing options...
Recommended Posts