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

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