private List <Shape> LevelOne() { List <Shape> newShapes; newShapes = BuildDragDropShapePair <Ellipse>(); foreach (Shape sh in newShapes) { if (sh.IsTapEnabled == true) //shape, not drop { DragShapes.Add(sh); canvas.Children.Add(sh); Canvas.SetLeft(sh, _rnd.Next((GameWidth / 2) - (int)sh.Width)); //keeps it on the left half of the screen Canvas.SetTop(sh, _rnd.Next(GameHeight - (int)sh.Height)); CurrentShapeCount++; } else { DropShapes.Add(sh); canvas.Children.Add(sh); Canvas.SetLeft(sh, _rnd.Next(GameWidth / 2, GameWidth - (int)sh.Width)); //keeps it on the bottom half of the screen Canvas.SetTop(sh, _rnd.Next(GameHeight - (int)sh.Height)); } } return(newShapes); }
private List <Shape> LevelTwo() { List <Shape> newShapes; newShapes = BuildDragDropShapePair <Ellipse>(); foreach (Shape el in newShapes) { if (el.IsTapEnabled == true) //shape, not drop { DragShapes.Add(el); canvas.Children.Add(el); do { Canvas.SetLeft(el, _rnd.Next((GameWidth / 3) * 2, GameWidth - (int)el.Width)); //far right third of screen Canvas.SetTop(el, _rnd.Next(0, (GameHeight / 2) - (int)el.Height)); //keeps it on the bottom half of the screen } while (CheckForOverlaps(el)); CurrentShapeCount++; } else { DropShapes.Add(el); canvas.Children.Add(el); do { Canvas.SetLeft(el, _rnd.Next(0, (GameWidth / 3) - (int)el.Width)); //far left third of screen Canvas.SetTop(el, _rnd.Next(GameHeight / 2, GameHeight - (int)el.Height)); //keeps it on the top half of the screen } while (CheckForOverlaps(el)); } } newShapes.AddRange(LevelOne()); //another simple left/right ellipse pair return(newShapes); }
private List <Shape> LevelThree() { List <Shape> newShapes; newShapes = BuildDragDropShapePair <Rectangle>(); foreach (Rectangle polyShape in newShapes) { //polyShape.Points.Add(new Point(0, 100)); //bottomLeft); //polyShape.Points.Add(new Point(20, 100)); //bottomRight); //polyShape.Points.Add(new Point(30, 3)); //top); //polyShape.Height = 100; //polyShape.Width = 100; canvas.Children.Add(polyShape); Canvas.SetLeft(polyShape, _rnd.Next(0, GameWidth - (int)polyShape.Width)); Canvas.SetTop(polyShape, _rnd.Next(0, GameHeight - (int)polyShape.Height)); if (polyShape.IsTapEnabled == true) //shape, not drop { DragShapes.Add(polyShape); CurrentShapeCount++; } else { DropShapes.Add(polyShape); } } newShapes.AddRange(LevelOne()); newShapes.AddRange(LevelTwo()); //todo: tapping on shapes will grow/shrink its drop to help show the difference return(newShapes); }