home *** CD-ROM | disk | FTP | other *** search
- on startMovie
- global gMovie, gPunteggio, gNumeroDomanda, gMaxDomande, g20domande, gListaDomandaFatte, gTutorial
- set the soundEnabled to 1
- g20domande = 0
- gMovie = "QUIZ"
- gPunteggio = 0
- gListaDomandaFatte = []
- gMaxDomande = the number of lines in field "dati"
- set the text of field "conteggio" to " "
- the itemDelimiter = "#"
- if the machineType <> 256 then
- set the textSize of member "domanda" to 14
- set the textSize of member "risposta1" to 10
- set the textSize of member "risposta2" to 10
- set the textSize of member "risposta3" to 10
- end if
- gTutorial = "Tgiochi"
- domanda()
- visualizzadomanda()
- end
-
- on stopMovie
- global gMaxDomande, gNumeroDomanda, gListaDomandaFatte, gRispostaSbagliata, g20domande
- gMaxDomande = 0
- gNumeroDomanda = 0
- gListaDomandaFatte = 0
- gRispostaSbagliata = 0
- g20domande = 0
- SCARICAMEM()
- end
-
- on domanda
- global gMaxdomanda, gListaDomandaFatte, gNumeroDomanda, gMaxDomande
- repeat with i = 1 to the maxinteger
- gNumeroDomanda = random(1, gMaxDomande)
- tmp = getOne(gListaDomandaFatte, gNumeroDomanda)
- if tmp = 0 then
- append(gListaDomandaFatte, gNumeroDomanda)
- exit repeat
- end if
- end repeat
- end
-
- on visualizzadomanda
- global gNumeroDomanda, gMaxDomande, gRispostaSbagliata, g20domande
- g20domande = g20domande + 1
- if g20domande = 21 then
- go("punteggio", "giochi")
- exit
- end if
- repeat with i = 5 to 9
- sprite(i).visible = 1
- end repeat
- gRispostaSbagliata = 0
- dati = line gNumeroDomanda of field "dati"
- set the text of field "domanda" to item 1 of dati
- set the text of field "risposta1" to item 2 of dati
- set the foreColor of field "risposta1" to 0
- set the text of field "risposta2" to item 3 of dati
- set the foreColor of field "risposta2" to 0
- set the text of field "risposta3" to item 4 of dati
- set the foreColor of field "risposta3" to 0
- aggiornaconteggio()
- end
-
- on suonook rispostasbagliata
- if rispostasbagliata = 0 then
- tmp = string(random(1, 7))
- tmp2 = "Repgod0" & tmp
- set the soundEnabled to 1
- puppetSound(tmp2, 1)
- updateStage()
- repeat while soundBusy(1)
- go(the frame)
- end repeat
- else
- tmp = string(random(8, 9))
- tmp2 = "Repgod0" & tmp
- set the soundEnabled to 1
- puppetSound(tmp2, 1)
- updateStage()
- repeat while soundBusy(1)
- go(the frame)
- end repeat
- end if
- end
-
- on suonono
- tmp = string(random(1, 2))
- tmp2 = "Repbad0" & tmp
- set the soundEnabled to 1
- puppetSound(tmp2, 1)
- updateStage()
- repeat while soundBusy(1)
- nothing()
- end repeat
- end
-
- on aggiornaconteggio
- global g20domande
- set the text of field "conteggio" to g20domande && "di 20"
- updateStage()
- end
-
- on nascondisbagliate
- spr = the currentSpriteNum
- case spr of
- 5:
- sprite(7).visible = 0
- sprite(9).visible = 0
- 7:
- sprite(5).visible = 0
- sprite(9).visible = 0
- 9:
- sprite(7).visible = 0
- sprite(5).visible = 0
- end case
- updateStage()
- end
-