public void UpdateScore(GameState state) { var distanceToFood = Vector2D.CalcDistance(state.FoodPosition, state.HeadPosition); var scoreForDistance = distanceToFood > _prevDistanceToFood ? _scoreForWrongWay : _scoreForCorrectWay; TotalScore += scoreForDistance; _prevDistanceToFood = distanceToFood; }