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); }
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()); }
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); }