Jump to content

How to get access to instance's property from callback method


EgorkZe
 Share

Recommended Posts

create() {

       this.game.physics.startSystem(Phaser.Physics.P2JS);

        this.game.physics.p2.gravity.y = 700;

 

        this.platformArray = [];

        this.startGame(); 

        this.game.input.keyboard.onUpCallback = Level1.prototype.upCallback; 

}

        

upCallback(e){

     if(e.keyCode == Phaser.Keyboard.X){

          this.player.endSlide();   //I can't get access here

     }

}

 

How to get access for player's method?

 

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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