This commit is contained in:
maxwes08
2026-01-30 12:14:01 +01:00
parent b6e5c3dfbc
commit df6832419f
4 changed files with 82 additions and 6 deletions

View File

@@ -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);
}
}
}