So I made a game. There is a Man and a Sword. You can drag the sword. I have an idea:
If I drag the sword, and I move it to man, then the man will pick it up. If I don't move it to man, then the sword teleporting back to the first position.
How can i programm this? I Tried this, but doesn't work:
on (press) {
startDrag(this);
}
on (release) {
stopDrag();
if (_root.vcam.inventory.inventory_items.sword1._y == 90 - 270 & _root.vcam.inventory.inventory_items.sword1._x == -430 - -350)
{
_root.man.sword._visible = true;
}
else
{
_root.vcam.inventory.inventory_items.sword1._x = 0;
_root.vcam.inventory.inventory_items.sword1._y = 0;
}
}