I wrote the following code:
int a=0, b=0, c=0, d=0;
sprite[number[0]].setPosition(160, 600);
sprite[number[1]].setPosition(560, 600);
sprite[number[2]].setPosition(360, 400);
sprite[number[3]].setPosition(360, 800);
seiten[number[4]].setPosition(-35, 0);
seiten1[number[4]].setPosition(825, 0);
sprite[number[0]].setOrigin(200,0);
sprite[number[1]].setOrigin(-200,0);
sprite[number[2]].setOrigin(0,-200);
sprite[number[3]].setOrigin(0,-200);
sprite[number[0]].setRotation(a++);
sprite[number[1]].setRotation(b++);
sprite[number[2]].setRotation(c++);
sprite[number[3]].setRotation(d++);
I want to rotate the sprites like:
Unfortunately, this code doesn´t work for this purpose. How can I improve my code?
EDIT:
For better understanding:
I have ten sprites with different colors, four of them are shown on the game screen. The coincidence decides which sprite will be shown, but each sprite of them has a different color. Now I want to rotate the four sprites in the lane which is shown in the image. The four sprites should turn on the pink sprite which in fact doesn´t exist in my code. This pink sprite is just a symbol for the centre of the rotation (P(360|600)). The four sprites rotate all in the same lane.
With my code the four sprites rotate but not in the same lane as it is shown in the image. I hope my question is now more clear.