Sanju Posted September 3, 2015 Share Posted September 3, 2015 Hello, I'm making my first steps with phaser working on a simple platformer for learning, and I found a problem I can't figure how to solve. The problem is that I want the player to be able to jump only when it's on ground but I tried using body.onFloor(), body.blocked.down and body.touching.down and I'm allways getting false return. I must be doing something wrong, but I don't know what it is. When I disable the collisions with tiles it works OK with player.body.collideWorldBounds = true; Could somebody help me, please? Here is my tilemap creating code: this.map = this.game.add.tilemap('myTileMap'); this.map.addTilesetImage('pencilMan', 'pencilMan'); this.layer = this.map.createLayer('Capa de Patrones 1'); this.map.setCollision(9,true); Link to comment Share on other sites More sharing options...
Sanju Posted September 4, 2015 Author Share Posted September 4, 2015 Solved.I needed the this.game.physics.arcade.collide(this.player, this.layer); in update function . hoskope 1 Link to comment Share on other sites More sharing options...
demisephi Posted September 4, 2015 Share Posted September 4, 2015 true Link to comment Share on other sites More sharing options...
Skeptron Posted September 4, 2015 Share Posted September 4, 2015 Please mark your post as solved. Some other devs might run into the same problem! =D Link to comment Share on other sites More sharing options...
hoskope Posted January 10, 2016 Share Posted January 10, 2016 Can somebody explain difference between all three? Link to comment Share on other sites More sharing options...
Recommended Posts