コード例 #1
0
ファイル: Fall_Drow.cs プロジェクト: Yan-Fedorov/Racing
        private bool IsOverlaped(OopFigure figure, Collision collision)
        {
            int
                leftSide  = figure.X,
                rightSide = figure.figure.GetLength(0) + figure.X,
                upSide    = figure.Y,
                downSide  = figure.figure.GetLength(1) + figure.Y;

            return(leftSide <= collision.X && collision.X <= rightSide &&
                   upSide <= collision.Y && collision.Y <= downSide);
        }
コード例 #2
0
ファイル: Fall_Drow.cs プロジェクト: Yan-Fedorov/Racing
        public void Fall()
        {
            FallCount++;

            if (FallCount == 6)
            {
                figuresList.Add(OopFigure.buildFigure());
                FallCount = 0;
            }

            for (int i = 0; i < figuresList.Count; i++)
            {
                figuresList[i].Y++;
            }

            figuresList = figuresList
                          .Where(x => x.Y < 17)
                          .ToList();
        }