public RodadaInimigo(Nivel nivel, int rodada) { this.nivel = nivel; this.rodada = rodada; }
private void Click_SelecionaNivel(object sender, EventArgs e) { nivelSelecionado = (Nivel)nivelGrid.ItemSelecionado; ativo = false; SelecionaNivel(this, new EventArgs()); }
partial void CarregaNiveis(ContentManager Content) { #region nivelFacil Nivel nivelFacil = new Nivel(); nivelFacil.Nome = "Fácil"; nivelFacil.PNivel = 1; int[,] camada1 = new int[,] { { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,}, { 3, 3, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3,}, { 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, }; int[,] camada2 = new int[,] { { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,}, { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,}, { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,}, { 2, 2, 18, 2, 2, 2, 2, 2, 2, 2, 2, 2,}, { 2, 2, 21, 2, 22, 19, 19, 19, 19, 23, 2, 2,}, { 2, 2, 24, 19, 25, 2, 2, 2, 2, 21, 2, 2,}, { 2, 2, 2, 2, 2, 2, 2, 2, 2, 21, 2, 11,}, { 2, 2, 2, 2, 2, 2, 2, 2, 2, 21, 2, 14,}, { 2, 2, 2, 2, 2, 2, 2, 2, 2, 21, 2, 2,}, { 2, 2, 2, 2, 2, 2, 2, 2, 2, 21, 2, 2,}, { 2, 2, 26, 19, 19, 19, 19, 19, 19, 25, 2, 2,}, { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,}, { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,}, { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,}, }; int[,] camada3 = new int[,] { { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,}, { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,}, { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,}, { 2, 34, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,}, { 2, 2, 2, 2, 2, 35, 2, 2, 2, 2, 2, 2,}, { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,}, { 2, 30, 32, 17, 20, 2, 2, 32, 2, 35, 2, 2,}, { 2, 33, 31, 32, 2, 2, 2, 2, 2, 2, 2, 2,}, { 9, 10, 2, 2, 2, 2, 2, 20, 17, 2, 2, 2,}, { 12, 13, 2, 36, 37, 2, 2, 30, 2, 2, 2, 2,}, { 15, 16, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,}, { 2, 2, 2, 2, 2, 2, 2, 2, 2, 30, 2, 2,}, { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,}, { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,}, }; nivelFacil.AddCamada(camada1); nivelFacil.AddCamada(camada2); nivelFacil.AddCamada(camada3); nivelFacil.MapaUnidades = new int[,] { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,}, { 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1,}, { 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1,}, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0,}, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0,}, { 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1,}, { 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,}, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, }; Queue<Vector2> pontoCaminho = new Queue<Vector2>(); pontoCaminho.Enqueue(new Vector2(2, 3) * 32); pontoCaminho.Enqueue(new Vector2(2, 5) * 32); pontoCaminho.Enqueue(new Vector2(4, 5) * 32); pontoCaminho.Enqueue(new Vector2(4, 4) * 32); pontoCaminho.Enqueue(new Vector2(9, 4) * 32); pontoCaminho.Enqueue(new Vector2(9, 10) * 32); pontoCaminho.Enqueue(new Vector2(2, 10) * 32); nivelFacil.PontosCaminho.Add(pontoCaminho); nivelFacil.Textura = Textura.GetTextura("texturaMapa"); this.niveis.Add(nivelFacil); #endregion nivelFacil #region nivelMedio Nivel nivelMedio = new Nivel(); nivelMedio.Nome = "Médio"; nivelMedio.PNivel = 2; camada1 = new int[,] { { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,}, { 3, 3, 3, 3, 3, 4, 4, 3, 3, 3, 3, 3,}, { 6, 6, 6, 6, 6, 7, 7, 6, 6, 6, 6, 6,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0, 0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, { 32, 29, 2, 2, 2, 2, 2, 2, 2, 17, 17, 2,}, { 28, 29, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,}, { 2, 31, 2, 2, 2, 2, 29, 28, 2, 38, 29, 2,}, { 2, 27, 2, 2, 2, 29, 2, 28, 2, 2, 28, 2,}, { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 11,}, { 17, 2, 35, 35, 2, 9, 10, 2, 2, 2, 2, 14,}, { 20, 35, 2, 38, 2, 12, 13, 2, 2, 2, 2, 2,}, { 2, 2, 2, 2, 2, 15, 16, 2, 2, 2, 2, 32,}, { 2, 36, 37, 2, 2, 2, 2, 2, 2, 2, 32, 33,}, { 2, 02, 02, 2, 2, 2, 2, 2, 2, 2, 32, 33,} }; nivelMedio.AddCamada(camada1); nivelMedio.AddCamada(camada2); nivelMedio.AddCamada(camada3); nivelMedio.MapaUnidades = new int[,] { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1,}, { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,}, { 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1,}, { 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1,}, { 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0,}, { 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0,}, { 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1,}, { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,}, { 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, }; pontoCaminho = new Queue<Vector2>(); pontoCaminho.Enqueue(new Vector2(5, 3) * 32); pontoCaminho.Enqueue(new Vector2(5, 4) * 32); pontoCaminho.Enqueue(new Vector2(2, 4) * 32); pontoCaminho.Enqueue(new Vector2(2, 10) * 32); pontoCaminho.Enqueue(new Vector2(4, 10) * 32); nivelMedio.PontosCaminho.Add(pontoCaminho); pontoCaminho = new Queue<Vector2>(); pontoCaminho.Enqueue(new Vector2(6, 3) * 32); pontoCaminho.Enqueue(new Vector2(6, 4) * 32); pontoCaminho.Enqueue(new Vector2(9, 4) * 32); pontoCaminho.Enqueue(new Vector2(9, 10) * 32); pontoCaminho.Enqueue(new Vector2(7, 10) * 32); nivelMedio.PontosCaminho.Add(pontoCaminho); nivelMedio.Textura = Textura.GetTextura("texturaMapa"); this.niveis.Add(nivelMedio); #endregion nivelMedio #region nivelDificil Nivel nivelDificil = new Nivel(); nivelDificil.Nome = "Difícil"; nivelDificil.PNivel = 3; camada1 = new int[,] { { 03, 03, 03, 03, 03, 03, 03, 03, 03, 03, 03, 03,}, { 03, 03, 03, 03, 03, 04, 04, 03, 03, 03, 03, 03,}, { 06, 06, 06, 06, 06, 07, 07, 06, 06, 06, 06, 06,}, { 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00,}, { 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00,}, { 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00,}, { 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00,}, { 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00,}, { 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00,}, { 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00,}, { 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00,}, { 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00,}, { 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00,}, { 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00,}, }; camada2 = new int[,] { { 02, 02, 02, 02, 02, 02, 02, 02, 02, 02, 02, 02,}, { 02, 02, 02, 02, 02, 02, 02, 02, 02, 02, 02, 02,}, { 02, 02, 02, 02, 02, 02, 02, 02, 02, 02, 02, 02,}, { 02, 02, 02, 02, 02, 18, 18, 02, 02, 02, 02, 02,}, { 02, 02, 02, 22, 19, 25, 24, 19, 19, 23, 02, 02,}, { 02, 02, 02, 21, 02, 02, 02, 02, 02, 21, 02, 02,}, { 02, 02, 02, 21, 02, 02, 02, 02, 02, 21, 02, 02,}, { 02, 02, 02, 24, 19, 23, 02, 02, 02, 21, 02, 02,}, { 02, 02, 02, 02, 02, 21, 02, 02, 02, 21, 02, 02,}, { 02, 02, 02, 02, 02, 24, 02, 02, 02, 21, 02, 38,}, { 02, 02, 02, 02, 02, 02, 02, 26, 19, 25, 38, 38,}, { 02, 02, 02, 02, 02, 02, 02, 02, 02, 02, 02, 02,}, { 02, 02, 02, 02, 02, 02, 02, 02, 02, 02, 02, 02,}, { 02, 02, 02, 02, 02, 02, 02, 02, 02, 02, 02, 02,}, }; camada3 = new int[,] { { 02, 02, 02, 02, 02, 02, 02, 02, 02, 02, 02, 02,}, { 02, 02, 02, 02, 02, 02, 02, 02, 02, 02, 02, 02,}, { 02, 02, 02, 02, 02, 02, 02, 02, 02, 02, 02, 02,}, { 02, 02, 02, 02, 02, 02, 02, 35, 35, 02, 02, 02,}, { 02, 28, 29, 02, 02, 02, 02, 38, 02, 02, 02, 02,}, { 02, 33, 29, 02, 02, 17, 20, 02, 02, 02, 35, 38,}, { 02, 02, 32, 02, 02, 02, 02, 02, 02, 02, 20, 17,}, { 02, 02, 02, 02, 02, 02, 02, 02, 02, 02, 02, 20,}, { 30, 31, 28, 02, 02, 09, 10, 02, 02, 02, 02, 27,}, { 31, 29, 02, 02, 02, 12, 13, 36, 37, 02, 02, 02,}, { 02, 02, 02, 02, 02, 15, 16, 02, 02, 02, 30, 33,}, { 02, 36, 37, 02, 02, 02, 02, 02, 02, 02, 33, 34,}, { 02, 02, 02, 02, 02, 02, 02, 02, 02, 02, 33, 34,}, }; nivelDificil.AddCamada(camada1); nivelDificil.AddCamada(camada2); nivelDificil.AddCamada(camada3); pontoCaminho = new Queue<Vector2>(); pontoCaminho.Enqueue(new Vector2(5, 3) * 32); pontoCaminho.Enqueue(new Vector2(5, 4) * 32); pontoCaminho.Enqueue(new Vector2(3, 4) * 32); pontoCaminho.Enqueue(new Vector2(3, 7) * 32); pontoCaminho.Enqueue(new Vector2(5, 7) * 32); pontoCaminho.Enqueue(new Vector2(5 * 32, 230)); nivelDificil.PontosCaminho.Add(pontoCaminho); pontoCaminho = new Queue<Vector2>(); pontoCaminho.Enqueue(new Vector2(6, 3) * 32); pontoCaminho.Enqueue(new Vector2(6, 4) * 32); pontoCaminho.Enqueue(new Vector2(9, 4) * 32); pontoCaminho.Enqueue(new Vector2(9, 10) * 32); pontoCaminho.Enqueue(new Vector2(7, 10) * 32); nivelDificil.PontosCaminho.Add(pontoCaminho); nivelDificil.MapaUnidades = new int[,] { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1,}, { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1,}, { 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1,}, { 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1,}, { 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1,}, { 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1,}, { 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1,}, { 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1,}, { 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, }; nivelDificil.Textura = Textura.GetTextura("texturaMapa"); this.niveis.Add(nivelDificil); #endregion nivelDificil }
public void ProximoNivel(Nivel nivelVitoria) { if (ultimoNivelVitoria.PNivel == 3) // nível máximo return; int proximonivel = nivelVitoria.PNivel + 1; if (proximonivel > ultimoNivelVitoria.PNivel) { XmlDocument doc = new XmlDocument(); doc.Load(Global.localXmlPerfil); XmlNode node; node = doc.SelectSingleNode(String.Format("/perfis/perfil[@nome='{0}']", this.Nome)); node.SelectSingleNode("./nivel").InnerText = proximonivel.ToString(); doc.Save(Global.localXmlPerfil); this.ultimoNivelVitoria = Nivel.GetNivel(proximonivel); } }