surzo18 Posted May 11, 2019 Share Posted May 11, 2019 (Phaser3) Hi i have problem with checking if new created object is overlaping with walls. I really don't know how to do this with Phaser. Don't know why i can't upload image so here is link with image: https://ctrlv.cz/61yh My Code looks like this for now: function updateAi(){ if ( enemies.children.size === 0) { for(var i=0 ; i <= Lvl; i++){ var ranX = Phaser.Math.Between(17,map.widthInPixels - 16 ); var ranY = Phaser.Math.Between(17, map.heightInPixels - 16); var newOrk = enemies.create(ranX, ranY, 'orc'); i++; //IF NEW ORK OVERLAPING OTHER ORK OR WALLS CREATE NEW ORK } } } Thx for help. Link to comment Share on other sites More sharing options...
Recommended Posts