예제 #1
0
        private Shape getRandomShapeWithCenterAligned()
        {
            var shape = ShapesHandler.GetRandomShape();

            // Calculate the x and y values as if the shape lies in the center
            currentX = 7;
            currentY = -shape.Height;

            return(shape);
        }
예제 #2
0
 private void InitShapes()
 {
     ShapesHandler.AddTemplateShape(new ShapeI());
     ShapesHandler.AddTemplateShape(new ShapeO());
     ShapesHandler.AddTemplateShape(new ShapeJ());
     ShapesHandler.AddTemplateShape(new ShapeL());
     ShapesHandler.AddTemplateShape(new ShapeZ());
     ShapesHandler.AddTemplateShape(new ShapeS());
     ShapesHandler.AddTemplateShape(new ShapeDot());
     ShapesHandler.AddTemplateShape(new Shapeil());
     ShapesHandler.AddTemplateShape(new ShapeLl());
 }
예제 #3
0
파일: Game.cs 프로젝트: KingTimeoff/Tetris
        private Shape getRandomShapeCenter()
        {
            var shape = ShapesHandler.GetRandomShape();

            currentX = (int)Math.Floor((double)gridWidth / 2.0f);
            if (currentShape == null)
            {
                currentY = -shape.Height;
            }
            else
            {
                currentY = -currentShape.Height;
            }
            return(shape);
        }