示例#1
0
 public void navega(String pag, String player)
 {
     switch (pag)
     {
     case "start":
         Page2 p2 = new Page2(/*jogoproperty*/);
         mainwindowproperty.frame.Navigate(p2);
         jogoproperty = new Jogo(player, p2, this);
         break;
     }
 }
示例#2
0
        public void navega(String pag)
        {
            switch (pag)
            {
            case "start":
                Page2 p2 = new Page2(/*jogoproperty*/);
                mainwindowproperty.frame.Navigate(p2);
                jogoproperty = new Jogo("teste", p2, this);
                break;

            case "fim":
                Page3 p3 = new Page3();
                mainwindowproperty.frame.Navigate(p3);
                break;
            }
        }
示例#3
0
        public Jogo(string nomejogador, Page2 p2, ViewModel vm)
        {
            _jogador     = nomejogador;
            pag2property = p2;
            vmproperty   = vm;

            //vmproperty.pag2property = new Page2();


            //binding das properties
            //vmproperty.mainwindowproperty = (MainWindow)Application.Current.MainWindow;
            //this.DataContext = mainwindowproperty.vmproperty;
            //mainwindowproperty = (MainWindow)Application.Current.MainWindow;



            //ticker da animação das cervejas (6s)
            //DispatcherTimer dispatcherTimer = new System.Windows.Threading.DispatcherTimer();
            dispatcherTimer.Tick    += DispatcherTimer_Tick;
            dispatcherTimer.Interval = new TimeSpan(0, 0, 6);
            dispatcherTimer.Start();


            //ticker para deteção da colisão (10ms)
            //DispatcherTimer gameTimer = new System.Windows.Threading.DispatcherTimer();
            gameTimer.Tick    += gameTimer_Tick;
            gameTimer.Interval = new TimeSpan(0, 0, 0, 0, 10);
            gameTimer.Start();



            //tempo de Jogo
            //DispatcherTimer tempodeJogo = new System.Windows.Threading.DispatcherTimer();
            tempodeJogo.Tick    += TempodeJogo_Tick;
            tempodeJogo.Interval = new TimeSpan(0, 0, 0, 10);
            tempodeJogo.Start();

            //pag2property.rino.Focus();
            pag2property.theGrid.Focus();
            //pag2property.theGrid.KeyDown += image_KeyDown;

            //pag2property.theGrid.KeyUp += image_KeyDown;
        }