示例#1
0
        private void Iniciar_Click(object sender, RoutedEventArgs e)
        {
            // NavInfoText.Text = "Vuelvo al juego";
            //Va al juego cuando esté completa la pagina

            VMWrapper mWrapper = new VMWrapper(currDron, currPaquete, 20, 3, 5, 0, 0);

            mWrapper.Dron.ImgPeso.Source    = currDron.ImgPeso.Source;
            mWrapper.Dron.ImgVel.Source     = currDron.ImgVel.Source;
            mWrapper.Dron.ImgBateria.Source = currDron.ImgBateria.Source;
            this.Frame.Navigate(typeof(HUD), mWrapper);
        }
示例#2
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            VMWrapper mWrapper = e.Parameter as VMWrapper;

            mWrapper_                 = mWrapper;
            mWrapper_.Time            = time_;
            mWrapper_.Objectives      = 0;
            mWrapper_.TotalObjectives = totalObjectivos;
            if (mWrapper != null)
            {
                //dronImagen.Source = mWrapper.Dron.Img.Source;
                paqueteSel.Source = mWrapper.Paquete.Img.Source;
            }

            VMDron VMItem = new VMDron(mWrapper.Dron);

            //  VMPaquete VMDest = new VMPaquete(mWrapper.Paquete);
            ListaDrones.Add(VMItem);
            paqueteSelec = mWrapper.Paquete;
            canvas.Children.Add(VMItem.CCImg);
            //canvas.Children.Add(VMDest.CCImg);
            canvas.Children.Last().SetValue(Canvas.LeftProperty, VMItem.X);
            canvas.Children.Last().SetValue(Canvas.TopProperty, VMItem.Y);
            // canvas.Children.Last().SetValue(Canvas.LeftProperty, VMDest.X -100);
            // canvas.Children.Last().SetValue(Canvas.TopProperty, VMDest.Y -100);

            if (ListaDestinos != null)
            {
                foreach (Paquete paquete in ModelPaquete.GetAllPaquetes())
                {
                    VMPaquete VMDestino = new VMPaquete(paquete);
                    ListaDestinos.Add(VMDestino);
                    VMDestino.CCImg.Visibility = Windows.UI.Xaml.Visibility.Visible;
                    canvas.Children.Add(VMDestino.CCImg);
                    canvas.Children.Last().SetValue(Canvas.LeftProperty, VMDestino.X - 25);
                    canvas.Children.Last().SetValue(Canvas.TopProperty, VMDestino.Y - 25);
                }
            }
            dispatcherTimer.Start();

            /*
             * ListaDrones.Add(mWrapper.Dron);
             * canvas.Children.Add(mWrapper.Dron.CCImg);
             * canvas.Children.Last().SetValue(Canvas.LeftProperty, mWrapper.Dron.X - 25);
             * canvas.Children.Last().SetValue(Canvas.TopProperty, mWrapper.Dron.Y - 25);
             */
            base.OnNavigatedFrom(e);
        }
示例#3
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            VMWrapper mWrapper = e.Parameter as VMWrapper;

            if (mWrapper != null)
            {
                PanelDronImage.Source        = mWrapper.Dron.Img.Source;
                InnerPanelDronName_text.Text = mWrapper.Dron.Nombre;
                WeightItem_0.Source          = mWrapper.Dron.ImgPeso.Source;
                BatteryItem_0.Source         = mWrapper.Dron.ImgBateria.Source;
                SpeedItem_0.Source           = mWrapper.Dron.ImgVel.Source;
                TimeStack_time.Text          = mWrapper.Time.ToString();
                ObjectiveItem.Text           = mWrapper.Objectives.ToString() + " / " + mWrapper.TotalObjectives.ToString();
                PackageItem.Source           = mWrapper.Paquete.Img.Source;
            }
            base.OnNavigatedTo(e);
            GameTimerSetup();
        }
示例#4
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            VMWrapper mWrapper = e.Parameter as VMWrapper;

            //leer records desde un archivo?
            if (mWrapper != null)
            {
                if (mWrapper.Objectives == mWrapper.TotalObjectives)
                {
                    NavInfoText.Text = "¡Has cumplido todos los objetivos!";
                }
                else
                {
                    NavInfoText.Text = "¡No lo has conseguido!";
                }
                NewPoints.Text = mWrapper.Time.ToString() + " segundos " + mWrapper.Objectives.ToString() + " / " + mWrapper.TotalObjectives.ToString();
            }
            base.OnNavigatedTo(e);
            GameTimerSetup();
        }