Exemplo n.º 1
0
        private void MovePipeToEnd(int pipeSetIndex, PipeSet pipeSet)
        {
            // When a pipe is determined to be reset,
            // get its next position by adding an offset to the position
            // of a pipe which index is before itself.
            var prevPipeSetIndex = pipeSetIndex - 1;

            if (prevPipeSetIndex < 0)
            {
                prevPipeSetIndex = pipeSetList.Count - 1;
            }

            var nextPosX = pipeSetList[prevPipeSetIndex].Entity.Transform.Position.X + GapBetweenPipe;

            pipeSet.ResetPipe(nextPosX);

            ++numberOfPipeMoved;
        }
Exemplo n.º 2
0
        private void MovePipeToEnd(int pipeSetIndex, PipeSet pipeSet)
        {
            // When a pipe is determined to be reset,
            // get its next position by adding an offset to the position
            // of a pipe which index is before itself.
            var prevPipeSetIndex = pipeSetIndex - 1;

            if (prevPipeSetIndex < 0)
                prevPipeSetIndex = pipeSetList.Count - 1;

            var nextPosX = pipeSetList[prevPipeSetIndex].Entity.Transform.Position.X + GapBetweenPipe;

            pipeSet.ResetPipe(nextPosX);

            ++numberOfPipeMoved;
        }