Jump to content

Blocked and touching


j0hnskot
 Share

Recommended Posts

Ok, got it. Blocked checks for collision between the sprite and a tile or the world bounds and touching checks between the sprite and an another sprite.

 

But it only worked when i used it in a button press: 

if(this.cursors.up.isDown){         console.log(this.p.body.touching.down);   //it outputs true here    	 if (this.p.body.onFloor()){            this.p.body.velocity.y = -250;        }}

How can i get it to work with a function like this :

if (this.p.body.blocked.down){        	           //do something}

without the need to put it into an input check?

Link to comment
Share on other sites

  • 3 weeks later...
 Share

  • Recently Browsing   0 members

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