home *** CD-ROM | disk | FTP | other *** search
- global gcurrsprites, gwords, carm, wordtest, gtot
-
- on checkKey
- if gcurrsprites.count > 0 then
- gcurrsprites = sortlist(gcurrsprites.duplicate())
- if checksp(gcurrsprites) then
- repeat with i in gcurrsprites
- sprite(i).pActive = 0
- sprite(i).member = sprite(i).pfound
- end repeat
- lineto = getline(gcurrsprites)
- member("word list").line[lineto].color = rgb(153, 153, 204)
- gwords.deleteAt(1)
- member("words left").text = string(0 + gwords.count) & "/" & string(gtot) && "Words left"
- repeat with r in gcurrsprites
- repeat with t = 1 to wordtest.count
- if wordtest[t] = gcurrsprites then
- next repeat
- end if
- repeat with dd = 1 to wordtest[t].count
- if wordtest[t][dd] = r then
- wordtest[t].deleteAt(dd)
- if wordtest[t].count = 0 then
- gwords.deleteAt(1)
- lineto = getline(wordtest[t])
- member("word list").line[lineto].color = rgb(153, 153, 204)
- end if
- end if
- end repeat
- end repeat
- end repeat
- gcurrsprites.deleteAll()
- else
- repeat with i in gcurrsprites
- sprite(i).member = sprite(i).pnorm
- sprite(i).pActive = 1
- end repeat
- gcurrsprites.deleteAll()
- puppetSound(4, "incorrect")
- end if
- end if
- if gwords.count = 0 then
- gameEnd()
- end if
- end
-
- on gameEnd
- s = the ticks + 35
- repeat while the ticks < s
- updateStage()
- end repeat
- go("game over")
- end
-
- on getline asd
- repeat with i = 1 to wordtest.count
- if asd = wordtest[i] then
- xt = getu(wordtest.getPropAt(i))
- put xt && "XT"
- return xt
- end if
- end repeat
- end
-
- on getu arg
- case arg of
- #aerotrain:
- return 1
- #bigboy:
- return 2
- #blucher:
- return 3
- #bullettrain:
- return 4
- #canadian:
- return 5
- #cannonball:
- return 6
- #capitole:
- return 7
- #chief:
- return 8
- #coastdaylight:
- return 9
- #colonial:
- return 10
- #consolidation:
- return 11
- #coyotespecial:
- return 12
- #cubanspecial:
- return 13
- #dewittclinton:
- return 14
- #diplomat:
- return 15
- #dixieflyer:
- return 16
- #elcapitan:
- return 17
- #fastmail:
- return 18
- #leshuttle:
- return 19
- #mikado:
- return 20
- #mistral:
- return 21
- #mogul:
- return 22
- #nightowl:
- return 23
- end case
- end
-
- on sortlist aList
- temp1 = []
- repeat with i in aList
- temp1.add(i)
- end repeat
- temp1.sort()
- return temp1
- end
-
- on checksp ali
- repeat with i = 1 to wordtest.count
- if ali = wordtest[i] then
- return 1
- end if
- end repeat
- return 0
- end
-
- on getp ali
- repeat with i = 1 to wordtest.count
- if ali = wordtest[i] then
- return wordtest.getPropAt(i)
- end if
- end repeat
- end
-