private static void DrawPeaoConfig(Peao p, int posX, int posY, int Larg, int Alt, SpriteBatch sp, Texture2D img) { Rectangle rect = new Rectangle(posX, posY, Larg, Alt); Color corCasa = Color.White; if (p.Cor == Peao.CorPeao.Vermelha) { corCasa = Color.Red; } else if (p.Cor == Peao.CorPeao.Azul) { corCasa = Color.Blue; } else if (p.Cor == Peao.CorPeao.Verde) { corCasa = Color.Green; } else if (p.Cor == Peao.CorPeao.Amarela) { corCasa = Color.Yellow; } else if (p.Cor == Peao.CorPeao.Branca) { corCasa = Color.White; } sp.Draw(img, rect, corCasa); }
public static void DrawPeaoMenu(Peao p, SpriteBatch sp, Texture2D img, int posX, int posY) { int Alt = 30; int Larg = 30; DrawPeaoConfig(p, posX, posY, Larg, Alt, sp, img); }
public static void DrawPeao(Peao p, SpriteBatch sp, Texture2D img) { int Alt = 50; int Larg = 50; int deslocX = 50 + 50; int deslocY = 50 + 50; int posX = deslocX + p.X * (Larg + 31); int posY = deslocY + p.Y * (Alt + 30); DrawPeaoConfig(p, posX, posY, Larg, Alt, sp, img); }
public override int Jogar(Peao peao, Dado dado, Tabuleiro tab) { int resultadoDado = dado.Rodar(); int contador = resultadoDado; Mover(peao, tab); while (resultadoDado != 0) { Mover(peao, tab); resultadoDado--; } return(contador); }
public override int JogarPrisao(Peao peao, Dado dado, Tabuleiro tab) { Sentido = Direcao.Leste; int resultadoDado = dado.Rodar(); int contador = resultadoDado; if (contador == 5) { Mover(peao, tab); while (resultadoDado != 0) { Mover(peao, tab); resultadoDado--; } } return(contador); }
public static void DrawPeaoPreso(Peao p, SpriteBatch sp, Texture2D img, Texture2D imgCela) { int Alt = 50; int Larg = 50; int deslocX = 23 + 50; int deslocY = 22 + 50; int posX = deslocX + p.X * (Larg + 31); int posY = deslocY + p.Y * (Alt + 30); DrawPeaoConfig(p, posX, posY, Larg, Alt, sp, img); Larg = 55; deslocX = 15 + 50; deslocY = 15 + 50; posX = deslocX + p.X * (Larg + 31); posY = deslocY + p.Y * (Alt + 30); Rectangle rectCela = new Rectangle(posX, posY, Larg + 10, Alt + 10); sp.Draw(imgCela, rectCela, Color.White); }
public override void Mover(Peao peao, Tabuleiro tab) { if (Sentido == Direcao.Norte) { if (peao.Y == 1 && peao.X == 0) { Sentido = Direcao.Leste; } peao.Y -= 1; } else if (Sentido == Direcao.Leste) { if (peao.Y == 0 && peao.X == tab.Colunas - 2) { Sentido = Direcao.Sul; } peao.X += 1; } else if (Sentido == Direcao.Sul) { if (peao.Y == tab.Linhas - 2 && peao.X == tab.Colunas - 1) { Sentido = Direcao.Oeste; } peao.Y += 1; } else if (Sentido == Direcao.Oeste) { if (peao.Y == tab.Linhas - 1 && peao.X == 1) { Sentido = Direcao.Norte; } peao.X -= 1; } }
public override int JogarPrisao(Peao peao, Dado dado, Tabuleiro tab) { return(playControl.JogarPrisao(peao, dado, tab)); }
public override void Mover(Peao peao, Tabuleiro tab) { playControl.Mover(peao, tab); }
public override int JogarPrisao(Peao peao, Dado dado, Tabuleiro tab) { throw new NotImplementedException(); }
public abstract int JogarPrisao(Peao peao, Dado dado, Tabuleiro tab);
public abstract void Mover(Peao peao, Tabuleiro tab);