//check if snake Eat Food and return true else return false public bool snakeEatFood(Vector2Int snakeGridPosition) { if (snakeGridPosition == foodGridPosition && bluefoodGameObject) { Object.Destroy(bluefoodGameObject); previousEaten = true; spawnFood(); GameHandler.AddScoreBlue(); blueCounter = blueCounter + 1; return(true); } else if (snakeGridPosition == foodGridPosition && redfoodGameObject) { Object.Destroy(redfoodGameObject); previousEaten = true; spawnFood(); GameHandler.AddScoreRed(); redCounter = blueCounter + 1; return(true); } else { return(false); } }