Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

How To Make A Rock, Paper, Scissors Game In Visual Basic 2008

Loading...

Sign in or sign up now!
42,260
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Feb 7, 2009

Visual Basic 2008 - Rock, Paper, Scissors Game. Just Another Simple Tutorial On How To Make A Game In Visual Basic 2008. Got Some Of The Codes From PC User Magizine And Decided To Edit There Codes And Produce A Tutorial...
Song: I Do Not Know :S
Codes:

Public Class Form1
Dim userselected As Integer
Dim gameresult As Integer

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ComboBox1.SelectedIndex = 0
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Random As New Random
Dim computerchoice = Random.Next(3)
If computerchoice = userselected Then gameresult = 0
Select Case computerchoice
Case 0
If userselected = 1 Then gameresult = 2
If userselected = 2 Then gameresult = 1
Case 1
If userselected = 0 Then gameresult = 1
If userselected = 2 Then gameresult = 2
Case 2
If userselected = 0 Then gameresult = 2
If userselected = 1 Then gameresult = 1
End Select
Select Case gameresult
Case 0
Label1.Text = "It Was A Draw"
Case 1
Label1.Text = "Bad Luck! Computer Wins"
Case 2
Label1.Text = "You Win!"
End Select
End Sub
End Class

Thanks For Watching And Don't Be Afraid To Ask For Help!

  • likes, 27 dislikes

Link to this comment:

Share to:
see all

All Comments (233)

Sign In or Sign Up now to post a comment!
  • if u say Don't Be Afraid To Ask For Help! please answer in an question that i make for uu ?

    how u zoom ?please answer to me !

  • @hateandrelativity oh yeah i see it now it's so simple. Thank you so much. Subscribed.

  • @wirgiukass the first case of choice which is declared as random holds the argument between the userselected choice, look at the conditions in case 0 at computerchoice. if userselected = 1 then gameresult = 2, that means if computerchoice is 0 which is rock and if userselected is 1 which is paper then go to gameresult case 2 which is label1.caption = "You Win"

  • well i created the program but i have a hard time understanding the numbers. Please explain it to me if you can it would be really helpful

  • It worked! Thanks!

  • hahahahahahaha evrybody has the same video on how to make this game :)

  • wtf is the point downloading vb when u dont know how to code NOOB

  • RPS!!! not RBS

View all Comments »
Loading...

0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more