i really need help! i have 10 actors (clones!) on screen, all from one baseactor, called diamond.
they only differ in animations (red, blue, green and so on...).
now when i click one "diamond" (one clone), and then another, i want these two to swap / exchange positions on screen.
so basically diamond1 = diamond2 x and y and diamond2 = diamond1.x and y.
however i cannot get this to work. i tried something like this in mouse down event:
- Code: Select all
Actor *a,*b;
a = getclone(diamond);
sourcex = a->x;
sourcey = a->y;
and within second mouseclick:
- Code: Select all
b = getclone(diamond);
targetx = b->x;
targetx = b->y;
// swap positions
a->x = targetx;
a->y = targety;
b->x = sourcex;
b->y = sourcey;
the code is not complete here, it´s just to show what i´m trying to do and what i came up with so far.
however this doesnt work, the first diamond jumps to the "target" diamond , but this one doesnt jump back to where
i have first clicked
can anybody help me to achieve this somehow? whats a good way to do it?