Results 1 to 1 of 1
  1. #1
    trevor206's Avatar
    Join Date
    Dec 2008
    Gender
    male
    Posts
    324
    Reputation
    12
    Thanks
    107

    How to make a simple game in VB2008

    I don't know if anyone else has used or figured out this code yet but i got bored and figured
    it out one day so im going to post it i guess...

    This is how to make a simple click game.
    You need 5 buttons, 3 timers, 2 progress bars, and 2 labels.
    So your form should look like this.
    Heres the code.

    Button 1/Easy
    Code:
    Timer1.Start
    Button 2/Medium
    Code:
    Timer2.Start
    Button 3/Hard
    Code:
    Timer3.Start
    Button 4/Click
    Code:
    ProgressBar2.Value -= 2
    Button 5/Reset
    Code:
    ProgressBar1.Value = 100
          ProgressBar2.Value = 100
    Timer 1
    Code:
    ProgressBar1.Value -= 2
            If ProgressBar1.Value = _
           ProgressBar1.Minimum Then
                Timer1.Stop()
            End If
    
            If ProgressBar2.Value = _
       ProgressBar2.Minimum Then
                Timer1.Stop()
                    End If
    Timer 2
    Code:
    ProgressBar1.Value -= 2
            If ProgressBar1.Value = _
            ProgressBar1.Minimum Then
                Timer2.Stop()
            End If
    
    
            If ProgressBar2.Value = _
    ProgressBar2.Minimum Then
                Timer2.Stop()
                    End If
    Timer 3
    Code:
     ProgressBar1.Value -= 1
            If ProgressBar1.Value = _
    ProgressBar1.Minimum Then
                Timer3.Stop()
            End If
            
              If ProgressBar2.Value = _
    ProgressBar2.Minimum Then
                Timer3.Stop()
            End If
    Name label 1:Your health
    Name label 2:Computers health

    When your debugging it if you keep click after you win you will get an error but once you build it into a .exe it works fine.
    Last edited by meme; 08-18-2021 at 03:27 PM.

Tags for this Thread