eating
This commit is contained in:
@@ -15,5 +15,22 @@ namespace Snake
|
||||
Body.Add(startCell);
|
||||
}
|
||||
|
||||
public void Move(int x, int y, Map map)
|
||||
{
|
||||
Cell swapCell = map.Cells[x, y];
|
||||
|
||||
for (int i = 1; i < Body.Count; i++)
|
||||
{
|
||||
map.SwapCells(swapCell, Body[i]);
|
||||
swapCell = Body[i];
|
||||
}
|
||||
}
|
||||
|
||||
public void Eat(ref Cell cell)
|
||||
{
|
||||
cell.Type = CellTypes.Snake;
|
||||
Body.Add(cell);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user