Elgan Posted May 21, 2014 Share Posted May 21, 2014 First off, love this framework!would there be much difference in performance after load, with using a sprite as the background layer of a map agaisnt letting the tilemap render the background from a sprite. second;I have 3 latyers./ 1 background2 boulders3 boxes the boxes and boulders are bodies, hard tiles. Boxes can be destroyed with weapons. He walks round and collides with the tiles using .collide(), However, if he is stood with a wall on his left, and he presses left , the wall is blocked, he should play a different animation Little move tests show that hasTile is ALWAYS TRUE, even though i check the numbers and there is no tile there? var ghardTile = false; ghardTile = this.game.level.map.hasTile(pointGoing.x, pointGoing.y, this.game.level.boulderLayer); var gsoftTile = false; gsoftTile = this.game.level.map.hasTile(pointGoing.x, pointGoing.y, this.game.level.boxLayer); if (gsoftTile || ghardTile) { blocked = true; direction = DirectionType.NONE; }I want to detect if the tile next to me is blocked, i checked tile units usingvar tile = this.game.level.map.getTileWorldXY(x, y, 16, 16, this.game.level.backgroundLayer); var p = tile.x + " " + tile.y; 2,2 is where i am, if i put 2,2 into hasTile, for the other layers, its still true, even tho i am stood with no blocked tiles?Any ideas? 3. (sorry)Also, why do some examples use this.game.physics.arcade.collide(this, game.level.boxblockLayer) and some do not? without it, my main doesn't collide, it works beautiful with it, but i dont get why some examples like the spaceship one, don't need it. Is it because they both use p2 physics and not a mix of arcade and p2? Link to comment Share on other sites More sharing options...
InsaneHero Posted May 21, 2014 Share Posted May 21, 2014 I've been using the blocked property of body to detect when things are touching others. eg. if (this.sprite.body.blocked.down){ this.landed = true; // etc.}else{ this.landed = false; // etc.} Link to comment Share on other sites More sharing options...
Elgan Posted May 22, 2014 Author Share Posted May 22, 2014 thank you very much, great to know. will be useful in the future. right now I need hostile to work or another solution, I need to check if he's blocked before he tries to move and the booleans above only fire if velocity is applied. also a note. body seems to be missing intellisence? can someone check before I report it? Link to comment Share on other sites More sharing options...
Elgan Posted May 26, 2014 Author Share Posted May 26, 2014 tried dev and master now, both always return true for hastileCan someone please confirm this bug? Link to comment Share on other sites More sharing options...
Recommended Posts