Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class Form1
- Dim left As Integer
- Dim center As Integer
- Dim right As Integer
- Dim leftImage As Integer
- Dim centerImage As Integer
- Dim rightImage As Integer
- Dim slotleft As Integer
- Dim slotcenter As Integer
- Dim slotright As Integer
- Dim timer As Integer = 15
- Dim winnings As Integer
- Dim bet As Integer
- Dim totalwinnings As Integer = 1000
- Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
- totalwinnings = totalwinnings - bet
- Randomize()
- left = (Rnd() * 5) + 1
- center = (Rnd() * 5) + 1
- right = (Rnd() * 5) + 1
- Timer1.Enabled = True
- If left = 1 Then
- PictureBox1.BackgroundImage = My.Resources.slotsbell
- ElseIf left = 2 Then
- PictureBox1.BackgroundImage = My.Resources.slotscherry
- ElseIf left = 3 Then
- PictureBox1.BackgroundImage = My.Resources.slotsseven
- ElseIf left = 4 Then
- PictureBox1.BackgroundImage = My.Resources.slotswatermelon
- ElseIf left = 5 Then
- PictureBox1.BackgroundImage = My.Resources.Slot_Grapes
- End If
- If center = 1 Then
- PictureBox2.BackgroundImage = My.Resources.slotsbell
- ElseIf center = 2 Then
- PictureBox2.BackgroundImage = My.Resources.slotscherry
- ElseIf center = 3 Then
- PictureBox2.BackgroundImage = My.Resources.slotsseven
- ElseIf center = 4 Then
- PictureBox2.BackgroundImage = My.Resources.slotswatermelon
- ElseIf center = 5 Then
- PictureBox2.BackgroundImage = My.Resources.Slot_Grapes
- End If
- If right = 1 Then
- PictureBox3.BackgroundImage = My.Resources.slotsbell
- ElseIf right = 2 Then
- PictureBox3.BackgroundImage = My.Resources.slotscherry
- ElseIf right = 3 Then
- PictureBox3.BackgroundImage = My.Resources.slotsseven
- ElseIf right = 4 Then
- PictureBox3.BackgroundImage = My.Resources.slotswatermelon
- ElseIf right = 5 Then
- PictureBox3.BackgroundImage = My.Resources.Slot_Grapes
- End If
- Label2.Text = totalwinnings
- End Sub
- Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
- timer = timer - 1
- If timer Mod 5 = 1 Then
- PictureBox1.BackgroundImage = My.Resources.slotsbell
- ElseIf timer Mod 5 = 2 Then
- PictureBox1.BackgroundImage = My.Resources.slotscherry
- ElseIf timer Mod 5 = 3 Then
- PictureBox1.BackgroundImage = My.Resources.slotsseven
- ElseIf timer Mod 5 = 4 Then
- PictureBox1.BackgroundImage = My.Resources.slotswatermelon
- ElseIf timer Mod 5 = 0 Then
- PictureBox1.BackgroundImage = My.Resources.Slot_Grapes
- End If
- If timer Mod 5 = 4 Then
- PictureBox2.BackgroundImage = My.Resources.slotsbell
- ElseIf timer Mod 5 = 3 Then
- PictureBox2.BackgroundImage = My.Resources.slotscherry
- ElseIf timer Mod 5 = 2 Then
- PictureBox2.BackgroundImage = My.Resources.slotsseven
- ElseIf timer Mod 5 = 1 Then
- PictureBox2.BackgroundImage = My.Resources.slotswatermelon
- ElseIf timer Mod 5 = 0 Then
- PictureBox2.BackgroundImage = My.Resources.Slot_Grapes
- End If
- If timer Mod 5 = 0 Then
- PictureBox3.BackgroundImage = My.Resources.slotsbell
- ElseIf timer Mod 5 = 2 Then
- PictureBox3.BackgroundImage = My.Resources.slotscherry
- ElseIf timer Mod 5 = 4 Then
- PictureBox3.BackgroundImage = My.Resources.slotsseven
- ElseIf timer Mod 5 = 3 Then
- PictureBox3.BackgroundImage = My.Resources.slotswatermelon
- ElseIf timer Mod 5 = 1 Then
- PictureBox3.BackgroundImage = My.Resources.Slot_Grapes
- End If
- If timer <= 0 Then
- Timer1.Enabled = False
- timer = 15
- slotleft = (Rnd() * 5) + 1
- slotcenter = (Rnd() * 5) + 1
- slotright = (Rnd() * 5) + 1
- If slotleft = 1 Then
- PictureBox1.BackgroundImage = My.Resources.slotsbell
- ElseIf slotleft = 2 Then
- PictureBox1.BackgroundImage = My.Resources.slotscherry
- ElseIf slotleft = 3 Then
- PictureBox1.BackgroundImage = My.Resources.slotsseven
- ElseIf slotleft = 4 Then
- PictureBox1.BackgroundImage = My.Resources.slotswatermelon
- ElseIf slotleft = 5 Then
- PictureBox1.BackgroundImage = My.Resources.Slot_Grapes
- End If
- If slotcenter = 1 Then
- PictureBox2.BackgroundImage = My.Resources.slotsbell
- ElseIf slotcenter = 2 Then
- PictureBox2.BackgroundImage = My.Resources.slotscherry
- ElseIf slotcenter = 3 Then
- PictureBox2.BackgroundImage = My.Resources.slotsseven
- ElseIf slotcenter = 4 Then
- PictureBox2.BackgroundImage = My.Resources.slotswatermelon
- ElseIf slotcenter = 5 Then
- PictureBox2.BackgroundImage = My.Resources.Slot_Grapes
- End If
- If slotright = 1 Then
- PictureBox3.BackgroundImage = My.Resources.slotsbell
- ElseIf slotright = 2 Then
- PictureBox3.BackgroundImage = My.Resources.slotscherry
- ElseIf slotright = 3 Then
- PictureBox3.BackgroundImage = My.Resources.slotsseven
- ElseIf slotright = 4 Then
- PictureBox3.BackgroundImage = My.Resources.slotswatermelon
- ElseIf slotright = 5 Then
- PictureBox3.BackgroundImage = My.Resources.Slot_Grapes
- End If
- If slotright = 1 And slotcenter = 1 And slotleft = 1 Then
- totalwinnings = totalwinnings + bet + (bet * 2)
- ElseIf slotleft = 2 And slotcenter = 2 And slotright = 2 Then
- totalwinnings = totalwinnings + bet + (bet * 5)
- ElseIf slotleft = 3 And slotcenter = 3 And slotright = 3 Then
- totalwinnings = totalwinnings + bet + (bet * 10)
- ElseIf slotleft = 4 And slotcenter = 4 And slotright = 4 Then
- totalwinnings = totalwinnings + bet + (bet * 20)
- ElseIf slotleft = 5 And slotcenter = 5 And slotright = 5 Then
- totalwinnings = totalwinnings + bet + (bet * 100)
- End If
- End If
- Label2.Text = totalwinnings
- If totalwinnings <= 0 Then
- MessageBox.Show("YOU LOSE")
- Application.Exit()
- End If
- End Sub
- Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
- bet = bet + 10
- Label3.Text = bet
- End Sub
- Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
- bet = bet - 10
- Label3.Text = bet
- End Sub
- Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
- MessageBox.Show("Rules!" & vbCrLf & "Add your bet as high as you would like, but you will only win if you get 3 of a kind" & vbCrLf & "Best of Luck and try not to lose all of your money")
- End Sub
- Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
- MessageBox.Show("Odds" & vbCrLf & "Bell= x2" & vbCrLf & "Cherry= x5" & vbCrLf & "Seven= x10" & vbCrLf & "Watermelon= x20" & vbCrLf & "Grape= x100")
- End Sub
- End Class
Add Comment
Please, Sign In to add comment