public int GetIndex(int x, int y) { return y * width + x; }
private void CheckForGameOver() { if (snakeX < 1 || snakeX >= fupixel.width - 1 || snakeY < 1 || snakeY >= fupixel.height - 1 || fupixel.pixels[fupixel.GetIndex(snakeX, snakeY)] == snakeColor) { Application.LoadLevel(0); } }