Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
Indovina - Form1.frm

Form1.frm

Caricato da: Albertking82
Scarica il programma completo

  1. Option Explicit
  2. Private Type sfondo
  3.  id As Integer
  4.  nome As String * 20
  5.  usato As Boolean
  6. End Type
  7. Dim intnumtot As Integer, inttent As Integer
  8. Dim intstart As Integer, strrisposta As String
  9. Dim strsoluzione As String
  10. Dim paesaggio(1 To 7) As sfondo
  11. Dim paesaggi As Integer
  12. Dim paesaggiusati As Integer
  13. Dim intnuova As Integer
  14. Dim quale As Integer
  15. Dim colore As Integer
  16. Dim i As Integer
  17. Dim cont As Integer
  18.  
  19.  
  20. Public Sub setup()
  21. intnumtot = 6
  22. paesaggi = 7
  23. paesaggio(1).nome = "tramonto"
  24. paesaggio(2).nome = "colline azzurre"
  25. paesaggio(3).nome = "inverno"
  26. paesaggio(4).nome = "diablo"
  27. paesaggio(5).nome = "aida yespica"
  28. paesaggio(6).nome = "culo"
  29. paesaggio(7).nome = "michelle hunziker"
  30. For i = 1 To 7
  31. paesaggio(i).usato = False
  32. Next i
  33. End Sub
  34.  
  35. Public Sub init()
  36. Randomize Timer
  37.  If paesaggiusati < paesaggi Then
  38.   Do While paesaggiusati < paesaggi
  39.    quale = Int(Rnd * 7) + 1
  40.   If paesaggio(quale).usato = False Then
  41.    paesaggio(quale).usato = True
  42.    strsoluzione = paesaggio(quale).nome
  43.    paesaggiusati = paesaggiusati + 1
  44.    Image1.Picture = LoadPicture(App.Path & "\" & Trim(paesaggio(quale).nome) & ".jpg")
  45.  Exit Do
  46.   End If
  47.   Loop
  48.  Else
  49.   MsgBox ("game over")
  50.    End
  51.  End If
  52.  intstart = Int(Rnd * 24)
  53.  inttent = 0
  54.  For i = 0 To 24
  55.   Picture1(i).Enabled = False
  56.   Picture1(i).Visible = True
  57.   Next i
  58. End Sub
  59.  
  60. Private Sub Command1_Click()
  61. strrisposta = InputBox("inserisci il nome dell'immagine!")
  62. If strrisposta <> "" Then
  63. Timer1.Enabled = False
  64. For i = 0 To 24
  65. Picture1(i).Visible = False
  66. Next i
  67. Else
  68.  Exit Sub
  69.  End If
  70. If Trim(LCase(strrisposta)) = Trim(LCase(strsoluzione)) Then
  71.  Label3.Visible = True
  72.  Label3.Caption = "hai impiegato " & cont & " secondi"
  73.  intnuova = MsgBox("ok hai indovinato l'immagine vuoi giocare ancora?", vbYesNo)
  74.  Label1.Caption = "90"
  75.   Label1.Visible = False
  76.  Label2.Visible = False
  77.  If intnuova = vbYes Then
  78.   cont = 0
  79.   Label3.Visible = False
  80.  Command1.Enabled = False
  81.  Call init
  82.  Exit Sub
  83.  Else
  84.  End
  85.  End If
  86.  Else
  87.  Label4.Visible = True
  88.  Label4.Caption = "Il nome dell'immagine è " & UCase(strsoluzione)
  89.  intnuova = MsgBox("Hai sbagliato!!! vuoi giocare ancora?", vbYesNo)
  90.  Label1.Caption = "90"
  91.  Label1.Visible = False
  92.  Label2.Visible = False
  93.   If intnuova = vbYes Then
  94.   Command1.Enabled = False
  95.   Label4.Visible = False
  96.  Call init
  97.  Exit Sub
  98.  Else
  99. MsgBox "Game Over", vbInformation, "exit"
  100. End
  101.  End If
  102.  End If
  103.  
  104. End Sub
  105.  
  106. Private Sub Cmdgo_Click()
  107. cont = 0
  108. If Label3.Visible = True Then
  109.  Label3.Visible = False
  110.  End If
  111. Command1.Enabled = True
  112. Timer1.Enabled = True
  113. Label1.Visible = True
  114. Label2.Visible = True
  115. For i = 0 To 24
  116.   Picture1(i).Enabled = True
  117.   Next i
  118.    Picture1(intstart).Visible = False
  119.    Timer1.Enabled = True
  120. End Sub
  121.  
  122. Private Sub Form_Load()
  123. cont = 0
  124. Call setup
  125. Call init
  126. End Sub
  127.  
  128. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  129. If MsgBox("Vuoi uscire?", vbInformation + vbYesNo, "esci") = vbNo Then
  130. Cancel = True
  131. Else
  132. MsgBox "BY ALBERT KING!!!!!", vbInformation, "creatore"
  133. End
  134. End If
  135. End Sub
  136.  
  137. Private Sub mnucolcaselle_Click()
  138. Randomize
  139. colore = Int(Rnd * 15)
  140. For i = 0 To 24
  141.  Picture1(i).BackColor = QBColor(colore)
  142.  Next i
  143.  
  144. End Sub
  145.  
  146. Private Sub mnucolsfondo_Click()
  147. Randomize
  148. colore = Int(Rnd * 15)
  149.  Form1.BackColor = QBColor(colore)
  150. End Sub
  151.  
  152. Private Sub mnuesci_Click()
  153. intnuova = MsgBox("Vuoi uscire?", vbYesNo)
  154. If intnuova = vbYes Then
  155. End
  156. End If
  157. Command1.Enabled = False
  158. End Sub
  159.  
  160. Private Sub Picture1_Click(Index As Integer)
  161. inttent = inttent + 1
  162. If inttent > intnumtot Then
  163. Timer1.Enabled = False
  164. intnuova = MsgBox("hai perso !! hai finito le possibilità!! vuoi giocare ancora?", vbYesNo)
  165. Command1.Enabled = False
  166. Label1.Visible = False
  167. Label2.Visible = False
  168. If intnuova = vbYes Then
  169. Call init
  170. Exit Sub
  171.  Else
  172.  End
  173.  End If
  174.  End If
  175.  If Picture1(Index).Visible = True Then
  176.  Picture1(Index).Visible = False
  177.  End If
  178. End Sub
  179.  
  180. Private Sub Timer1_Timer()
  181. If Val(Label1.Caption) = 0 Then
  182. intnuova = MsgBox("tempo scaduto vuoi giocare ancora?", vbYesNo)
  183. Command1.Enabled = False
  184.  If intnuova = vbYes Then
  185.  Cmdgo.Enabled = True
  186.  Command1.Enabled = False
  187.  Call init
  188.  Exit Sub
  189.  Else
  190.  End
  191.  End If
  192. Else
  193. cont = cont + 1
  194. Label1.Caption = Val(Label1.Caption - 1)
  195. End If
  196. End Sub