Exemplo n.º 1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            TetrisType type = (TetrisType)int.Parse((sender as Button).Tag.ToString());
            TetrisDesk t    = new TetrisDesk(type);

            t.ShowDialog();
        }
Exemplo n.º 2
0
        public Tetromino GetTetromino()
        {
            random = new Random();
            int num = tetro_list.Count;

            this.pTetris_type = (TetrisType)(random.Next(num));
            this.coordinates  = tetro_list[this.pTetris_type];
            return(this);
        }
Exemplo n.º 3
0
 public TetrisDesk(TetrisType type)
 {
     InitializeComponent();
     this.type = type;
     style     = FindResource("TetrisLabelStyle") as Style;
     StartGame();
     this.KeyUp     += new KeyEventHandler(TetrisDesk_KeyUp);
     this.KeyDown   += new KeyEventHandler(TetrisDesk_KeyDown);
     this.LostFocus += new RoutedEventHandler(TetrisDesk_LostFocus);
 }