Sabino Posted February 14, 2017 Share Posted February 14, 2017 I've always been using the following method to allow a player to jump from a sprite object. if (cursor.up.isDown && player.body.touching.down) {player.body.velocity.y = -300} else {player.body.velocity.y =200} But, using a tilemap, the previous method does not work. I've also tried player.body.blocked.down player.body.onFloor() without success. Is there any way to allow a player jump on a tilemap? Thanks Link to comment Share on other sites More sharing options...
rroylance Posted February 14, 2017 Share Posted February 14, 2017 Refer to https://phaser.io/examples/v2/tilemaps/map-bounce; it shows loading in a tilemap and having a character jump on the tiles. Especially L27: map.setCollisionBetween(1, 12); and L48: game.physics.arcade.collide(sprite, layer); Also... 'does not work' and 'without success' are not quite clear so I'm not sure what your exact issue is. Does the character not collide with the tiles? does he not actually jump at all? etc... Link to comment Share on other sites More sharing options...
Pavel Mishin Posted January 10, 2019 Share Posted January 10, 2019 I have the same issue, even if I disable touching.down and blocked.down checking. The character can jump when standing on bottom world bound, but not on the tilemap layer. Collisions handled correctly - the character can walk on tiles. Link to comment Share on other sites More sharing options...
Recommended Posts