RatonPaladin Posted May 28, 2015 Share Posted May 28, 2015 Hi guys! I need your help, forgive me if my english is a little bit ugly (I'm French) Actually I'm trying to make a game with Phaser, and my player can jump.The problem is the condition: if (player.body.touching.down){ //jump settings} With the "touching.down", anytime the player hits something under him, he can jump (so if he walks on a baddie, on objects, on platform without collisions etc). Is there a way to allow the player to jump ONLY when he is on a "OK" platform with collisions?( Overlap doesn't works because of the collide "this.physics.arcade.collide(this._player, this._g_platforms);" )( Blocked.down only works for the world bounds, that's not what I want :/ ) Thanks! Link to comment Share on other sites More sharing options...
frenetikm Posted June 1, 2015 Share Posted June 1, 2015 Hi I had the same problem, the solution is to use tilemaps, so you can use player.body.onFloor(); from the docs: onFloor() → {boolean} Returns true if the bottom of this Body is in contact with either the world bounds or a tile. perhaps there is another way to do this, but I think tilemaps are the best solution for differentiate the platform and the objects. Link to comment Share on other sites More sharing options...
Recommended Posts