Computer Science Canada help with my dice game! D8 pls |
Author: | ilikeweatherguy [ Thu Dec 22, 2011 3:42 pm ] |
Post subject: | help with my dice game! D8 pls |
hi, im wrking on this dice game and i was just wondering what is wrong with my if statements ,my teacher checked but couldnt find anything and it doesnt work when money equals wager any help would be greatly appreciated thankyou for reading this Dim L, R, rls, money, wager, total As Single Private Sub cmdroll_Click() If wager > money Then 'checks is wager is less than money lblcantuse.Visible = True ElseIf money > 0 And wager <= money Then lblcantuse.Visible = False lblGameover.Visible = False wager = Val(txtwager.Text) money = money - wager rls = Val(rls) + 1 lblmoney.Caption = money lblr.Caption = rls ElseIf money <= 0 Then 'checks is wager is less than money lblGameover.Visible = True rls = 0 money = 100 End If End Sub Private Sub Form_Load() 'makes all the dice disapear on startup wager = 0 total = 0 money = 100 rls = 0 imgroll1L.Visible = False imgroll2L.Visible = False imgroll3L.Visible = False imgroll4L.Visible = False imgroll5L.Visible = False imgroll6L.Visible = False imgroll1R.Visible = False imgroll2R.Visible = False imgroll3R.Visible = False imgroll4R.Visible = False imgroll5R.Visible = False imgroll5R.Visible = False imgroll6R.Visible = False lblGameover.Visible = False lblr.Caption = rls lblmoney.Caption = money End Sub |
Author: | D_homes [ Fri Dec 23, 2011 12:56 am ] |
Post subject: | Re: help with my dice game! D8 pls |
Quote: If wager > money Then 'checks is wager is less than money
No, that will check if the wager is more than money. ![]() |