jjss_19
12-03-2009, 03:08 PM
Hi I'm creating a modified version of Yahtzee game. I have a textbox in which when all the dice roll their totals all added up are shown in the textbox. I have the user rolling three times then the third roll's totals are shown. At the end of one round the total is shown. A problem i am having is when i start a new round the total is wiped out. How can i make it so that the total of a new round is added to the players existing total?
The code I have right now is:
'randomizing my 5 dice
Randomize
a=Int(Rnd * 6) + 1
b=Int(Rnd * 6) + 1
c=Int(Rnd * 6) + 1
d=Int(Rnd * 6) + 1
e=Int(Rnd * 6) + 1
t = a + b + c + d + e
imgDice1(a).Visible = True
imgDice2(b).Visible = True
imgDice3(c).Visible = True
imgDice4(d).Visible = True
imgDice5(e).Visible = True
If ct = 3 Then
txtsum.text = t
msgbox "begin new round"
cmdRoll.Enabled = true
Form_load
End If
The code I have right now is:
'randomizing my 5 dice
Randomize
a=Int(Rnd * 6) + 1
b=Int(Rnd * 6) + 1
c=Int(Rnd * 6) + 1
d=Int(Rnd * 6) + 1
e=Int(Rnd * 6) + 1
t = a + b + c + d + e
imgDice1(a).Visible = True
imgDice2(b).Visible = True
imgDice3(c).Visible = True
imgDice4(d).Visible = True
imgDice5(e).Visible = True
If ct = 3 Then
txtsum.text = t
msgbox "begin new round"
cmdRoll.Enabled = true
Form_load
End If