Ver Mensaje Individual
  #2 (permalink)  
Antiguo 25/01/2008, 12:26
Avatar de Kruzado
Kruzado
 
Fecha de Ingreso: marzo-2007
Mensajes: 307
Antigüedad: 18 años, 1 mes
Puntos: 17
Re: Contador sumatorio

declara estas dos variables como publicas
public totalpremios as double
public intentos as integer
en el formload

totalpremios=0
intentos=0

en el boton para jugar

if intentos <20 then
tu rutina de juegos
else
msgbox("No tienes mas intentos")
endif

crea un boton para resetear (comenzar a jugar denuevo) y agregale lo sig:
totalpremios=0
intentos=0

aqui va el codigo para calcular los premios (con mayuscula el ke totaliza)

If (num = 1 And num1 = 1 And num2 = 1) Then
MessageBox.Show("Has ganado 15 euros")
TOTALPREMIOS=TOTALPREMIOS+15
End If

If (num = 2 And num1 = 2 And num2 = 2) Then
MessageBox.Show("Has ganado 25 euros")
TOTALPREMIOS=TOTALPREMIOS+25

End If

If (num = 3 And num1 = 3 And num2 = 3) Then
MessageBox.Show("Has gando 45 euros")
TOTALPREMIOS=TOTALPREMIOS+45
End If
LABELNUEVO.CAPTION=TOTALPREMIOS