home *** CD-ROM | disk | FTP | other *** search
/ Galleria D'arte: Manet / Manet.iso / Dati / Quiz.dxr / 00001_main.ls next >
Encoding:
Text File  |  2000-12-21  |  2.9 KB  |  120 lines

  1. on startMovie
  2.   global gMovie, gPunteggio, gNumeroDomanda, gMaxDomande, g20domande, gListaDomandaFatte, gTutorial
  3.   set the soundEnabled to 1
  4.   g20domande = 0
  5.   gMovie = "QUIZ"
  6.   gPunteggio = 0
  7.   gListaDomandaFatte = []
  8.   gMaxDomande = the number of lines in field "dati"
  9.   set the text of field "conteggio" to " "
  10.   the itemDelimiter = "#"
  11.   if the machineType <> 256 then
  12.     set the textSize of member "domanda" to 14
  13.     set the textSize of member "risposta1" to 10
  14.     set the textSize of member "risposta2" to 10
  15.     set the textSize of member "risposta3" to 10
  16.   end if
  17.   gTutorial = "Tgiochi"
  18.   domanda()
  19.   visualizzadomanda()
  20. end
  21.  
  22. on stopMovie
  23.   global gMaxDomande, gNumeroDomanda, gListaDomandaFatte, gRispostaSbagliata, g20domande
  24.   gMaxDomande = 0
  25.   gNumeroDomanda = 0
  26.   gListaDomandaFatte = 0
  27.   gRispostaSbagliata = 0
  28.   g20domande = 0
  29.   SCARICAMEM()
  30. end
  31.  
  32. on domanda
  33.   global gMaxdomanda, gListaDomandaFatte, gNumeroDomanda, gMaxDomande
  34.   repeat with i = 1 to the maxinteger
  35.     gNumeroDomanda = random(1, gMaxDomande)
  36.     tmp = getOne(gListaDomandaFatte, gNumeroDomanda)
  37.     if tmp = 0 then
  38.       append(gListaDomandaFatte, gNumeroDomanda)
  39.       exit repeat
  40.     end if
  41.   end repeat
  42. end
  43.  
  44. on visualizzadomanda
  45.   global gNumeroDomanda, gMaxDomande, gRispostaSbagliata, g20domande
  46.   g20domande = g20domande + 1
  47.   if g20domande = 21 then
  48.     go("punteggio", "giochi")
  49.     exit
  50.   end if
  51.   repeat with i = 5 to 9
  52.     sprite(i).visible = 1
  53.   end repeat
  54.   gRispostaSbagliata = 0
  55.   dati = line gNumeroDomanda of field "dati"
  56.   set the text of field "domanda" to item 1 of dati
  57.   set the text of field "risposta1" to item 2 of dati
  58.   set the foreColor of field "risposta1" to 0
  59.   set the text of field "risposta2" to item 3 of dati
  60.   set the foreColor of field "risposta2" to 0
  61.   set the text of field "risposta3" to item 4 of dati
  62.   set the foreColor of field "risposta3" to 0
  63.   aggiornaconteggio()
  64. end
  65.  
  66. on suonook rispostasbagliata
  67.   if rispostasbagliata = 0 then
  68.     tmp = string(random(1, 7))
  69.     tmp2 = "Repgod0" & tmp
  70.     set the soundEnabled to 1
  71.     puppetSound(tmp2, 1)
  72.     updateStage()
  73.     repeat while soundBusy(1)
  74.       go(the frame)
  75.     end repeat
  76.   else
  77.     tmp = string(random(8, 9))
  78.     tmp2 = "Repgod0" & tmp
  79.     set the soundEnabled to 1
  80.     puppetSound(tmp2, 1)
  81.     updateStage()
  82.     repeat while soundBusy(1)
  83.       go(the frame)
  84.     end repeat
  85.   end if
  86. end
  87.  
  88. on suonono
  89.   tmp = string(random(1, 2))
  90.   tmp2 = "Repbad0" & tmp
  91.   set the soundEnabled to 1
  92.   puppetSound(tmp2, 1)
  93.   updateStage()
  94.   repeat while soundBusy(1)
  95.     nothing()
  96.   end repeat
  97. end
  98.  
  99. on aggiornaconteggio
  100.   global g20domande
  101.   set the text of field "conteggio" to g20domande && "di 20"
  102.   updateStage()
  103. end
  104.  
  105. on nascondisbagliate
  106.   spr = the currentSpriteNum
  107.   case spr of
  108.     5:
  109.       sprite(7).visible = 0
  110.       sprite(9).visible = 0
  111.     7:
  112.       sprite(5).visible = 0
  113.       sprite(9).visible = 0
  114.     9:
  115.       sprite(7).visible = 0
  116.       sprite(5).visible = 0
  117.   end case
  118.   updateStage()
  119. end
  120.