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++; } }
public SnakeHead(Texture headTexture, Coordinates headPosition) { texture = headTexture; position = new Coordinates(headPosition); previousPosition = new Coordinates(headPosition); targetPosition = new Coordinates(headPosition); }
public SnakeBodyPart(Texture bodyTexture, Coordinates partPosition) { texture = bodyTexture; position = new Coordinates(partPosition); previousPosition = new Coordinates(partPosition); targetPosition = new Coordinates(partPosition); parentPosition = new Coordinates(partPosition); }