Пример #1
0
        public MainWindow()
        {
            InitializeComponent();
            string path = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "resources\\cursor.cur");

            customCursor             = new Cursor(path);
            counter                  = new Counter();
            Timer_counter.Content    = 0;
            Globals.firstGame        = true;
            Globals.cvDormido        = cvDormido;
            Globals.cvTriste         = cvTriste;
            Globals.cvCama           = cvCama;
            Globals.cvBunny          = cvBunny;
            Globals.cvPescando       = cvPescando;
            Globals.label_puntuacion = Label_Puntuacion;
            Globals.img_pause        = img_pause;
            Globals.img_music        = img_music;
            Globals.state            = 0;
            Globals.listCaca         = new List <Caca>();
            Globals.cvLago           = cvLago;
            Globals.cvFondo          = cvFondo;
            //nivel
            Globals.progressbar_nivel = ProgressBar_nivel;
            Globals.label_nivel       = Label_Nivel;
            //peces
            Globals.pezVerde    = pezVerde;
            Globals.pezAmarillo = pezAmarillo;
            Globals.pezLila     = pezLila;
            Globals.pezRojo     = pezRojo;
            Globals.pezAzul     = pezAzul;
            //progress bar
            Globals.ProgressBar_hambre    = ProgressBar_hambre;
            Globals.ProgressBar_baño      = ProgressBar_baño;
            Globals.ProgressBar_sueño     = ProgressBar_sueño;
            Globals.ProgressBar_diversion = ProgressBar_diversion;
            Globals.cacas       = 0;
            Globals.score       = 0;
            Globals.state_label = Label_State;
            Globals.cvPause     = cvPause;

            //Decoracion
            Globals.cvEstructuraCasa = cvEstructuraCasa;
            Globals.cvPuerta         = cvPuerta;
            Globals.cvVentana        = cvVentana;
            Globals.cvChimenea       = cvChimenea;
            Globals.cvCarretera      = cvCarretera;
            Globals.cvPajarillos     = cvPajarillos;
            Globals.cvGafasSol       = cvGafasSol;
            Globals.cvCampoFlores    = cvCampoFlores;
            Globals.cvCampoFlores2   = cvCampoFlores2;

            //Inicializar animaciones
            ani_respirar         = new Respirar(cuerpo);
            ani_parpadear        = new Parpadear(parpadoIzq, parpadoDer);
            ani_rascarbarriga    = new RascarBarrigaCanvas(cvBrazoIzquierdo, cvBrazoDerecho);
            ani_cansancio        = new Cansancio(this.FindResource("sbCansancio") as Storyboard);
            ani_hambre           = new Hambre(this.FindResource("sbHambre") as Storyboard);
            ani_dormir           = new Dormir(this.FindResource("sbDurmiendo") as Storyboard);
            ani_comiendo         = new Comiendo(this.FindResource("sbComiendo") as Storyboard);
            ani_triste           = new Triste(this.FindResource("sbTristeza") as Storyboard);
            Globals.juego_pescar = new Juego(this.FindResource("movimientoPeces") as Storyboard, Label_Puntuacion);
            //Barra de progreso
            progressbar_controler = new ProgressBarControler(                             //ProgressBars
                Label_hambre, Label_baño, Label_sueño, Label_Puntuacion, Label_diversion, //Labels
                ani_cansancio, ani_hambre, ani_dormir, ani_triste,                        //Animations
                cvBunny)                                                                  //Canvas
            ;
            Nivel nivel_controller = new Nivel();

            temporizador = new Temporizador(this);
            temporizador.registrarObservador(progressbar_controler);
            temporizador.registrarObservador(nivel_controller);
            new Pause();
            new ReadXml(progressbar_controler);
            s = new SoundsPlayer();
            d = new SoundsPlayer();
            s.ambientalSound();
            d.welcomeSound();
            //Leer XML
        }