Option Explicit
Private Type sfondo
id As Integer
nome As String * 20
usato As Boolean
End Type
Dim intnumtot As Integer, inttent As Integer
Dim intstart As Integer, strrisposta As String
Dim strsoluzione As String
Dim paesaggio(1 To 7) As sfondo
Dim paesaggi As Integer
Dim paesaggiusati As Integer
Dim intnuova As Integer
Dim quale As Integer
Dim colore As Integer
Dim i As Integer
Dim cont As Integer
Public Sub setup()
intnumtot = 6
paesaggi = 7
paesaggio(1).nome = "tramonto"
paesaggio(2).nome = "colline azzurre"
paesaggio(3).nome = "inverno"
paesaggio(4).nome = "diablo"
paesaggio(5).nome = "aida yespica"
paesaggio(6).nome = "culo"
paesaggio(7).nome = "michelle hunziker"
For i = 1 To 7
paesaggio(i).usato = False
Next i
End Sub
Public Sub init()
Randomize Timer
If paesaggiusati < paesaggi Then
Do While paesaggiusati < paesaggi
quale = Int(Rnd * 7) + 1
If paesaggio(quale).usato = False Then
paesaggio(quale).usato = True
strsoluzione = paesaggio(quale).nome
paesaggiusati = paesaggiusati + 1
Image1.Picture = LoadPicture(App.Path & "\" & Trim(paesaggio(quale).nome) & ".jpg")
Exit Do
End If
Loop
Else
MsgBox ("game over")
End
End If
intstart = Int(Rnd * 24)
inttent = 0
For i = 0 To 24
Picture1(i).Enabled = False
Picture1(i).Visible = True
Next i
End Sub
Private Sub Command1_Click()
strrisposta = InputBox("inserisci il nome dell'immagine!")
If strrisposta <> "" Then
Timer1.Enabled = False
For i = 0 To 24
Picture1(i).Visible = False
Next i
Else
Exit Sub
End If
If Trim(LCase(strrisposta)) = Trim(LCase(strsoluzione)) Then
Label3.Visible = True
Label3.Caption = "hai impiegato " & cont & " secondi"
intnuova = MsgBox("ok hai indovinato l'immagine vuoi giocare ancora?", vbYesNo)
Label1.Caption = "90"
Label1.Visible = False
Label2.Visible = False
If intnuova = vbYes Then
cont = 0
Label3.Visible = False
Command1.Enabled = False
Call init
Exit Sub
Else
End
End If
Else
Label4.Visible = True
Label4.Caption = "Il nome dell'immagine è " & UCase(strsoluzione)
intnuova = MsgBox("Hai sbagliato!!! vuoi giocare ancora?", vbYesNo)
Label1.Caption = "90"
Label1.Visible = False
Label2.Visible = False
If intnuova = vbYes Then
Command1.Enabled = False
Label4.Visible = False
Call init
Exit Sub
Else
MsgBox "Game Over", vbInformation, "exit"
End
End If
End If
End Sub
Private Sub Cmdgo_Click()
cont = 0
If Label3.Visible = True Then
Label3.Visible = False
End If
Command1.Enabled = True
Timer1.Enabled = True
Label1.Visible = True
Label2.Visible = True
For i = 0 To 24
Picture1(i).Enabled = True
Next i
Picture1(intstart).Visible = False
Timer1.Enabled = True
End Sub
Private Sub Form_Load()
cont = 0
Call setup
Call init
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If MsgBox("Vuoi uscire?", vbInformation + vbYesNo, "esci") = vbNo Then
Cancel = True
Else
MsgBox "BY ALBERT KING!!!!!", vbInformation, "creatore"
End
End If
End Sub
Private Sub mnucolcaselle_Click()
Randomize
colore = Int(Rnd * 15)
For i = 0 To 24
Picture1(i).BackColor = QBColor(colore)
Next i
End Sub
Private Sub mnucolsfondo_Click()
Randomize
colore = Int(Rnd * 15)
Form1.BackColor = QBColor(colore)
End Sub
Private Sub mnuesci_Click()
intnuova = MsgBox("Vuoi uscire?", vbYesNo)
If intnuova = vbYes Then
End
End If
Command1.Enabled = False
End Sub
Private Sub Picture1_Click(Index As Integer)
inttent = inttent + 1
If inttent > intnumtot Then
Timer1.Enabled = False
intnuova = MsgBox("hai perso !! hai finito le possibilità!! vuoi giocare ancora?", vbYesNo)
Command1.Enabled = False
Label1.Visible = False
Label2.Visible = False
If intnuova = vbYes Then
Call init
Exit Sub
Else
End
End If
End If
If Picture1(Index).Visible = True Then
Picture1(Index).Visible = False
End If
End Sub
Private Sub Timer1_Timer()
If Val(Label1.Caption) = 0 Then
intnuova = MsgBox("tempo scaduto vuoi giocare ancora?", vbYesNo)
Command1.Enabled = False
If intnuova = vbYes Then
Cmdgo.Enabled = True
Command1.Enabled = False
Call init
Exit Sub
Else
End
End If
Else
cont = cont + 1
Label1.Caption = Val(Label1.Caption - 1)
End If
End Sub