Ejemplo n.º 1
0
 // permite pasar de nivel
 private void PasarDeNivel()
 {
     this.nivelActual = this.niveles[nivelActual.Numero];
     this.dibujables = new List<IDibujable>();
     this.actuables = new List<IActuable>();
     this.nivelActual.Cargar();
     this.estado = EstadoDelJuego.jugando;
 }
Ejemplo n.º 2
0
        public void CargarJuego()
        {
            XmlSerializer formatter = new XmlSerializer(nivelActual.GetType());
            Nivel nivelGuardado = (Nivel)formatter.Deserialize(File.OpenRead("juego.xml"));

            dibujables = new List<IDibujable>();
            actuables = new List<IActuable>();
            List<Entidad> nuevaLista = new List<Entidad>();
            nuevaLista.Add(nivelGuardado.Tablero.Entidades[0]);
            for (int i = 1; i < nivelGuardado.Tablero.Entidades.Count/2; i++)
            {
                nuevaLista.Add(nivelGuardado.Tablero.Entidades[i]);
            }

            this.nivelActual = nivelGuardado;
            listaEntidades = nuevaLista;
            nivelActual.CargarseGuardado(nivelGuardado.Bombita.PosicionActual, nivelGuardado.Tablero.ObstaculoQueOcultaSalida, listaEntidades);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            this.niveles = new List<Nivel>();
            this.CargarNiveles();
            this.nivelActual = niveles[0];
            this.nivelActual.Cargar();
            // TODO: use this.Content to load your game content here
        }