Stephen304 Posted January 22, 2014 Share Posted January 22, 2014 So I have a sprite for the player basically the same way as tutorials: player = game.add.sprite(32, game.world.height - 150, 'man'); player.body.bounce.y = 0; player.body.gravity.y = 6; player.body.collideWorldBounds = true;And I know I can set velocity withplayer.body.velocity.x = 150;But how can I teleport the player? I have tried:player.body.x = 50;But it seems to get reverted back instantly to the original coordinate. Link to comment Share on other sites More sharing options...
XekeDeath Posted January 22, 2014 Share Posted January 22, 2014 Set player.x instead. The body should follow.This may cause some strange behaviour, as the body and sprite will be in different places for the frame. Luiz Bills 1 Link to comment Share on other sites More sharing options...
Stephen304 Posted January 22, 2014 Author Share Posted January 22, 2014 Thanks, that works! Link to comment Share on other sites More sharing options...
Recommended Posts