Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class Form1
- Dim card1 As Integer
- Dim card2 As Integer
- Dim p1Score As Integer = 26
- Dim p2Score As Integer = 26
- Dim pointVal1 As Integer
- Dim pointVal2 As Integer
- Dim WpointVal1 As Integer
- Dim WpointVal2 As Integer
- Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
- Randomize()
- p1Score = p1Score - 1
- p2Score = p2Score - 1
- card1 = (Rnd() * 52) + 1
- card2 = (Rnd() * 52) + 1
- Label1.Text = card1
- lblP1Val.Text = card2
- If card1 = 1 Then
- PictureBox1.BackgroundImage = My.Resources.aceclubs
- pointVal1 = 14
- ElseIf card1 = 2 Then
- PictureBox1.BackgroundImage = My.Resources._2clubs
- pointVal1 = 2
- ElseIf card1 = 3 Then
- PictureBox1.BackgroundImage = My.Resources._3clubs
- pointVal1 = 3
- ElseIf card1 = 4 Then
- PictureBox1.BackgroundImage = My.Resources._4clubs
- pointVal1 = 4
- ElseIf card1 = 5 Then
- PictureBox1.BackgroundImage = My.Resources._5clubs
- pointVal1 = 5
- ElseIf card1 = 6 Then
- PictureBox1.BackgroundImage = My.Resources._6clubs
- pointVal1 = 6
- ElseIf card1 = 7 Then
- PictureBox1.BackgroundImage = My.Resources._7clubs
- pointVal1 = 7
- ElseIf card1 = 8 Then
- PictureBox1.BackgroundImage = My.Resources._8clubs
- pointVal1 = 8
- ElseIf card1 = 9 Then
- PictureBox1.BackgroundImage = My.Resources._9clubs
- pointVal1 = 9
- ElseIf card1 = 10 Then
- PictureBox1.BackgroundImage = My.Resources._10clubs
- pointVal1 = 10
- ElseIf card1 = 11 Then
- PictureBox1.BackgroundImage = My.Resources.jackclubs
- pointVal1 = 11
- ElseIf card1 = 12 Then
- PictureBox1.BackgroundImage = My.Resources.queenclubs
- pointVal1 = 12
- ElseIf card1 = 13 Then
- PictureBox1.BackgroundImage = My.Resources.kingclubs
- pointVal1 = 13
- ElseIf card1 = 14 Then
- PictureBox1.BackgroundImage = My.Resources.acediamonds
- pointVal1 = 14
- ElseIf card1 = 15 Then
- PictureBox1.BackgroundImage = My.Resources._2diamonds
- pointVal1 = 2
- ElseIf card1 = 16 Then
- PictureBox1.BackgroundImage = My.Resources._3diamonds
- pointVal1 = 3
- ElseIf card1 = 17 Then
- PictureBox1.BackgroundImage = My.Resources._4diamonds
- pointVal1 = 1
- ElseIf card1 = 18 Then
- PictureBox1.BackgroundImage = My.Resources._5diamonds
- pointVal1 = 5
- ElseIf card1 = 18 Then
- PictureBox1.BackgroundImage = My.Resources._6diamonds
- pointVal1 = 6
- ElseIf card1 = 20 Then
- PictureBox1.BackgroundImage = My.Resources._7diamonds
- pointVal1 = 7
- ElseIf card1 = 21 Then
- PictureBox1.BackgroundImage = My.Resources._8diamonds
- pointVal1 = 8
- ElseIf card1 = 22 Then
- PictureBox1.BackgroundImage = My.Resources._9diamonds
- pointVal1 = 9
- ElseIf card1 = 23 Then
- PictureBox1.BackgroundImage = My.Resources._10diamonds
- pointVal1 = 10
- ElseIf card1 = 24 Then
- PictureBox1.BackgroundImage = My.Resources.jackdiamonds
- pointVal1 = 11
- ElseIf card1 = 25 Then
- PictureBox1.BackgroundImage = My.Resources.queendiamonds
- pointVal1 = 12
- ElseIf card1 = 26 Then
- PictureBox1.BackgroundImage = My.Resources.kingdiamonds
- pointVal1 = 13
- ElseIf card1 = 27 Then
- PictureBox1.BackgroundImage = My.Resources.acehearts
- pointVal1 = 14
- ElseIf card1 = 28 Then
- PictureBox1.BackgroundImage = My.Resources._2hearts
- pointVal1 = 2
- ElseIf card1 = 29 Then
- PictureBox1.BackgroundImage = My.Resources._3hearts
- pointVal1 = 3
- ElseIf card1 = 30 Then
- PictureBox1.BackgroundImage = My.Resources._4hearts
- pointVal1 = 4
- ElseIf card1 = 31 Then
- PictureBox1.BackgroundImage = My.Resources._5hearts
- pointVal1 = 5
- ElseIf card1 = 32 Then
- PictureBox1.BackgroundImage = My.Resources._6hearts
- pointVal1 = 6
- ElseIf card1 = 33 Then
- PictureBox1.BackgroundImage = My.Resources._7hearts
- pointVal1 = 7
- ElseIf card1 = 34 Then
- PictureBox1.BackgroundImage = My.Resources._8hearts
- pointVal1 = 8
- ElseIf card1 = 35 Then
- PictureBox1.BackgroundImage = My.Resources._9hearts
- pointVal1 = 9
- ElseIf card1 = 36 Then
- PictureBox1.BackgroundImage = My.Resources._10hearts
- pointVal1 = 10
- ElseIf card1 = 37 Then
- PictureBox1.BackgroundImage = My.Resources.jackhearts
- pointVal1 = 11
- ElseIf card1 = 38 Then
- PictureBox1.BackgroundImage = My.Resources.queenhearts
- pointVal1 = 12
- ElseIf card1 = 39 Then
- PictureBox1.BackgroundImage = My.Resources.kinghearts
- pointVal1 = 13
- ElseIf card1 = 40 Then
- PictureBox1.BackgroundImage = My.Resources.acespades
- pointVal1 = 14
- ElseIf card1 = 41 Then
- PictureBox1.BackgroundImage = My.Resources._2spades
- pointVal1 = 2
- ElseIf card1 = 42 Then
- PictureBox1.BackgroundImage = My.Resources._3spades
- pointVal1 = 3
- ElseIf card1 = 43 Then
- PictureBox1.BackgroundImage = My.Resources._4spades
- pointVal1 = 4
- ElseIf card1 = 44 Then
- PictureBox1.BackgroundImage = My.Resources._5spades
- pointVal1 = 5
- ElseIf card1 = 45 Then
- PictureBox1.BackgroundImage = My.Resources._6spades
- pointVal1 = 6
- ElseIf card1 = 46 Then
- PictureBox1.BackgroundImage = My.Resources._7spades
- pointVal1 = 7
- ElseIf card1 = 47 Then
- PictureBox1.BackgroundImage = My.Resources._8spades
- pointVal1 = 8
- ElseIf card1 = 48 Then
- PictureBox1.BackgroundImage = My.Resources._9spades
- pointVal1 = 9
- ElseIf card1 = 49 Then
- PictureBox1.BackgroundImage = My.Resources._10spades
- pointVal1 = 10
- ElseIf card1 = 50 Then
- PictureBox1.BackgroundImage = My.Resources.jackspades
- pointVal1 = 11
- ElseIf card1 = 51 Then
- PictureBox1.BackgroundImage = My.Resources.queenspades
- pointVal1 = 12
- ElseIf card1 = 52 Then
- PictureBox1.BackgroundImage = My.Resources.kingspades
- pointVal1 = 13
- ' this is continued for 52 cards --> for player 1 and then recreated for player 2...
- End If
- If card2 = 1 Then
- PictureBox2.BackgroundImage = My.Resources.aceclubs
- pointVal2 = 14
- ElseIf card2 = 2 Then
- PictureBox2.BackgroundImage = My.Resources._2clubs
- pointVal2 = 2
- ElseIf card2 = 3 Then
- PictureBox2.BackgroundImage = My.Resources._3clubs
- pointVal2 = 3
- ElseIf card2 = 4 Then
- PictureBox2.BackgroundImage = My.Resources._4clubs
- pointVal2 = 4
- ElseIf card2 = 5 Then
- PictureBox2.BackgroundImage = My.Resources._5clubs
- pointVal2 = 5
- ElseIf card2 = 6 Then
- PictureBox2.BackgroundImage = My.Resources._6clubs
- pointVal2 = 6
- ElseIf card2 = 7 Then
- PictureBox2.BackgroundImage = My.Resources._7clubs
- pointVal2 = 7
- ElseIf card2 = 8 Then
- PictureBox2.BackgroundImage = My.Resources._8clubs
- pointVal2 = 8
- ElseIf card2 = 9 Then
- PictureBox2.BackgroundImage = My.Resources._9clubs
- pointVal2 = 9
- ElseIf card2 = 10 Then
- PictureBox2.BackgroundImage = My.Resources._10clubs
- pointVal2 = 10
- ElseIf card2 = 11 Then
- PictureBox2.BackgroundImage = My.Resources.jackclubs
- pointVal2 = 11
- ElseIf card2 = 12 Then
- PictureBox2.BackgroundImage = My.Resources.queenclubs
- pointVal2 = 12
- ElseIf card2 = 13 Then
- PictureBox2.BackgroundImage = My.Resources.kingclubs
- pointVal2 = 13
- ElseIf card2 = 14 Then
- PictureBox2.BackgroundImage = My.Resources.acediamonds
- pointVal2 = 14
- ElseIf card2 = 15 Then
- PictureBox2.BackgroundImage = My.Resources._2diamonds
- pointVal2 = 2
- ElseIf card2 = 16 Then
- PictureBox2.BackgroundImage = My.Resources._3diamonds
- pointVal2 = 3
- ElseIf card2 = 17 Then
- PictureBox2.BackgroundImage = My.Resources._4diamonds
- pointVal2 = 1
- ElseIf card2 = 18 Then
- PictureBox2.BackgroundImage = My.Resources._5diamonds
- pointVal2 = 5
- ElseIf card2 = 18 Then
- PictureBox2.BackgroundImage = My.Resources._6diamonds
- pointVal2 = 6
- ElseIf card2 = 20 Then
- PictureBox2.BackgroundImage = My.Resources._7diamonds
- pointVal2 = 7
- ElseIf card2 = 21 Then
- PictureBox2.BackgroundImage = My.Resources._8diamonds
- pointVal2 = 8
- ElseIf card2 = 22 Then
- PictureBox2.BackgroundImage = My.Resources._9diamonds
- pointVal2 = 9
- ElseIf card2 = 23 Then
- PictureBox2.BackgroundImage = My.Resources._10diamonds
- pointVal2 = 10
- ElseIf card2 = 24 Then
- PictureBox2.BackgroundImage = My.Resources.jackdiamonds
- pointVal2 = 11
- ElseIf card2 = 25 Then
- PictureBox2.BackgroundImage = My.Resources.queendiamonds
- pointVal2 = 12
- ElseIf card2 = 26 Then
- PictureBox2.BackgroundImage = My.Resources.kingdiamonds
- pointVal2 = 13
- ElseIf card2 = 27 Then
- PictureBox2.BackgroundImage = My.Resources.acehearts
- pointVal2 = 14
- ElseIf card2 = 28 Then
- PictureBox2.BackgroundImage = My.Resources._2hearts
- pointVal2 = 2
- ElseIf card2 = 29 Then
- PictureBox2.BackgroundImage = My.Resources._3hearts
- pointVal2 = 3
- ElseIf card2 = 30 Then
- PictureBox2.BackgroundImage = My.Resources._4hearts
- pointVal2 = 4
- ElseIf card2 = 31 Then
- PictureBox2.BackgroundImage = My.Resources._5hearts
- pointVal2 = 5
- ElseIf card2 = 32 Then
- PictureBox2.BackgroundImage = My.Resources._6hearts
- pointVal2 = 6
- ElseIf card2 = 33 Then
- PictureBox2.BackgroundImage = My.Resources._7hearts
- pointVal2 = 7
- ElseIf card2 = 34 Then
- PictureBox2.BackgroundImage = My.Resources._8hearts
- pointVal2 = 8
- ElseIf card2 = 35 Then
- PictureBox2.BackgroundImage = My.Resources._9hearts
- pointVal2 = 9
- ElseIf card2 = 36 Then
- PictureBox2.BackgroundImage = My.Resources._10hearts
- pointVal2 = 10
- ElseIf card2 = 37 Then
- PictureBox2.BackgroundImage = My.Resources.jackhearts
- pointVal2 = 11
- ElseIf card2 = 38 Then
- PictureBox2.BackgroundImage = My.Resources.queenhearts
- pointVal2 = 12
- ElseIf card2 = 39 Then
- PictureBox2.BackgroundImage = My.Resources.kinghearts
- pointVal2 = 13
- ElseIf card2 = 40 Then
- PictureBox2.BackgroundImage = My.Resources.acespades
- pointVal2 = 14
- ElseIf card2 = 41 Then
- PictureBox2.BackgroundImage = My.Resources._2spades
- pointVal2 = 2
- ElseIf card2 = 42 Then
- PictureBox2.BackgroundImage = My.Resources._3spades
- pointVal2 = 3
- ElseIf card2 = 43 Then
- PictureBox2.BackgroundImage = My.Resources._4spades
- pointVal2 = 4
- ElseIf card2 = 44 Then
- PictureBox2.BackgroundImage = My.Resources._5spades
- pointVal2 = 5
- ElseIf card2 = 45 Then
- PictureBox2.BackgroundImage = My.Resources._6spades
- pointVal2 = 6
- ElseIf card2 = 46 Then
- PictureBox2.BackgroundImage = My.Resources._7spades
- pointVal2 = 7
- ElseIf card2 = 47 Then
- PictureBox2.BackgroundImage = My.Resources._8spades
- pointVal2 = 8
- ElseIf card2 = 48 Then
- PictureBox2.BackgroundImage = My.Resources._9spades
- pointVal2 = 9
- ElseIf card2 = 49 Then
- PictureBox2.BackgroundImage = My.Resources._10spades
- pointVal2 = 10
- ElseIf card2 = 50 Then
- PictureBox2.BackgroundImage = My.Resources.jackspades
- pointVal2 = 11
- ElseIf card2 = 51 Then
- PictureBox2.BackgroundImage = My.Resources.queenspades
- pointVal2 = 12
- ElseIf card2 = 52 Then
- PictureBox2.BackgroundImage = My.Resources.kingspades
- pointVal2 = 13
- ' this is continued for 52 cards --> for player 1 and then recreated for player 2...
- End If
- If pointVal1 < pointVal2 Then
- p2Score = p2Score + 2
- End If
- If pointVal1 = pointVal2 Then
- Button1.Enabled = False
- btnWar.Visible = True
- btnWar.Enabled = True
- warcard1.Visible = True
- warcard2.Visible = True
- warcard3.Visible = True
- warcard4.Visible = True
- warcard5.Visible = True
- warcard6.Visible = True
- End If
- lblP1Val.Text = p1Score
- lblP2Val.Text = p2Score
- 'update score here too
- If p1Score >= 52 Then
- MessageBox.Show("Player 1 Wins!")
- Application.Restart()
- End If
- If p2Score >= 52 Then
- MessageBox.Show("Player 2 Wins!")
- Application.Restart()
- End If
- End Sub
- Private Sub btnWar_Click(sender As Object, e As EventArgs) Handles btnWar.Click
- 'this is where the war code goes... good luck muhahahhaahahah
- Dim w1 As Integer
- Dim w2 As Integer
- p1Score = p1Score - 4
- p2Score = p2Score - 4
- w1 = (Rnd() * 52) + 1
- w2 = (Rnd() * 52) + 1
- If w1 = 1 Then
- warval1.BackgroundImage = My.Resources.aceclubs
- WpointVal1 = 14
- ElseIf w1 = 2 Then
- warval1.BackgroundImage = My.Resources._2clubs
- WpointVal1 = 2
- ElseIf w1 = 3 Then
- warval1.BackgroundImage = My.Resources._3clubs
- WpointVal1 = 3
- ElseIf w1 = 4 Then
- warval1.BackgroundImage = My.Resources._4clubs
- WpointVal1 = 4
- ElseIf w1 = 5 Then
- warval1.BackgroundImage = My.Resources._5clubs
- WpointVal1 = 5
- ElseIf w1 = 6 Then
- warval1.BackgroundImage = My.Resources._6clubs
- WpointVal1 = 6
- ElseIf w1 = 7 Then
- warval1.BackgroundImage = My.Resources._7clubs
- WpointVal1 = 7
- ElseIf w1 = 8 Then
- warval1.BackgroundImage = My.Resources._8clubs
- WpointVal1 = 8
- ElseIf w1 = 9 Then
- warval1.BackgroundImage = My.Resources._9clubs
- WpointVal1 = 9
- ElseIf w1 = 10 Then
- warval1.BackgroundImage = My.Resources._10clubs
- WpointVal1 = 10
- ElseIf w1 = 11 Then
- warval1.BackgroundImage = My.Resources.jackclubs
- WpointVal1 = 11
- ElseIf w1 = 12 Then
- warval1.BackgroundImage = My.Resources.queenclubs
- WpointVal1 = 12
- ElseIf w1 = 13 Then
- warval1.BackgroundImage = My.Resources.kingclubs
- WpointVal1 = 13
- ElseIf w1 = 14 Then
- warval1.BackgroundImage = My.Resources.acediamonds
- WpointVal1 = 14
- ElseIf w1 = 15 Then
- warval1.BackgroundImage = My.Resources._2diamonds
- WpointVal1 = 12
- ElseIf w1 = 16 Then
- warval1.BackgroundImage = My.Resources._3diamonds
- WpointVal1 = 3
- ElseIf w1 = 17 Then
- warval1.BackgroundImage = My.Resources._4diamonds
- WpointVal1 = 4
- ElseIf w1 = 18 Then
- warval1.BackgroundImage = My.Resources._5diamonds
- WpointVal1 = 5
- ElseIf w1 = 19 Then
- warval1.BackgroundImage = My.Resources._6diamonds
- WpointVal1 = 6
- ElseIf w1 = 20 Then
- warval1.BackgroundImage = My.Resources._7diamonds
- WpointVal1 = 7
- ElseIf w1 = 21 Then
- warval1.BackgroundImage = My.Resources._8diamonds
- WpointVal1 = 8
- ElseIf w1 = 22 Then
- warval1.BackgroundImage = My.Resources._9diamonds
- WpointVal1 = 9
- ElseIf w1 = 23 Then
- warval1.BackgroundImage = My.Resources._10diamonds
- WpointVal1 = 10
- ElseIf w1 = 24 Then
- warval1.BackgroundImage = My.Resources.jackdiamonds
- WpointVal1 = 11
- ElseIf w1 = 25 Then
- warval1.BackgroundImage = My.Resources.queendiamonds
- WpointVal1 = 12
- ElseIf w1 = 26 Then
- warval1.BackgroundImage = My.Resources.kingdiamonds
- WpointVal1 = 13
- ElseIf w1 = 27 Then
- warval1.BackgroundImage = My.Resources.acehearts
- WpointVal1 = 14
- ElseIf w1 = 28 Then
- warval1.BackgroundImage = My.Resources._2hearts
- WpointVal1 = 2
- ElseIf w1 = 29 Then
- warval1.BackgroundImage = My.Resources._3hearts
- WpointVal1 = 3
- ElseIf w1 = 30 Then
- warval1.BackgroundImage = My.Resources._4hearts
- WpointVal1 = 4
- ElseIf w1 = 31 Then
- warval1.BackgroundImage = My.Resources._5hearts
- WpointVal1 = 5
- ElseIf w1 = 32 Then
- warval1.BackgroundImage = My.Resources._6hearts
- WpointVal1 = 6
- ElseIf w1 = 33 Then
- warval1.BackgroundImage = My.Resources._7hearts
- WpointVal1 = 7
- ElseIf w1 = 34 Then
- warval1.BackgroundImage = My.Resources._8hearts
- WpointVal1 = 8
- ElseIf w1 = 35 Then
- warval1.BackgroundImage = My.Resources._9hearts
- WpointVal1 = 9
- ElseIf w1 = 36 Then
- warval1.BackgroundImage = My.Resources._10hearts
- WpointVal1 = 10
- ElseIf w1 = 37 Then
- warval1.BackgroundImage = My.Resources.jackhearts
- WpointVal1 = 11
- ElseIf w1 = 38 Then
- warval1.BackgroundImage = My.Resources.queenhearts
- WpointVal1 = 12
- ElseIf w1 = 39 Then
- warval1.BackgroundImage = My.Resources.kinghearts
- WpointVal1 = 13
- ElseIf w1 = 40 Then
- warval1.BackgroundImage = My.Resources.acespades
- WpointVal1 = 14
- ElseIf w1 = 41 Then
- warval1.BackgroundImage = My.Resources._2spades
- WpointVal1 = 2
- ElseIf w1 = 42 Then
- warval1.BackgroundImage = My.Resources._3spades
- WpointVal1 = 3
- ElseIf w1 = 43 Then
- warval1.BackgroundImage = My.Resources._4spades
- WpointVal1 = 4
- ElseIf w1 = 44 Then
- warval1.BackgroundImage = My.Resources._5spades
- WpointVal1 = 5
- ElseIf w1 = 45 Then
- warval1.BackgroundImage = My.Resources._6spades
- WpointVal1 = 6
- ElseIf w1 = 46 Then
- warval1.BackgroundImage = My.Resources._7spades
- WpointVal1 = 7
- ElseIf w1 = 47 Then
- warval1.BackgroundImage = My.Resources._8spades
- WpointVal1 = 8
- ElseIf w1 = 48 Then
- warval1.BackgroundImage = My.Resources._9spades
- WpointVal1 = 9
- ElseIf w1 = 49 Then
- warval1.BackgroundImage = My.Resources._10spades
- WpointVal1 = 10
- ElseIf w1 = 50 Then
- warval1.BackgroundImage = My.Resources.jackspades
- WpointVal1 = 11
- ElseIf w1 = 51 Then
- warval1.BackgroundImage = My.Resources.queenspades
- WpointVal1 = 12
- ElseIf w1 = 52 Then
- warval1.BackgroundImage = My.Resources.kingspades
- WpointVal1 = 13
- End If
- If w2 = 1 Then
- warval2.BackgroundImage = My.Resources.aceclubs
- WpointVal2 = 14
- ElseIf w2 = 2 Then
- warval2.BackgroundImage = My.Resources._2clubs
- WpointVal2 = 2
- ElseIf w2 = 3 Then
- warval2.BackgroundImage = My.Resources._3clubs
- WpointVal2 = 3
- ElseIf w2 = 4 Then
- warval2.BackgroundImage = My.Resources._4clubs
- WpointVal2 = 4
- ElseIf w2 = 5 Then
- warval2.BackgroundImage = My.Resources._5clubs
- WpointVal2 = 5
- ElseIf w2 = 6 Then
- warval2.BackgroundImage = My.Resources._6clubs
- WpointVal2 = 6
- ElseIf w2 = 7 Then
- warval2.BackgroundImage = My.Resources._7clubs
- WpointVal2 = 7
- ElseIf w2 = 8 Then
- warval2.BackgroundImage = My.Resources._8clubs
- WpointVal2 = 8
- ElseIf w2 = 9 Then
- warval2.BackgroundImage = My.Resources._9clubs
- WpointVal2 = 9
- ElseIf w2 = 10 Then
- warval2.BackgroundImage = My.Resources._10clubs
- WpointVal2 = 10
- ElseIf w2 = 11 Then
- warval2.BackgroundImage = My.Resources.jackclubs
- WpointVal2 = 11
- ElseIf w2 = 12 Then
- warval2.BackgroundImage = My.Resources.queenclubs
- WpointVal2 = 12
- ElseIf w2 = 13 Then
- warval2.BackgroundImage = My.Resources.kingclubs
- WpointVal2 = 13
- ElseIf w2 = 14 Then
- warval2.BackgroundImage = My.Resources.acediamonds
- WpointVal2 = 14
- ElseIf w2 = 15 Then
- warval2.BackgroundImage = My.Resources._2diamonds
- WpointVal2 = 12
- ElseIf w2 = 16 Then
- warval2.BackgroundImage = My.Resources._3diamonds
- WpointVal2 = 3
- ElseIf w2 = 17 Then
- warval2.BackgroundImage = My.Resources._4diamonds
- WpointVal2 = 4
- ElseIf w2 = 18 Then
- warval2.BackgroundImage = My.Resources._5diamonds
- WpointVal2 = 5
- ElseIf w2 = 19 Then
- warval2.BackgroundImage = My.Resources._6diamonds
- WpointVal2 = 6
- ElseIf w2 = 20 Then
- warval2.BackgroundImage = My.Resources._7diamonds
- WpointVal2 = 7
- ElseIf w2 = 21 Then
- warval2.BackgroundImage = My.Resources._8diamonds
- WpointVal2 = 8
- ElseIf w2 = 22 Then
- warval2.BackgroundImage = My.Resources._9diamonds
- WpointVal2 = 9
- ElseIf w2 = 23 Then
- warval2.BackgroundImage = My.Resources._10diamonds
- WpointVal2 = 10
- ElseIf w2 = 24 Then
- warval2.BackgroundImage = My.Resources.jackdiamonds
- WpointVal2 = 11
- ElseIf w2 = 25 Then
- warval2.BackgroundImage = My.Resources.queendiamonds
- WpointVal2 = 12
- ElseIf w2 = 26 Then
- warval2.BackgroundImage = My.Resources.kingdiamonds
- WpointVal2 = 13
- ElseIf w2 = 27 Then
- warval2.BackgroundImage = My.Resources.acehearts
- WpointVal2 = 14
- ElseIf w2 = 28 Then
- warval2.BackgroundImage = My.Resources._2hearts
- WpointVal2 = 2
- ElseIf w2 = 29 Then
- warval2.BackgroundImage = My.Resources._3hearts
- WpointVal2 = 3
- ElseIf w2 = 30 Then
- warval2.BackgroundImage = My.Resources._4hearts
- WpointVal2 = 4
- ElseIf w2 = 31 Then
- warval2.BackgroundImage = My.Resources._5hearts
- WpointVal2 = 5
- ElseIf w2 = 32 Then
- warval2.BackgroundImage = My.Resources._6hearts
- WpointVal2 = 6
- ElseIf w2 = 33 Then
- warval2.BackgroundImage = My.Resources._7hearts
- WpointVal2 = 7
- ElseIf w2 = 34 Then
- warval2.BackgroundImage = My.Resources._8hearts
- WpointVal2 = 8
- ElseIf w2 = 35 Then
- warval2.BackgroundImage = My.Resources._9hearts
- WpointVal2 = 9
- ElseIf w2 = 36 Then
- warval2.BackgroundImage = My.Resources._10hearts
- WpointVal2 = 10
- ElseIf w2 = 37 Then
- warval2.BackgroundImage = My.Resources.jackhearts
- WpointVal2 = 11
- ElseIf w2 = 38 Then
- warval2.BackgroundImage = My.Resources.queenhearts
- WpointVal2 = 12
- ElseIf w2 = 39 Then
- warval2.BackgroundImage = My.Resources.kinghearts
- WpointVal2 = 13
- ElseIf w2 = 40 Then
- warval2.BackgroundImage = My.Resources.acespades
- WpointVal2 = 14
- ElseIf w2 = 41 Then
- warval2.BackgroundImage = My.Resources._2spades
- WpointVal2 = 2
- ElseIf w2 = 42 Then
- warval2.BackgroundImage = My.Resources._3spades
- WpointVal2 = 3
- ElseIf w2 = 43 Then
- warval2.BackgroundImage = My.Resources._4spades
- WpointVal2 = 4
- ElseIf w2 = 44 Then
- warval2.BackgroundImage = My.Resources._5spades
- WpointVal2 = 5
- ElseIf w2 = 45 Then
- warval2.BackgroundImage = My.Resources._6spades
- WpointVal2 = 6
- ElseIf w2 = 46 Then
- warval2.BackgroundImage = My.Resources._7spades
- WpointVal2 = 7
- ElseIf w2 = 47 Then
- warval2.BackgroundImage = My.Resources._8spades
- WpointVal2 = 8
- ElseIf w2 = 48 Then
- warval2.BackgroundImage = My.Resources._9spades
- WpointVal2 = 9
- ElseIf w2 = 49 Then
- warval2.BackgroundImage = My.Resources._10spades
- WpointVal2 = 10
- ElseIf w2 = 50 Then
- warval2.BackgroundImage = My.Resources.jackspades
- WpointVal2 = 11
- ElseIf w2 = 51 Then
- warval2.BackgroundImage = My.Resources.queenspades
- WpointVal2 = 12
- ElseIf w2 = 52 Then
- warval2.BackgroundImage = My.Resources.kingspades
- WpointVal2 = 13
- End If
- warval1.Visible = True
- warval2.Visible = True
- If WpointVal1 > WpointVal2 Then
- 'need to code in here
- p1Score = p1Score + 10
- End If
- If WpointVal2 > WpointVal1 Then
- 'need to code in here
- p2Score = p2Score + 10
- End If
- If WpointVal1 = WpointVal2 Then
- MessageBox.Show("Double war... I didnt code that.... RESTART!")
- Application.Restart()
- End If
- 'need code to consider who wins/loses...
- 'same scoring system as c1 and c2
- ' need anotehr button to toggle
- 'make sure that wcoreing is updated and labeled
- ' check the conditions in c1 and w1 to ensure correctness
- Button1.Enabled = True
- 'Update score here
- lblP1Val.Text = p1Score
- lblP2Val.Text = p2Score
- Button1.Enabled = True
- Button1.Visible = True
- btnWar.Visible = False
- btnWar.Enabled = False
- warcard1.Visible = False
- warcard2.Visible = False
- warcard3.Visible = False
- warcard4.Visible = False
- warcard5.Visible = False
- warcard6.Visible = False
- If p1Score >= 52 Then
- MessageBox.Show("Player 1 Wins!")
- Application.Restart()
- End If
- If p2Score >= 52 Then
- MessageBox.Show("Player 2 Wins!")
- Application.Restart()
- End If
- lblP1Val.Text = p1Score
- lblP2Val.Text = p2Score
- End Sub
- Private Sub Label4_Click(sender As Object, e As EventArgs) Handles lblP2Val.Click
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement