Could you explain how exactly the body of the snake gets distorted?
In case the snake is constantly moving, in each loop the only node that gets updated properly is the nodes the rest will get older values(each loop will update nodes with nodes[i-1]'s previous value instead of nodes[i-1]) because you loop from the bottom of the snake instead of it's head. (If your snake would stopped moving, after nodes.size() amount of frames the snake would get back together)
No, that's the way it is supposed to be but you're wasting the first node.size()-1 repeats of the loop/frame
In your code you have setted c.vy = 0; so when you use circles.yPosition-=circles.vy*(2*5); it doesnt really do anything cause this is always circles.yPosition-=0.
So you are currently only moving horrizontally.
Moreover, the following loop wouldn't work with the way you update the circles's position: (The circles wouldnt stay chainned)
for ( var i:int =4; i>0; i--)
circles[i].xPosition = circles[i-1].xPosition;
circles[i].yPosition = circles[i-1].yPosition;
// update circles position
To fix the current way you handle the snake's head movement, try doing something like this: (Haven't tested it and it IS missing cases)
//update circles position anyhow.
// Submit the changed position properly to the rest of the circles.
for (int i=1; i<5; i++)
if (circles.yPosition != circles[i-1].yPosition)
if (circles.xPosition != circles[i-1].xPosition)
circles.xPosition = circles[i-1].xPosition;
circles.yPosition-=( circles[i].vy*(2*5) - (the diameter of the circle)*i);
circles.xPosition-=circles.vx*(2*5); //apply the same you used on circles
Incase I'm wrong and that doesnt work , I would maybe advise you to control your FPS value(ie. lower it to like 1-5 in some cases), I think it would be easier to spot these kind of problems.