I hope someone can help me with this.
What i want to do is when an object1 is placed on top of object2, object2 position will be in the previous origin position of object1 and vice versa
Is this even possible? Thanks in advance!
When you pick up object 1, you set object1.x and object1.y to some global variables. When you drop object 1, you set object 1 position to object 2, then set object 2 position to those global variables.
Thank you for your reply —
However this is easy if there are 2 sprites.
Sorry i didn't mention but this is only 1 sprite appearing as 2 object. How can i differentiate them from one another?
Thanks again if you could answer :)
Develop games in your browser. Powerful, performant & highly capable.
put the sprite in a family, and check if sprite is put on spritefamily.
then you will have both instances picked under different names: sprite.x and spritefamily.x