Skip to content

Commit

Permalink
player2
Browse files Browse the repository at this point in the history
programando botoes do player2
  • Loading branch information
beritcarvalho committed Apr 12, 2021
1 parent 8b7bb43 commit c3d6dc8
Show file tree
Hide file tree
Showing 10 changed files with 62 additions and 1 deletion.
Binary file modified .vs/blackjack2.0/DesignTimeBuild/.dtbcache.v2
Binary file not shown.
Binary file modified .vs/blackjack2.0/v16/.suo
Binary file not shown.
2 changes: 2 additions & 0 deletions blackjack2.0/Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

61 changes: 60 additions & 1 deletion blackjack2.0/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,11 @@ public static int PedirCartas(PictureBox carta)

}


//variável global de pontuação player 1
int pontosP1 = 0;
private void btnPedirMaisP1_Click(object sender, EventArgs e)
{
{
//hablitando o botao manter
btnManterP1.Enabled = true;
btnManterP1.BackgroundImage = Properties.Resources.manter;
Expand Down Expand Up @@ -361,26 +362,51 @@ private void Resultado(int pontos, Button btnPedirMais, Button btnManter, Label

private void btnReiniciar_Click(object sender, EventArgs e)
{
//zerando label valor de carta atual
lblValorCartaP1.Text = "0";
lblValorCartaP2.Text = "0";

//virando as cartas
pibCartasP1.Image = Properties.Resources.cartavirada;
pibCartasP2.Image = Properties.Resources.cartavirada;

//desabilitando a visualizaçao label de pontos
lblResultadoP1.Visible = false;
lblResultadoP2.Visible = false;



//desabilitando o botao reiniciar
btnReiniciar.Enabled = false;
btnReiniciar.BackgroundImage = Properties.Resources.reiniciar_disable;



//desabilitando o botao manter
btnManterP1.Enabled = false;
btnManterP1.BackgroundImage = Properties.Resources.manter_disable;

btnManterP2.Enabled = false;
btnManterP2.BackgroundImage = Properties.Resources.manter_disable;



//zerando os pontos e motrando na tela
pontosP1 = 0;
lblPontosP1.Text = pontosP1.ToString();

pontosP2 = 0;
lblPontosP2.Text = pontosP2.ToString();



//habilitando btnPedirmais
btnPedirMaisP1.Enabled = true;
btnPedirMaisP1.BackgroundImage = Properties.Resources.pedir;

btnPedirMaisP2.Enabled = true;
btnPedirMaisP2.BackgroundImage = Properties.Resources.pedir;


}

Expand All @@ -394,6 +420,39 @@ private void btnManterP1_Click(object sender, EventArgs e)
btnManterP1.BackgroundImage = Properties.Resources.manter_disable;

}

int pontosP2 = 0;
private void btnPedirMaisP2_Click(object sender, EventArgs e)
{
//hablitando o botao manter
btnManterP2.Enabled = true;
btnManterP2.BackgroundImage = Properties.Resources.manter;

//habilitando o botao Reiniciar!
btnReiniciar.Enabled = true;
btnReiniciar.BackgroundImage = Properties.Resources.reiniciar;

//mostrando carta e atribuindo o valor da variavel cartaAtual
int cartaAtual = PedirCartas(pibCartasP2);
lblValorCartaP2.Text = cartaAtual.ToString();

//realizando o processo de pontos e mostrando na tela
pontosP2 += cartaAtual;
lblPontosP2.Text = pontosP2.ToString();

//executando a função Resultado
Resultado(pontosP2, btnPedirMaisP2, btnManterP2, lblResultadoP2);
}

private void btnManterP2_Click(object sender, EventArgs e)
{
btnPedirMaisP2.Enabled = false;
btnPedirMaisP2.BackgroundImage = Properties.Resources.pedir_disable;

//desabilitando o botao manter
btnManterP2.Enabled = false;
btnManterP2.BackgroundImage = Properties.Resources.manter_disable;
}
}

}
Binary file modified blackjack2.0/bin/Debug/netcoreapp3.1/blackjack2.0.dll
Binary file not shown.
Binary file modified blackjack2.0/bin/Debug/netcoreapp3.1/blackjack2.0.pdb
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified blackjack2.0/obj/Debug/netcoreapp3.1/blackjack2.0.dll
Binary file not shown.
Binary file modified blackjack2.0/obj/Debug/netcoreapp3.1/blackjack2.0.pdb
Binary file not shown.

0 comments on commit c3d6dc8

Please sign in to comment.