Ejemplo n.º 1
0
        /// <summary>
        /// Responsible for snake move.
        /// </summary>
        private void Move(Direction newRelativeToSnakeDir)
        {
            Vector2 headLastPos = _snakeParts.head.transform.position;

            Vector2 moveDir = MoveHead(newRelativeToSnakeDir, _snakeParts.head.transform);

            _curWorldMoveDir = SnakeDirectionDependencies.GetWorldDirection(moveDir);

            if (_feedEaten)
            {
                _feedEaten = false;
                return;
            }

            MoveTailParts(headLastPos);
        }