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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

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