Search the Community
Showing results for tags 'sprite position'.
Found 1 result
Box2D and Sprite Position
VittorioSL posted a topic in Phaser 2I have a problem with relocating a sprite in the game. In practice dragging an object, if this collides with another, I'd like it to position it with certain coordinates. I use Box2D physic. When sprite collides with another I set its coordinates in this way: sprite.body.x = 100; sprite.body.y = 100; but when I reclick on the object this, in a first moment, appears with coordinates 100,100 and then returns to the coordinates at the time of the collision. Can anybody help me? I've been struggling with this problem for several days and I can not find a solution! Thanks in advance, Vittorio