6 Replies - 1914 Views - Last Post: 23 June 2012 - 10:24 PM Rate Topic: ***** 1 Votes

#1 INC.Net  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 23-June 12

Slot Machine in VB.Net winning system not properly working.

Posted 23 June 2012 - 07:48 PM

Hey guys this is my first post and definatly a post I would like doing but I was left with no choice...

So I am coding myself a Visual Basic.Net 2005 Slot Machine program. I've been hard at work on this for about a week and half now. From what I have with it it works and all. However there are so many annoying errors with the program.

LIST:

- I am not winning when I should be. My winning conditions is set when you get 3 of the same picture you are to be awarded with some credits. It works but sometimes when it does land on 3 of the same pictures it still says that I've lost... This is the main problem and I am about to pull my hair out about this!!!!!!!!! :(

- The image with the lowest value is showing up the least and the picture with the most value is showing up more frequent??? I don't want to change them around to fix that.

- If the play and reset button is click repeatedly the program ends up in an errorous loop...

If anybody think they can aid me in finding a solution to this absolutely absurd problem that would definately be extremely helpful.

I've only been experimenting with this program for about 3 months now and cannot seem to get the hang with this at all..


Here is my code:

'Slot Machine
'June 13th 2012

'A SLOT MACHINE where you can bet your credits and see the results as the thing spins.


Public Class Form1
    Dim BettingAmount As String   'Amount you bet
    Dim SlotImage1 As Integer 'Random Image 1
    Dim SlotImage2 As Integer 'Random Image 2 
    Dim SlotImage3 As Integer 'Random Image 3

    

    Private Sub btnReset_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnReset.Click
        txtBet.Text = ""  'displays no value in txtBet
        lblCredit.Text = 1000 'sets your credit back to $
        lblWelcome.Text = "PARADISE CITY SLOTS!!" 'displays message in lblWelcome
        My.Computer.Audio.Play(My.Resources.PARADISE_CITY, AudioPlayMode.BackgroundLoop) 'plays the audio then btnNew is clicked

    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        lblCredit.Text = 1000 'Sets the starting amount to 1000
        Randomize() 'randomises numbers
        lblWelcome.Text = "PARADISE CITY SLOTS!!"   'makes the welcome text say "PARADISE CITY SLOTS!!"
        MsgBox("Click okay to continue!!")
        My.Computer.Audio.Play(My.Resources.PARADISE_CITY, AudioPlayMode.BackgroundLoop) 'plays the audio when program loads up past the starting message box
        If lblCredit.Text >= 2001 Then
            MessageBox.Show("YOU'VE BEATEN THE GAME!!!") 'if credit score is 2001 or above message box displays "YOU'VE BEATEN THE GAME!!!"
            My.Computer.Audio.Play(My.Resources.kids_cheer, AudioPlayMode.BackgroundLoop) 'plays audio when MessageBox.Show("YOU'VE BEATEN THE GAME!!!") is active
        End If

    End Sub


    Private Sub btnPlay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPlay.Click
        BettingAmount = txtBet.Text 'Sets betting amount to be equal to whatever is in txtBet.Text
        If Not IsNumeric(BettingAmount) Then    'Makes sure that there is a number in the textbox
            txtBet.Text = "" 'Clears the input
            MsgBox("Y U NO INPUT NUMBER??") 'if there is no number in text box this message box displays
            My.Computer.Audio.Play(My.Resources.HEY_, AudioPlayMode.Background) 'Plays thsi audio when MsgBox("Y U NO INPUT NUMBER??") is active
            Exit Sub
        End If

        If BettingAmount <= 0 Then
            txtBet.Text = ""
            MsgBox("HAHA, Nice try buddy that isn't happening!")    'If the betting amount is = to 0 or less then "HAHA, Nice try buddy that isn't happening!" will appear in the message box
            Exit Sub
        End If

        If lblCredit.Text <= 0 Then
            MsgBox("You are all out of credits!!!") 'When credits is = to 0 or less then "You are all out of credits!!!" appears in message box
            My.Computer.Audio.Play(My.Resources.SO_MUCH_MONEY, AudioPlayMode.Background)    'audio plays alont the message box
            Exit Sub
        End If

        If Val(txtBet.Text) > Val(lblCredit.Text) Then
            MsgBox("HEY YOU CAN'T DO THAT bet between 1 and your remaining credits!!!") 'If you try to bet more then you have the text in the message box will appear
            Exit Sub
        End If
       
        Me.tmrSlot1.Start() 'Timer starts then btnGo is clicked
        Me.tmrSlot2.Start() 'Timer starts then btnGo is clicked
        Me.tmrSlot3.Start() 'Timer starts then btnGo is clicked
        Me.tmrSlotShuffle.Start()   'Timer starts then btnGo is clicked
        lblWelcome.Text = "GO BIG OR GO HOME!!!!"   'When btnGo is clicked "GO BIG OR GO HOME!!!!" shows in the message box
        My.Computer.Audio.Play(My.Resources.PARADISE_CITY, AudioPlayMode.BackgroundLoop)

    End Sub

    Private Sub tmrSlot1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrSlot1.Tick
        Randomize()
        SlotImage1 = Int(3) * Rnd() + 1  'Integer equation randomly generates a number between 1 and 3
        If SlotImage1 = 1 Then 'If equation equals 1 then picOne.Image will be cherry
            picOne.Image = My.Resources.Slot_Cherry 'loads a picture of cherry
        End If
        If SlotImage1 = 2 Then 'If equation equals 2 then picTwo.Image will be 7
            picOne.Image = My.Resources.Slot_7 'loads a picture of 7
        End If
        If SlotImage1 = 3 Then 'If equation equals 3 then picThree.Image will be bar
            picOne.Image = My.Resources.Slot_Bar    'loads a picture of bar
        End If
    End Sub

    Private Sub tmrSlot2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrSlot2.Tick
        SlotImage2 = Int(3) * Rnd() + 1 'Integer equation randomly generates a number between 1 and 3
        If SlotImage2 = 1 Then 'If equation equals 1 then picOne.Image will be cherry
            picTwo.Image = My.Resources.Slot_Cherry 'loads a picture of cherry
        End If
        If SlotImage2 = 2 Then 'If equation equals 2 then picTwo.Image will be 7
            picTwo.Image = My.Resources.Slot_7 'loads a picture of 7
        End If
        If SlotImage2 = 3 Then  'If equation equals 3 then picThree.Image will be bar
            picTwo.Image = My.Resources.Slot_Bar    'loads a picture of bar
        End If
    End Sub

    Private Sub tmrSlot3_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles tmrSlot3.Tick
        SlotImage3 = Int(3) * Rnd() + 1  'Integer equation randomly generates a number between 1 and 3
        If SlotImage3 = 1 Then  'If equation equals 1 then picOne.Image will be cherry
            picThree.Image = My.Resources.Slot_Cherry 'loads a picture of cherry
        End If
        If SlotImage3 = 2 Then 'If equation equals 2 then picTwo.Image will be 7
            picThree.Image = My.Resources.Slot_7 'loads a picture of 7
        End If
        If SlotImage3 = 3 Then 'If equation equals 3 then picThree.Image will be bar
            picThree.Image = My.Resources.Slot_Bar  'loads a picture of bar
        End If
    End Sub


    Private Sub tmrSlotShuffle_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrSlotShuffle.Tick
        Static tick As Integer
        tick += 1   'Timer tick will increase by 1

        If tick = 2 Then
            Me.tmrSlot1.Stop()  'If ticking goes over 2 then it will stop for first timer.

        ElseIf tick = 3 Then
            Me.tmrSlot2.Stop()   'If ticking goes over 3 then it will stop for second timer.

        ElseIf tick = 4 Then
            Me.tmrSlot3.Stop()   'If ticking goes over 4 then it will stop for third timer.


            If SlotImage1 = 1 And SlotImage2 = 1 And SlotImage3 = 1 Then
                lblWelcome.Text = "You've won an extra $10!!!"
                lblCredit.Text = Val(lblCredit.Text) + Val(txtBet.Text) + 10 'adds $100 to your credit
                My.Computer.Audio.Play(My.Resources.SLOT_MAH_NOISE, AudioPlayMode.Background)

            ElseIf SlotImage1 = 2 And SlotImage2 = 2 And SlotImage3 = 2 Then
                lblWelcome.Text = "YAY $50 BONUS" 'displays message on the top 
                lblCredit.Text = Val(lblCredit.Text) + Val(txtBet.Text) + 50 'adds $500 to your credit
                My.Computer.Audio.Play(My.Resources.SLOT_MAH_NOISE, AudioPlayMode.Background)

            ElseIf SlotImage1 = 3 And SlotImage2 = 3 And SlotImage3 = 3 Then
                lblWelcome.Text = "YOU'VE WON THE 101 JACKPOT" 'displays message on the top 
                lblCredit.Text = Val(lblCredit.Text) + Val(txtBet.Text) + 101 'adds $101 to your credit
                My.Computer.Audio.Play(My.Resources.LIKE_SUMBO, AudioPlayMode.Background)

            Else
                lblWelcome.Text = "HAHA YOU LOSE! Try again" 'displays message on the top 
                lblCredit.Text = Val(lblCredit.Text) - Val(txtBet.Text) 'decreases your credit by the amount you bet
                My.Computer.Audio.Play(My.Resources.LOSER, AudioPlayMode.Background)

            End If
            tick = 0
            Me.tmrSlotShuffle.Stop()    'Sets timer to stop
        End If

    End Sub

    Private Sub ExitToolStripMenuItem_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem.Click
        Application.Exit()  'Exits the program

    End Sub

    Private Sub CreditsToolStripMenuItem_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles CreditsToolStripMenuItem.Click
        MessageBox.Show("Special thanks to:  Mitchel Tole, Devon COOK!, Shaan Syed, Bethesda, Al Capone, THE VEATLES and Sony Monica Studios") 'Says a special thanks in a messagebox

    End Sub
End Class 



Any help with any of these problems is greatly appreciated.

I really want to learn how to code properly but I don't understand too much concept of it.

I've read the text book a bit, tried some new things, searched on google and so far not so much luck.

Thanks for you time reading this.

Is This A Good Question/Topic? 0
  • +

Replies To: Slot Machine in VB.Net winning system not properly working.

#2 sela007  Icon User is offline

  • D.I.C Addict

Reputation: 138
  • View blog
  • Posts: 838
  • Joined: 21-December 11

Re: Slot Machine in VB.Net winning system not properly working.

Posted 23 June 2012 - 08:21 PM

If you set
SlotImage = Int(3) * Rnd() + 1

the possible numbers are 1,2,3,4
and if you set
SlotImage = Int(2) * Rnd() + 1

the possible numbers are 1,2,3 (because there is 3 kind of pictures) Maybe this is the problem.

This post has been edited by sela007: 23 June 2012 - 08:23 PM

Was This Post Helpful? 1
  • +
  • -

#3 INC.Net  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 23-June 12

Re: Slot Machine in VB.Net winning system not properly working.

Posted 23 June 2012 - 08:31 PM

View Postsela007, on 23 June 2012 - 08:21 PM, said:

If you set
SlotImage = Int(3) * Rnd() + 1

the possible numbers are 1,2,3,4
and if you set
SlotImage = Int(2) * Rnd() + 1

the possible numbers are 1,2,3 (because there is 3 kind of pictures) Maybe this is the problem.



Thanks for a quick reply!!! I was starting to think this post was invisible to the rest!!!

I will definatly give that a try!!! I will post back with results!!!
Was This Post Helpful? 0
  • +
  • -

#4 INC.Net  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 23-June 12

Re: Slot Machine in VB.Net winning system not properly working.

Posted 23 June 2012 - 08:49 PM

THANK YOU SO MUCH!!!! You whoever you are, THANK you tons I swear to god that wasn't going to be the problerm but darn it that would it!!!!

My program works now and that's the biggest problem!!


Thanks a ton man!!!!

:bigsmile: :bigsmile: :bigsmile: :bigsmile: :bigsmile: :bigsmile: :bigsmile: :bigsmile: :bigsmile:

I really can't sum it up but once again thanks a lot!!!

View PostINC.Net, on 23 June 2012 - 08:47 PM, said:

THANK YOU SO MUCH!!!! You whoever you are, THANK you tons I swear to god that wasn't going to be the problerm but darn it that would it!!!!

My program works now and that's the biggest problem!!


Thanks a ton man!!!!

:bigsmile: :bigsmile: :bigsmile: :bigsmile: :bigsmile: :bigsmile: :bigsmile: :bigsmile: :bigsmile:

I really can't sum it up but once again thanks a lot!!!



Whoops typo what I meant was that was the biggest problem and you solved it for me!!!

The program working is defs not a problem to all!!! LOLOL :bananaman: :bananaman: :bananaman: :bananaman: :bananaman:


Once again KuDOS you!!!

[quote name='INC.Net' date='23 June 2012 - 08:48 PM' timestamp='1340509721' post='1650173']
THANK YOU SO MUCH!!!! You whoever you are, THANK you tons I swear to god that wasn't going to be the problerm but darn it that would it!!!!

My program works now and that was the biggest problem in my program!!!!


Thanks a ton man!!!!

:bigsmile: :bigsmile: :bigsmile: :bigsmile: :bigsmile: :bigsmile: :bigsmile: :bigsmile: :bigsmile:

I really can't sum it up but once again thanks a lot!!!
Was This Post Helpful? 0
  • +
  • -

#5 sela007  Icon User is offline

  • D.I.C Addict

Reputation: 138
  • View blog
  • Posts: 838
  • Joined: 21-December 11

Re: Slot Machine in VB.Net winning system not properly working.

Posted 23 June 2012 - 09:16 PM

your welcome :tup:
Was This Post Helpful? 1
  • +
  • -

#6 INC.Net  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 23-June 12

Re: Slot Machine in VB.Net winning system not properly working.

Posted 23 June 2012 - 09:22 PM



Thanks for the help man!!!! I swear to god if it wasn't for that code you put I would be sitting here for hours on end.

This is the code that my textbook told us to do:

(highNumber - lowNumber + 1) * Rnd() + lowNumber

So I thought I would but 3 and 1 since I wanted numbers between 3 and 1!!!

Anyways once again thanks for the help!!!!!


'Slot Machine
'June 13th 2012

'A SLOT MACHINE where you can bet your credits and see the results as the thing spins.


Public Class Form1
    Dim BettingAmount As String   'Amount you bet
    Dim SlotImage1 As Integer 'Random Image 1
    Dim SlotImage2 As Integer 'Random Image 2 
    Dim SlotImage3 As Integer 'Random Image 3

    

    Private Sub btnReset_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnReset.Click
        txtBet.Text = ""  'displays no value in txtBet
        lblCredit.Text = 1000 'sets your credit back to $
        lblWelcome.Text = "PARADISE CITY SLOTS!!" 'displays message in lblWelcome
        My.Computer.Audio.Play(My.Resources.PARADISE_CITY, AudioPlayMode.BackgroundLoop) 'plays the audio then btnNew is clicked

    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        lblCredit.Text = 1000 'Sets the starting amount to 1000
        Randomize() 'randomises numbers
        lblWelcome.Text = "PARADISE CITY SLOTS!!"   'makes the welcome text say "PARADISE CITY SLOTS!!"
        MsgBox("Click okay to continue!!")
        My.Computer.Audio.Play(My.Resources.PARADISE_CITY, AudioPlayMode.BackgroundLoop) 'plays the audio when program loads up past the starting message box

        If lblCredit.Text >= 2001 Then
            MessageBox.Show("YOU'VE BEATEN THE GAME!!!") 'if credit score is 2001 or above message box displays "YOU'VE BEATEN THE GAME!!!"
            My.Computer.Audio.Play(My.Resources.kids_cheer, AudioPlayMode.BackgroundLoop) 'plays audio when MessageBox.Show("YOU'VE BEATEN THE GAME!!!") is active
        End If

    End Sub


    Private Sub btnPlay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPlay.Click
        BettingAmount = txtBet.Text 'Sets betting amount to be equal to whatever is in txtBet.Text
        If Not IsNumeric(BettingAmount) Then    'Makes sure that there is a number in the textbox
            txtBet.Text = "" 'Clears the input
            MsgBox("Y U NO INPUT NUMBER??") 'if there is no number in text box this message box displays
            My.Computer.Audio.Play(My.Resources.HEY_, AudioPlayMode.Background) 'Plays thsi audio when MsgBox("Y U NO INPUT NUMBER??") is active
            Exit Sub
        End If

        If BettingAmount <= 0 Then
            txtBet.Text = ""
            MsgBox("HAHA, Nice try buddy that isn't happening!")    'If the betting amount is = to 0 or less then "HAHA, Nice try buddy that isn't happening!" will appear in the message box
            Exit Sub
        End If

        If lblCredit.Text <= 0 Then
            MsgBox("You are all out of credits!!!") 'When credits is = to 0 or less then "You are all out of credits!!!" appears in message box
            My.Computer.Audio.Play(My.Resources.SO_MUCH_MONEY, AudioPlayMode.Background)    'audio plays alont the message box
            Exit Sub
        End If

        If Val(txtBet.Text) > Val(lblCredit.Text) Then
            MsgBox("HEY YOU CAN'T DO THAT bet between 1 and your remaining credits!!!") 'If you try to bet more then you have the text in the message box will appear
            Exit Sub
        End If
       
        Me.tmrSlot1.Start() 'Timer starts then btnGo is clicked
        Me.tmrSlot2.Start() 'Timer starts then btnGo is clicked
        Me.tmrSlot3.Start() 'Timer starts then btnGo is clicked
        Me.tmrSlotShuffle.Start()   'Timer starts then btnGo is clicked
        lblWelcome.Text = "GO BIG OR GO HOME!!!!"   'When btnGo is clicked "GO BIG OR GO HOME!!!!" shows in the message box
        My.Computer.Audio.Play(My.Resources.PARADISE_CITY, AudioPlayMode.BackgroundLoop)

    End Sub

    Private Sub tmrSlot1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrSlot1.Tick
        Randomize()
        SlotImage1 = Int(2) * Rnd() + 1  'Integer equation randomly generates a number between 1 and 3
        If SlotImage1 = 1 Then 'If equation equals 1 then picOne.Image will be cherry
            picOne.Image = My.Resources.Slot_Cherry 'loads a picture of cherry
        End If
        If SlotImage1 = 2 Then 'If equation equals 2 then picTwo.Image will be 7
            picOne.Image = My.Resources.Slot_7 'loads a picture of 7
        End If
        If SlotImage1 = 3 Then 'If equation equals 3 then picThree.Image will be bar
            picOne.Image = My.Resources.Slot_Bar    'loads a picture of bar
        End If
    End Sub

    Private Sub tmrSlot2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrSlot2.Tick
        SlotImage2 = Int(2) * Rnd() + 1
        'Integer equation randomly generates a number between 1 and 3
        If SlotImage2 = 1 Then 'If equation equals 1 then picOne.Image will be cherry
            picTwo.Image = My.Resources.Slot_Cherry 'loads a picture of cherry
        End If
        If SlotImage2 = 2 Then 'If equation equals 2 then picTwo.Image will be 7
            picTwo.Image = My.Resources.Slot_7 'loads a picture of 7
        End If
        If SlotImage2 = 3 Then  'If equation equals 3 then picThree.Image will be bar
            picTwo.Image = My.Resources.Slot_Bar    'loads a picture of bar
        End If
    End Sub

    Private Sub tmrSlot3_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles tmrSlot3.Tick
        SlotImage3 = Int(2) * Rnd() + 1  'Integer equation randomly generates a number between 1 and 3
        If SlotImage3 = 1 Then  'If equation equals 1 then picOne.Image will be cherry
            picThree.Image = My.Resources.Slot_Cherry 'loads a picture of cherry
        End If
        If SlotImage3 = 2 Then 'If equation equals 2 then picTwo.Image will be 7
            picThree.Image = My.Resources.Slot_7 'loads a picture of 7
        End If
        If SlotImage3 = 3 Then 'If equation equals 3 then picThree.Image will be bar
            picThree.Image = My.Resources.Slot_Bar  'loads a picture of bar
        End If
    End Sub


    Private Sub tmrSlotShuffle_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrSlotShuffle.Tick
        Static tick As Integer
        tick += 1   'Timer tick will increase by 1

        If tick = 2 Then
            Me.tmrSlot1.Stop()  'If ticking goes over 2 then it will stop for first timer.

        ElseIf tick = 3 Then
            Me.tmrSlot2.Stop()   'If ticking goes over 3 then it will stop for second timer.

        ElseIf tick = 4 Then
            Me.tmrSlot3.Stop()   'If ticking goes over 4 then it will stop for third timer.


            If SlotImage1 = 1 And SlotImage2 = 1 And SlotImage3 = 1 Then
                lblWelcome.Text = "You've won an extra 10!!!"
                lblCredit.Text = Val(lblCredit.Text) + Val(txtBet.Text) + 10 'adds your betting amount and an exta 10
                My.Computer.Audio.Play(My.Resources.SLOT_MAH_NOISE, AudioPlayMode.Background)

            ElseIf SlotImage1 = 2 And SlotImage2 = 2 And SlotImage3 = 2 Then
                lblWelcome.Text = "YAY 50 BONUS" 'displays message on the top 
                lblCredit.Text = Val(lblCredit.Text) + Val(txtBet.Text) + 50 'adds betting amount and and extra 50
                My.Computer.Audio.Play(My.Resources.kids_cheer, AudioPlayMode.Background)

            ElseIf SlotImage1 = 3 And SlotImage2 = 3 And SlotImage3 = 3 Then
                lblWelcome.Text = "YOU'VE WON THE 101 JACKPOT" 'displays message on the top 
                lblCredit.Text = Val(lblCredit.Text) + Val(txtBet.Text) + 101 'adds betting amount and extra 101
                My.Computer.Audio.Play(My.Resources.LIKE_SUMBO, AudioPlayMode.Background)

            ElseIf SlotImage1 = 3 And SlotImage2 = 3 And SlotImage3 = 2 Then
                lblWelcome.Text = "YOU'VE WON 100!" 'displays message on the top 
                lblCredit.Text = Val(lblCredit.Text) + 100 
                My.Computer.Audio.Play(My.Resources.SLOT_MAH_NOISE, AudioPlayMode.Background)

            ElseIf SlotImage1 = 2 And SlotImage2 = 3 And SlotImage3 = 3 Then
                lblWelcome.Text = "YOU'VE WON 100!" 'displays message on the top 
                lblCredit.Text = Val(lblCredit.Text) + 100 'Adds 100 to credit
                My.Computer.Audio.Play(My.Resources.SLOT_MAH_NOISE, AudioPlayMode.Background)

            ElseIf SlotImage1 = 3 And SlotImage2 = 2 And SlotImage3 = 3 Then
                lblWelcome.Text = "YOU'VE WON 100!" 'displays message on the top 
                lblCredit.Text = Val(lblCredit.Text) + 100 'Adds 100 to credit
                My.Computer.Audio.Play(My.Resources.SLOT_MAH_NOISE, AudioPlayMode.Background)

            ElseIf SlotImage1 = 2 And SlotImage2 = 2 And SlotImage3 = 3 Then
                lblWelcome.Text = "YOU'VE WON 50!" 'displays message on the top 
                lblCredit.Text = Val(lblCredit.Text) + 50 'Adds 50 to credit
                My.Computer.Audio.Play(My.Resources.SLOT_MAH_NOISE, AudioPlayMode.Background)

            ElseIf SlotImage1 = 2 And SlotImage2 = 3 And SlotImage3 = 2 Then
                lblWelcome.Text = "YOU'VE WON 50!" 'displays message on the top 
                lblCredit.Text = Val(lblCredit.Text) + 50 'Adds 50 to credit
                My.Computer.Audio.Play(My.Resources.SLOT_MAH_NOISE, AudioPlayMode.Background)

            ElseIf SlotImage1 = 3 And SlotImage2 = 2 And SlotImage3 = 2 Then
                lblWelcome.Text = "YOU'VE WON 50!" 'displays message on the top 
                lblCredit.Text = Val(lblCredit.Text) + 50 'Adds 50 to credit
                My.Computer.Audio.Play(My.Resources.SLOT_MAH_NOISE, AudioPlayMode.Background)

            ElseIf SlotImage1 = 3 And SlotImage2 = 1 And SlotImage3 = 3 Then
                lblWelcome.Text = "YOU'VE WON 10!" 'displays message on the top 
                lblCredit.Text = Val(lblCredit.Text) + 10 'Adds 10 to credit
                My.Computer.Audio.Play(My.Resources.kids_cheer, AudioPlayMode.Background)

            ElseIf SlotImage1 = 3 And SlotImage2 = 3 And SlotImage3 = 1 Then
                lblWelcome.Text = "YOU'VE WON 10!" 'displays message on the top 
                lblCredit.Text = Val(lblCredit.Text) + 10 'Adds 10 to credit
                My.Computer.Audio.Play(My.Resources.kids_cheer, AudioPlayMode.Background)

            ElseIf SlotImage1 = 1 And SlotImage2 = 3 And SlotImage3 = 3 Then
                lblWelcome.Text = "YOU'VE WON 10!" 'displays message on the top 
                lblCredit.Text = Val(lblCredit.Text) + 10 'Adds 10 to credit
                My.Computer.Audio.Play(My.Resources.kids_cheer, AudioPlayMode.Background)

            ElseIf SlotImage1 = 2 And SlotImage2 = 1 And SlotImage3 = 2 Then
                lblWelcome.Text = "YOU'VE WON 10!" 'displays message on the top 
                lblCredit.Text = Val(lblCredit.Text) + 10 'Adds 10 to credit
                My.Computer.Audio.Play(My.Resources.kids_cheer, AudioPlayMode.Background)

            ElseIf SlotImage1 = 2 And SlotImage2 = 2 And SlotImage3 = 1 Then
                lblWelcome.Text = "YOU'VE WON 10!" 'displays message on the top 
                lblCredit.Text = Val(lblCredit.Text) + 10 'Adds 10 to credit
                My.Computer.Audio.Play(My.Resources.kids_cheer, AudioPlayMode.Background)

            ElseIf SlotImage1 = 1 And SlotImage2 = 2 And SlotImage3 = 2 Then
                lblWelcome.Text = "YOU'VE WON 10!" 'displays message on the top 
                lblCredit.Text = Val(lblCredit.Text) + 10 'Adds 10 to credit
                My.Computer.Audio.Play(My.Resources.kids_cheer, AudioPlayMode.Background)

            Else
                lblWelcome.Text = "HAHA YOU LOSE! Try again" 'displays message on the top 
                lblCredit.Text = Val(lblCredit.Text) - Val(txtBet.Text) 'decreases your credit by the amount you bet
                My.Computer.Audio.Play(My.Resources.LOSER, AudioPlayMode.Background)

            End If
            tick = 0
            Me.tmrSlotShuffle.Stop()    'Sets timer to stop
        End If

    End Sub

    Private Sub ExitToolStripMenuItem_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem.Click
        Application.Exit()  'Exits the program

    End Sub

    Private Sub CreditsToolStripMenuItem_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles CreditsToolStripMenuItem.Click
        MessageBox.Show(Sony Monica Studios") 'Says a special thanks in a messagebox

    End Sub
End Class




that's the final code build.

IF ANYBODY WANTS TO USE THIS PLEASE MESSAGE ME BEFORE YOU DO!!! THANKS!!!
Was This Post Helpful? 0
  • +
  • -

#7 INC.Net  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 23-June 12

Re: Slot Machine in VB.Net winning system not properly working.

Posted 23 June 2012 - 10:24 PM

NVM it's not final CODE LOL :offtopic: :offtopic: :offtopic:
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1