Jump to content

body.onFloor(), body.blocked.down and body.touching.down allways to false


Sanju
 Share

Recommended Posts

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

  • 4 months later...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...