olavur Posted March 29, 2017 Share Posted March 29, 2017 HI Been going through the Book Discover Phaser, but are stuck with this bit of code: Quote if (this.cursor.up.isDown && this.player.body.touching.down) { // Move the player upward (jump) this.player.body.velocity.y = -320; } The jump functionality on the player somehow doe's not work. When I console.log the body.touching object, I can see, that body.touching.down does not turn true, when the player hit's the a platform. Furthermore, the cursor.up is detected when I leave out this bit of code: '&& this.player.body.touching.down', but somehow does not function, when the code is as in the Quote. Any Ideas to what I should be looking for? Thanks. Link to comment Share on other sites More sharing options...
samme Posted March 30, 2017 Share Posted March 30, 2017 body.touching is contact with another sprite as detected by arcade.overlap/collide, called previously, during the current update. body.blocked is contact with a tile or the world boundary. Link to comment Share on other sites More sharing options...
olavur Posted March 31, 2017 Author Share Posted March 31, 2017 OK. I'll look into that. Thanks for the answer Link to comment Share on other sites More sharing options...
Recommended Posts