ProgrammingNoob51
New member
- Joined
- Apr 24, 2012
- Messages
- 1
- Programming Experience
- Beginner
Hi everyone,
I'm building a virtual blackjack game and I'm having difficulty assigning values to the cards. I've set up picture boxes for the dealer's cards and the player's cards, and i've linked those picture boxes to an ImageList that contains all of the cards (+ the picture of the back of the card, since you only see one of the dealer's cards to start out with).
When you hit the "Deal" button, I have the following code so far:
---------------------------------------------------------
Private Sub btnDeal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDeal.Click
Me.btnHit.Visible = True
Me.btnHit.Enabled = True
Me.btnStay.Visible = True
Me.btnStay.Enabled = True
Me.btnBet1.Visible = False
Me.btnBet5.Visible = False
Me.btnBet10.Visible = False
Me.Timer1.Enabled = True
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Randomize()
i = Int(51 * Rnd())
j = Int(51 * Rnd())
k = Int(51 * Rnd())
l = Int(51 * Rnd())
m = Int(51 * Rnd())
n = Int(51 * Rnd())
o = Int(51 * Rnd())
p = Int(51 * Rnd())
q = Int(51 * Rnd())
Me.Dealer1.Image = Me.ImageList1.Images.Item(i)
Me.Dealer2.Image = Me.ImageList1.Images.Item(52)
Me.You1.Image = Me.ImageList1.Images.Item(j)
Me.Dealer1.Visible = True
Me.Dealer2.Visible = True
Me.You1.Visible = True
Me.Timer1.Enabled = False
End Sub
--------------------------------------------------
I have a section at the top that has labels saying: "Dealer's Showing ______", "You're Showing ________".
Does anyone have any suggestions on how to assign values to the indexes/items of the imagelist? For example, items 0-3 have a value of "2", items 4-7 has a value of "3", and so forth...
Thanks!
I'm building a virtual blackjack game and I'm having difficulty assigning values to the cards. I've set up picture boxes for the dealer's cards and the player's cards, and i've linked those picture boxes to an ImageList that contains all of the cards (+ the picture of the back of the card, since you only see one of the dealer's cards to start out with).
When you hit the "Deal" button, I have the following code so far:
---------------------------------------------------------
Private Sub btnDeal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDeal.Click
Me.btnHit.Visible = True
Me.btnHit.Enabled = True
Me.btnStay.Visible = True
Me.btnStay.Enabled = True
Me.btnBet1.Visible = False
Me.btnBet5.Visible = False
Me.btnBet10.Visible = False
Me.Timer1.Enabled = True
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Randomize()
i = Int(51 * Rnd())
j = Int(51 * Rnd())
k = Int(51 * Rnd())
l = Int(51 * Rnd())
m = Int(51 * Rnd())
n = Int(51 * Rnd())
o = Int(51 * Rnd())
p = Int(51 * Rnd())
q = Int(51 * Rnd())
Me.Dealer1.Image = Me.ImageList1.Images.Item(i)
Me.Dealer2.Image = Me.ImageList1.Images.Item(52)
Me.You1.Image = Me.ImageList1.Images.Item(j)
Me.Dealer1.Visible = True
Me.Dealer2.Visible = True
Me.You1.Visible = True
Me.Timer1.Enabled = False
End Sub
--------------------------------------------------
I have a section at the top that has labels saying: "Dealer's Showing ______", "You're Showing ________".
Does anyone have any suggestions on how to assign values to the indexes/items of the imagelist? For example, items 0-3 have a value of "2", items 4-7 has a value of "3", and so forth...
Thanks!