Hello, lets begin, shall we ?.
lets do it Step by Step
1) Make form that is pretty small where u make 5 button, call them "Very Easy, Easy, Medium, Hard, and Very Hard"
2) Now add 5 new Forms
3) In form2 call it "Black Jack (Very Easy)"
4) Make 3 labels.
5) Call the first "Limit 21"
6) The second should be "Your Cards: 0"
7) and the Third will be Size 20 with no text.
8) put then so the the "limit 21" is at the left top corner.
9) "Your Cards: 0" right under
10) and the empty one with size 20 just right of them.
11) Make 2 buttons
12) Call one of them "Draw Card" and the other one "End Game"
13) Double Click on "Draw Card" so that u can add a code to it.
14) in it write:
Code:
Dim TheRandomClass As New Random
Dim i As Integer = 0
i = TheRandomClass.Next(1, 3)
Label3.Text = i.ToString
YourCards += i
Label2.Text = "Your Cards: " + YourCards.ToString
If YourCards > 21 Then
MsgBox("You Lost!", MsgBoxStyle.Critical, "Error")
YourCards = 0
Label3.Text = ""
Label2.Text = "Your Cards: 0"
End If
If YourCards = 21 Then
MsgBox("You Won!", MsgBoxStyle.Information, "Won")
YourCards = 0
Label3.Text = ""
Label2.Text = "Your Cards: 0"
End If
15) Now at the top, just under "Public Class Form2" write:
Code:
Public YourCards As Integer = 0
16) Now go to the designer and double click the button "End Game" and write:
Code:
Form1.Show()
Me.Close()
17) Now ur done with the very easy.
18) Now do the same with the other 4 forms, but call them Easy, Medium, Hard and Very Hard instead of Very Easy.
19) In the other forms use the same codes, but change:
Code:
i = TheRandomClass.Next(1, 3)
20) in Easy change the "3" to 6, in Medium to 11, in Hard to 16, and in Very Hard to 22.
Enjoy !