Example #1
0
 public SPGameController(MultiplayerTetris.TetrisSinglePlayer tsp, int level, GoalController goalController)
 {
     totalTicks          = 0;
     this.level          = level;
     this.tsp            = tsp;
     this.goalController = goalController;
     this.canvas         = (Canvas)tsp.FindName("canvasBoard");
     this.canvas2        = (Canvas)tsp.FindName("nextPieceCanvas");
     this.board          = new Board(rows, cols);
     nextP = new Piece(ran.Next(0, 7), -1, 4);
     this.newPiece();
     this.updateGoals();
     this.draw();
     this.drawNext();
     this.linesUpdate(0);
 }
 public SPGameController(MultiplayerTetris.TetrisSinglePlayer tsp, int level, GoalController goalController)
 {
     totalTicks = 0;
     this.level = level;
     this.tsp = tsp;
     this.goalController = goalController;
     this.canvas = (Canvas)tsp.FindName("canvasBoard");
     this.canvas2 = (Canvas)tsp.FindName("nextPieceCanvas");
     this.board = new Board(rows, cols);
     nextP = new Piece(ran.Next(0, 7), -1, 4);
     this.newPiece();
     this.updateGoals();
     this.draw();
     this.drawNext();
     this.linesUpdate(0);
 }
 private void pageRoot_Loaded(object sender, RoutedEventArgs e)
 {
     TextBlock[] aux =
     {
         GoalText1,
         GoalText2,
         GoalText3,
         GoalText4,
     };
     goalController = new Tetris.GoalController(aux);
     sw             = new Stopwatch();
     levelText.Text = "Level  : " + levelSlider.Value.ToString();
     drop.Focus(Windows.UI.Xaml.FocusState.Programmatic);
     timer          = new DispatcherTimer();
     timer.Interval = TimeSpan.FromMilliseconds(this.timerIntervals);
     timer.Tick    += timer_Tick;
     Window.Current.Content.AddHandler(UIElement.KeyDownEvent, new KeyEventHandler(keyDownHandler), true);
     if (state == 0)
     {
         this.end();
     }
 }
 private void pageRoot_Loaded(object sender, RoutedEventArgs e)
 {
     TextBlock[] aux =   {
                             GoalText1,
                             GoalText2,
                             GoalText3,
                             GoalText4,
                         };
     goalController = new Tetris.GoalController(aux);
     sw = new Stopwatch();
     levelText.Text = "Level  : " + levelSlider.Value.ToString();
     drop.Focus(Windows.UI.Xaml.FocusState.Programmatic);
     timer = new DispatcherTimer();
     timer.Interval = TimeSpan.FromMilliseconds(this.timerIntervals);
     timer.Tick += timer_Tick;
     Window.Current.Content.AddHandler(UIElement.KeyDownEvent, new KeyEventHandler(keyDownHandler), true);
     if (state == 0)
         this.end();
 }