Exemple #1
0
 public SnakeBody(Texture bodyTexture, Coordinates position, int length)
 {
     isBitten = false;
     texture = bodyTexture;
     bodyParts = new List<SnakeBodyPart>();
     for (int i = 0; i < length; i++)
     {
         bodyParts.Add(new SnakeBodyPart(texture, position));
         this.length++;
     }
 }
Exemple #2
0
 public SnakeHead(Texture headTexture, Coordinates headPosition)
 {
     texture = headTexture;
     position = new Coordinates(headPosition);
     previousPosition = new Coordinates(headPosition);
     targetPosition = new Coordinates(headPosition);
 }
Exemple #3
0
 public SnakeBodyPart(Texture bodyTexture, Coordinates partPosition)
 {
     texture = bodyTexture;
     position = new Coordinates(partPosition);
     previousPosition = new Coordinates(partPosition);
     targetPosition = new Coordinates(partPosition);
     parentPosition = new Coordinates(partPosition);
 }