public void GameLose() { Head = null; Food = null; var inSecond = 1000f / SleepTime; LoseTimer = (int)(inSecond * 3); }
public void GameWin() { Head = null; Food = null; var inSecond = 1000f / SleepTime; WinTimer = (int)(inSecond * 3); }
public void Grow() { if (Child != null) { Child.Grow(); return; } var piece = new SnakePiece(PreviousX, PreviousY); piece.SetParent(this); }
public void Initialize() { LoseTimer = 0; WinTimer = 0; Length = 1; WinThreshold = 30; Head = new SnakePiece(0, 0); CurrentDirection = Direction.RIGHT; LastDirection = Direction.RIGHT; Random = new Random(); SpawnFood(); }
public void SetChild(SnakePiece child) { Child = child; }
public void SetParent(SnakePiece parent) { Parent = parent; parent.SetChild(this); }