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!
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 !
lavdrimMm 1 month ago
@hateandrelativity oh yeah i see it now it's so simple. Thank you so much. Subscribed.
wirgiukass 2 months ago
@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"
hateandrelativity 2 months ago
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
wirgiukass 2 months ago
It worked! Thanks!
maxijack1000 2 months ago
hahahahahahaha evrybody has the same video on how to make this game :)
TRACER333X 3 months ago
wtf is the point downloading vb when u dont know how to code NOOB
MrPimpmanpimp 3 months ago
RPS!!! not RBS
drulte 3 months ago