Jump to content

Is it possible to this.map.setTileIndexCallback as a true or false sensor?


DudeshootMankill
 Share

Recommended Posts

I've got this overlap callback working, so when my sprite overlaps with the ladder it returns the ladderMode fuction. Like such:

this.map.setTileIndexCallback([33, 43, 51, 61], this.ladderMode, this, this.ladderLayer);

 

Is it possible to make this a true or false callback? So that when i'm overlapping and this.ladderMode occurs it just returns for example ladderStatus = true;

and then when there's no overlap ladderStatus reverts to false?

 

i need it for this:

update: function () { 

if(ladderStatus) {

gravity = 0;

} else {

gravity = 130;

}

 

Thank you for your time.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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