Jump to content

Problems using tilesprite as a platform


Recommended Posts


I want the player jump on a platform may be jumping again ... The result is a bit strange because player can not move correctly and it can not jump again. 

The player only jumps if your body is on the ground. onFloor() 


This is my code: 


             this.game.add.group this.movableTiles = (); 


             this.game.add.tileSprite this.tileMovable1 = (200, 120, 48, 16, 'tileMovable'); 

             this.tileMovable1.anchor.setTo (-0.5, -0.5); 

             this.tileMovable1.body.immovable = true; 

             this.tileMovable1.body.setRectangle (48, 16); 

             this.tileMovable1.body.x = 200; 

             this.tileMovable1.body.y = 120; 

             this.movableTiles.add (this.tileMovable1); 



             this.game.physics.collide (this.player, this.movableTiles); 


Any idea?

Link to comment
Share on other sites


  • Recently Browsing   0 members

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