Click here to Skip to main content
16,019,133 members

Comments by Amerigoware (Top 2 by date)

Amerigoware 6-Sep-24 10:35am View    
Deleted
Thank you OriginalGriff. This is what I came up with:
Public Class Form1
#Region "Variables"
Private P1, P2, P3 As Integer
Private R1, R2, R3 As Integer
Private Rand As New Random
Private SW1, SW2, SW3 As New Stopwatch
Private Cash As Integer = 100
Private Chance As Integer
#End Region

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
ImageList1.Images.Add(My.Resources.Penny)
ImageList1.Images.Add(My.Resources.Nickle)
ImageList1.Images.Add(My.Resources.Dime)
ImageList1.Images.Add(My.Resources.Quarter)
ImageList1.Images.Add(My.Resources.Half_Dollar)
ImageList1.Images.Add(My.Resources.Dollar)
P1 = Rand.Next(0, 6)
P2 = Rand.Next(0, 6)
P3 = Rand.Next(0, 6)
PictureBox1.Image = ImageList1.Images(P1)
PictureBox2.Image = ImageList1.Images(P2)
PictureBox3.Image = ImageList1.Images(P3)
ScoreLbl.Text = "$" & Cash.ToString
End Sub

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Label1.Text = ""
Cash -= 1
ScoreLbl.Text = "$" & Cash.ToString
Chance = Rand.Next(0, 101)
R1 = Rand.Next(1500, 2000)
R2 = Rand.Next(2000, 2500)
R3 = Rand.Next(2500, 3000)
Timer1.Interval = 100
Timer1.Start()
Timer2.Interval = 100
Timer2.Start()
Timer3.Interval = 100
Timer3.Start()
Timer4.Start()
SW1.Start()
SW2.Start()
SW3.Start()
Button1.Enabled = False
End Sub

#Region "Timers"
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
P1 += 1
If P1 > 5 Then
P1 = 0
End If
PictureBox1.Image = ImageList1.Images(P1)
PictureBox1.Image.Tag = P1
Timer1.Interval += 10
If SW1.ElapsedMilliseconds >= R1 Then
SW1.Stop()
SW1.Reset()
Timer1.Stop()
End If
End Sub

Private Sub Timer2_Tick(sender As Object, e As EventArgs) Handles Timer2.Tick
P2 += 1
If P2 > 5 Then
P2 = 0
End If
PictureBox2.Image = ImageList1.Images(P2)
PictureBox2.Image.Tag = P2
Timer2.Interval += 10
If SW2.ElapsedMilliseconds >= R2 Then
If P2 = P1 Then
'Chance = Rand.Next(0, 101)
Select Case P1
Case 0
Allow2()
Case 1
If Chance < 80 Then
Allow2()
Else
R2 += 100
Exit Select
End If
Case 2
If Chance < 60 Then
Allow2()
Else
R2 += 100
Exit Select
End If
Case 3
If Chance < 40 Then
Allow2()
Else
R2 += 100
Exit Select
End If
Case 4
If Chance < 20 Then
Allow2()
Else
R2 += 100
Exit Select
End If
Case 5
If Chance < 10 Then
Allow2()
Else
R2 += 100
Exit Select
End If
End Select
Else
Allow2()
End If

End If
Amerigoware 30-Dec-22 9:03am View    
Thanks for the suggestion. I will try that. I suspect I will have to clear the temp folder on the next start up though, but that's okay.