duck

duck

May 21st, 2010
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         // count the next body piece number (wrapping to zero):
  2.         bodyPieceNum++;
  3.         bodyPieceNum %= bodyPieces.length;
  4.        
  5.         // place the next 'body piece' at the old head position
  6.         bodyPieces[bodyPieceNum].position = transform.position;
  7.        
  8.         // move the head to the new position
  9.         x += moveX;
  10.         y += moveY;
  11.         transform.position = Vector3 ( x * gridSize, 0, y * gridSize);
Advertisement
Add Comment
Please, Sign In to add comment