This is a follow up thread to this: http://www.kirupa.com/forum/showthread.php?p=2529594&posted=1#post2529594
I figured they are different enough problems that I should start a new thread…
At any rate, I have learned how to position graphics in a circular pattern and they space out evenly depending on how many graphics are in a given array.
So now, I want to be able to rotate the graphics in a clockwise or counter-clockwise pattern (not a sprite container that holds all of the graphics, but the graphics themselves.)
I am pretty close… here’s what I have so far:
private function weaponChange(e:KeyboardEvent):void {
if(e.keyCode == LEFT_KEY1 || e.keyCode == LEFT_KEY2 || e.keyCode == DOWN_KEY1 || e.keyCode == DOWN_KEY2) {
for(var i:uint = 0; i < _weaponSymbols.length; i++) {
var j:int;
if(i+1==_weaponSymbols.length) j=-1;
else j = i;
TweenLite.to(_weaponSymbols*, 1, {[COLOR=Red]bezier:[{x:600,y:600}[/COLOR],{x:_weaponSymbols[j+1].x,y:_weaponSymbols[j+1].y}]});
}
}
if(e.keyCode == RIGHT_KEY1 || e.keyCode == RIGHT_KEY2 || e.keyCode == UP_KEY1 || e.keyCode == UP_KEY2) {
trace("Counter - Clockwise")
}
}
So this gets each graphic to the next location just fine. Now notice what I have in red… I want the graphics to animate along the parameter of the circle. All I need to do that is to identify the x,y coordinates between the two graphics.
I figure the y will be easy because I can just subtract the y of one graphic from another… the x is something I have no idea how to do…
See the image I have attached… this illustrates the x Points that I’ll need depending on number of graphics.
Any help is appreciated!
AR