Tufan Posted July 18, 2017 Share Posted July 18, 2017 I noticed that sprite.x/y doesn't have any effect on player coordinates in Phaser CE v2.7.10. However, sprite.body.x/y works perfectly. What is sprite.x/y for? Link to comment Share on other sites More sharing options...
lewster32 Posted July 20, 2017 Share Posted July 20, 2017 The sprite.x/y values correspond to a sprite's visual position. The sprite.body.x/y values correspond to its physics body position. If a sprite has physics enabled, then its body will 'drive' where the sprite appears, and so they'll both be the same. If physics is not enabled, then the sprite will not have a .body property and will only be positionable by its x and y properties. Link to comment Share on other sites More sharing options...
Recommended Posts