Está en la página 1de 4

Private Sub TxtApuesta_TextChanged(ByVal sender As System.

Object,
ByVal e As System.EventArgs)
If TxtApuesta.Text = "" Then
MsgBox("Entre una apuesta por favor....", "Faltan datos")
ElseIf OptCaballo1.Checked = False And OptCaballo2.Checked =
False And OptCaballo3.Checked = False And OptCaballo4.Checked = False And
OptCaballo5.Checked = False Then
MsgBox("Escoga un favorito....", "Faltan datos")
Else
Timer1.Enabled = True
End If
End Sub
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles CmdSalir.Click
Me.Close()
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Randomize()
Dim Cambio1 As Integer
Cambio1 = 0
Dim Cambio2 As Integer
Cambio2 = 0
Dim Cambio3 As Integer
Cambio3 = 0
Dim Cambio4 As Integer
Cambio4 = 0
Dim Cambio5 As Integer
Cambio5 = 0
End Sub

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Timer1.Tick
Dim Cambio1 As Integer
Cambio1 = (Cambio1 + (Int((100 - 1) * Rnd() + 1)) * -1) + ((1
0) * Rnd() + 1)
PicCab1.Left = PicCab1.Left + Cambio1
Dim Cambio2 As Integer
Cambio2 = (Cambio2 + (Int((100 - 1) * Rnd() + 1)) * -1) + ((1
0) * Rnd() + 1)
PicCab2.Left = PicCab2.Left + Cambio2
Dim Cambio3 As Integer
Cambio3 = (Cambio3 + (Int((100 - 1) * Rnd() + 1)) * -1) + ((1
0) * Rnd() + 1)
PicCab3.Left = PicCab3.Left + Cambio3
Dim Cambio4 As Integer
Cambio4 = (Cambio4 + (Int((100 - 1) * Rnd() + 1)) * -1) + ((1
0) * Rnd() + 1)
PicCab4.Left = PicCab4.Left + Cambio4
Dim Cambio5 As Integer
Cambio5 = (Cambio5 + (Int((100 - 1) * Rnd() + 1)) * -1) + ((1
0) * Rnd() + 1)
PicCab5.Left = PicCab5.Left + Cambio5

If PicCab1.Left < 360 Then


Timer1.Enabled = False
MsgBox("Gano Caballo1", vbExclamation, "Ganador")
If OptCaballo1.Checked = True Then
MsgBox("Acaba de ganar " & TxtApuesta.Text,
vbExclamation, "Es Usted un Ganador")
TxtTotal.Text = Val(TxtTotal.Text) + Val(TxtApuesta.Text)
TxtGanados.Text = Val(TxtGanados) + 1
Else
MsgBox("Acaba de perder " & TxtApuesta.Text,
vbExclamation, "Es Usted un Perdedor")
TxtTotal.Text = Val(TxtTotal) - Val(TxtApuesta.Text)
TxtPerdidos.Text = Val(TxtPerdidos) + 1
End If
PicCab1.Left = 7560
PicCab2.Left = 7560
PicCab3.Left = 7560
PicCab4.Left = 7560
PicCab5.Left = 7560
ElseIf PicCab2.Left < 360 Then
Timer1.Enabled = False
MsgBox("Gan Caballo2", vbExclamation, "Ganador")
If OptCaballo2.Checked = True Then
MsgBox("Acaba de ganar " & TxtApuesta.Text,
vbExclamation, "Es Usted un Ganador")
TxtTotal.Text = Val(TxtTotal.Text) + Val(TxtApuesta.Text)
TxtGanados.Text = Val(TxtGanados) + 1
Else
MsgBox("Acaba de perder " & TxtApuesta.Text,
vbExclamation, "Es Usted un Perdedor")
TxtTotal.Text = TxtTotal.Text - TxtApuesta.Text
TxtPerdidos.Text = Val(TxtPerdidos) + 1
End If
PicCab1.Left = 7560
PicCab2.Left = 7560
PicCab3.Left = 7560
PicCab4.Left = 7560
PicCab5.Left = 7560
ElseIf PicCab3.Left < 360 Then
Timer1.Enabled = False
MsgBox("Gan Caballo3", vbExclamation, "Ganador")
If OptCaballo3.Checked = True Then
MsgBox("Acaba de ganar " & TxtApuesta.Text,
vbExclamation, "Es Usted un Ganador")
TxtTotal.Text = Val(TxtTotal.Text) + Val(TxtApuesta.Text)
TxtGanados.Text = Val(TxtGanados) + 1
Else
MsgBox("Acaba de perder " & TxtApuesta.Text,
vbExclamation, "Es Usted un Perdedor")
TxtTotal.Text = Val(TxtTotal) - Val(TxtApuesta.Text)
TxtPerdidos.Text = Val(TxtPerdidos) + 1
End If
PicCab1.Left = 7560
PicCab2.Left = 7560

PicCab3.Left = 7560
PicCab4.Left = 7560
PicCab5.Left = 7560
ElseIf PicCab4.Left < 360 Then
Timer1.Enabled = False
MsgBox("Gan Caballo4", vbExclamation, "Ganador")
If OptCaballo4.Checked = True Then
MsgBox("Acaba de ganar " & TxtApuesta.Text,
vbExclamation, "Es Usted un Ganador")
TxtTotal.Text = Val(TxtTotal.Text) + Val(TxtApuesta.Text)
TxtGanados.Text = Val(TxtGanados) + 1
Else
MsgBox("Acaba de perder " & TxtApuesta.Text,
vbExclamation, "Es Usted un Perdedor")
TxtTotal.Text = Val(TxtTotal) - Val(TxtApuesta.Text)
TxtPerdidos.Text = Val(TxtPerdidos) + 1
End If
PicCab1.Left = 7560
PicCab2.Left = 7560
PicCab3.Left = 7560
PicCab4.Left = 7560
PicCab5.Left = 7560
ElseIf PicCab5.Left < 360 Then
Timer1.Enabled = False
MsgBox("Gan OptCaballo5", vbExclamation, "Ganador")
If OptCaballo5.Checked = True Then
MsgBox("Acaba de ganar " & TxtApuesta.Text,
vbExclamation, "Es Usted un Ganador")
TxtTotal.Text = Val(TxtTotal.Text) + Val(TxtApuesta.Text)
TxtGanados.Text = Val(TxtGanados) + 1
Else
MsgBox("Acaba de perder " & TxtApuesta.Text,
vbExclamation, "Es Usted un Perdedor")
TxtTotal.Text = Val(TxtTotal) - Val(TxtApuesta.Text)
TxtPerdidos.Text = Val(TxtPerdidos) + 1
End If
PicCab1.Left = 7560
PicCab2.Left = 7560
PicCab3.Left = 7560
PicCab4.Left = 7560
PicCab5.Left = 7560
End If
End Sub
Private Sub CmdIniciar_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles CmdIniciar.Click
If TxtApuesta.Text = "" Then
MsgBox("Entre una apuesta por favor....", vbCritical, "Faltan
datos")
ElseIf OptCaballo1.Checked = False And OptCaballo2.Checked =
False And OptCaballo3.Checked = False And OptCaballo4.Checked = False And
OptCaballo5.Checked = False Then
MsgBox("Escoga un favorito....", vbCritical, "Faltan datos")
Else
Timer1.Enabled = True
End If
End Sub

End Class

También podría gustarte