home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Webster's Millennium Amer…Sign Language Dictionary
/
ASL.ISO
/
mac
/
SKILLS.dir
/
00012_Script_12
< prev
next >
Wrap
Text File
|
2001-09-05
|
13KB
|
389 lines
on concSignSetUp
global SignList,WordList,FlippedWord,FlippedSign,NumPlayers,player,gDownLoads
global signCast,WordCast
global gWordList,gDataSource,gHistoryData,reviewListing,scrollList,gGameCat
global gMatchList,gNumTries
global p1Correct,p2Correct
global bad,myAlertWindow
global gCurrentUser,gSkipMe
if gSkipMe = 1 then set gSkipMe = gSkipMe + 1
if numPlayers = 1 then
put "Score:" into field "p1 title"
put "Time:" into field "p1 score"
put 0 into field "p2 title"
put "0:00" into field "p2 score"
else
put "Player 1" into field "p1 title"
put "0" into field "p1 score"
put "Player 2" into field "p2 title"
put "0" into field "p2 score"
set p1Correct = []
set p2Correct = []
end if
updateStage
set SignList = []
set gMatchList = []
set bad = []
set gNumTries = 0
cursor 4
--alertBox "Preparing Game..."
if gDataSource = "entire dictionary" then
repeat while count(SignList) < 12
set newSign = random(count(gWordList))
if not goodMedia(newSign) then next repeat
if getPos(SignList,newSign) = 0 then append SignList, newSign
end repeat
else if gDataSource = "category" and not (gGameCat="") then
if gGameCat = "DownLoaded Signs" then
put gDownLoads into catWords
else
--PETEMACK 09.05.01
-- tell window "dData" to put the number of cast (gGameCat&"."&gCurrentUser) into userCat
-- if userCat > 0 then
-- tell window "dData" to put field (gGameCat&"."&gCurrentUser) into catWords
-- else tell window "dData" to put field gGameCat into catWords
set vRandomPick = random(29) --PETEMACK 09.05.01
set vRandomPick = vRandomPick + 30 --PETEMACK 09.05.01
tell window "dData" to set vCatName = the name of member vRandomPick --PETEMACK 09.05.01
if gSkipMe = 2 then --PETEMACK 09.05.01
alert string(QUOTE & vCatName & QUOTE && "Category Randomly Selected") --PETEMACK 09.05.01
set gSkipMe = 0 --PETEMACK 09.05.01
end if --PETEMACK 09.05.01
tell window "dData" to put field vRandomPick into catWords --PETEMACK 09.05.01
end if
set catList = getStringToList(catWords)
repeat while count(SignList) < 12 and count(SignList) < count(catList)-count(bad)
set aWord = getAt(catList,random(count(catList)))
set newSign = getPos(gWordList,aWord)
if not goodMedia(newSign) then
if getPos(bad,aWord) = 0 then add bad, aWord
next repeat
end if
if getPos(SignList,newSign) = 0 then append SignList, newSign
end repeat
else if gDataSource = "all sessions" or gDataSource = "recent session" then
repeat while count(SignList) < 12 and count(SignList) < count(gHistoryData)-count(bad)
set aWord = getAt(gHistoryData,random(count(gHistoryData)))
set newSign = getPos(gWordList,aWord)
if not goodMedia(newSign) then
if getPos(bad,aWord) = 0 then add bad, aWord
next repeat
end if
if getPos(SignList,newSign) = 0 then append SignList, newSign
end repeat
else
repeat while count(SignList) < 12 and count(SignList) < count(gHistoryData)-count(bad)
set aWord = getAt(gHistoryData,random(count(gHistoryData)))
set newSign = getPos(gWordList,aWord)
if not goodMedia(newSign) then
if getPos(bad,aWord) = 0 then add bad, aWord
next repeat
end if
if getPos(SignList,newSign) = 0 then append SignList, newSign
end repeat
end if
if count(SignList) < 12 then
repeat while count(SignList) < 12
set newSign = random(count(gWordList))
if not goodMedia(newSign) then next repeat
if getPos(SignList,newSign) = 0 then append SignList, newSign
end repeat
end if
set WordList = scramble(SignList)
set FlippedWord = 0
set FlippedSign = 0
--put "0" into field "p1 score"
--put "0" into field "p2 score"
-- if numPlayers = 1 then
-- put "Score:" into field "p1 title"
-- put "Time:" into field "p1 score"
-- put 0 into field "p2 title"
-- put "0:00" into field "p2 score"
-- else
-- put "Player 1" into field "p1 title"
-- put "0" into field "p1 score"
-- put "Player 2" into field "p2 title"
-- put "0" into field "p2 score"
-- set p1Correct = []
-- set p2Correct = []
-- end if
--set NumPlayers = 2
puppetSprite 34,true --designate player bBox
puppetSprite 36,true --cleanUp QT rect box
set player = 0
setPlayer
repeat with i = 3 to 26
puppetSprite i, false
end repeat
updatestage
repeat with i = 3 to 26
puppetSprite i, true
end repeat
updatestage
set SignCast = 0
set WordCast = 0
enableMenu(TRUE)
-- close myAlertWindow
-- forget myAlertWindow
updateStage
cursor 0
end concSignSetUp
on ConcSigns
global signList,gWordList,gDownloads
repeat with i = 1 to count(SignList)
put getAt(gWordList,getAt(signlist,i)) && (gDownloads contains getAt(gWordList,getAt(signlist,i)))
end repeat
end
on scramble TheList
put false into finished
set testList = []
set returnList = []
set returnvals = ""
repeat while not finished
set nextVal = random(count(theList))
if getPos(testList,nextVal) = 0 then
append returnList, getAt(TheList,nextVal)
append testList,nextVal
end if
if count(returnList) = 12 then set finished = true
end repeat
return returnList
end scramble
on setPlayer
global player,NumPlayers
if numPlayers = 2 then
if player = 1 then
set player = 2
set the rect of sprite 34 = rect(316, 431, 416, 452) --p2
else
set player = 1
set the rect of sprite 34 = rect(223, 431, 315, 452) --p1
end if
else
set the rect of sprite 34 = rect(-10,-10,0,0)
end if
updatestage
end setPlayer
-- NumToChar(65) = "A"
-- NumToChar(97) = "a"
on SignFlip
global SignList,WordList,FlippedWord,FlippedSign
put the clickon-2 into spNum
if the type of sprite (spNum+2) = #digitalVideo then -- 16 is video
setSign
exit
end if
if the type of sprite (spNum+2) = #text then -- 7 is text
setWord
exit
end if
if spNum < 7 or (spNum >12 and spNum <19) then
if spNum mod 2 = 0 then set signRef = getAt(WordList,integer(spNum/2))
else set signRef = getAt(SignList,integer(spNum/2)+1)
else
if spNum mod 2 = 0 then set signRef = getAt(SignList,integer(spNum/2))
else set signRef = getAt(WordList,integer(spNum/2)+1)
end if
if spNum < 7 or (spNum >12 and spNum <19) then
if spNum mod 2 = 0 then setWord signRef,spNum,"on"
else setSign signRef,spNum,"on"
else
if spNum mod 2 = 0 then setSign signRef,spNum,"on"
else setWord signRef,spNum,"on"
end if
updatestage
checkMatch
--put getAt(gWordList,signRef)
updatestage
end SignFlip
on setWord CastRef, SRef, state
global FlippedWord,FlippedSign,WordCast,gWordList
if state = "on" then
if not (FlippedWord = 0) then
set the castNum of sprite FlippedWord+2 = 555+FlippedWord
set locOffset = (the width of cast (555+FlippedWord))/2
set l = the locH of sprite (FlippedWord+2) + 5
set the locH of sprite (FlippedWord+2) to l+integer(locOffset)
set the locV of sprite (FlippedWord+2) = (the locV of sprite (FlippedWord+2) + 5)
updatestage
--put "flipping back"
end if
--tell window "dData" to put the name of cast (castRef+5000) into wordName
put getAt(gWordList,castRef) into field "wordText"
set l = the left of sprite(sRef+2)
set c = (the top of sprite (sRef+2) + the bottom of sprite (sRef+2))/2
---ïïï
set the loch of sprite 2 to the loch of sprite the clickon
set the locv of sprite 2 to the locv of sprite the clickon
---ïïï
set the castNum of sprite (sRef+2) to the number of cast "wordText"
set the ink of sprite (sRef+2) to 36
set the loch of sprite (sRef+2) to l - 5
set the locv of sprite (sRef+2) to c - 5
--put sref
set WordCast = castRef
set FlippedWord = SRef
--put "on"
else
--put "off"
set the castNum of sprite FlippedWord+2 = 555+FlippedWord
set locOffset = (the width of cast (555+FlippedWord))/2
set l = the locH of sprite (FlippedWord+2)
set the locH of sprite (FlippedWord+2) to l+integer(locOffset)
set FlippedWord = 0
end if
updatestage
end setWord
on setSign CastRef, SRef, state
global FlippedWord,FlippedSign,SignCast
if state = "on" then
if not (FlippedSign = 0) then
set the castNum of sprite FlippedSign+2 = 555+FlippedSign
set the width of sprite (FlippedSign+2) to the width of cast (555+FlippedSign)
set the height of sprite (FlippedSign+2) to the height of cast (555+FlippedSign)
updatestage
end if
videoSetUp CastRef,SRef
set signCast = CastRef
set FlippedSign = SRef
else
set the castNum of sprite FlippedSign+2 = 555+FlippedSign
set the width of sprite (FlippedSign+2) to the width of cast (555+FlippedSign)
set the height of sprite (FlippedSign+2) to the height of cast (555+FlippedSign)
set FlippedSign = 0
end if
updatestage
end setSign
on videoSetUp castRef,SRef
global gSoundOn
global videoFile,gWordList
cursor 4
tell window "dData" to put the text of cast getAt(gWordList,castRef) into DictEntry
--tell window "dData" to put the text of cast (castRef+5000) into DictEntry
set the itemDelimiter to "*"
put item 5 of DictEntry into qtRef
put item 6 of DictEntry into pictRef
put item 11 of DictEntry into field "hint"
set videoFile = getName(qtRef,"MOVS")
put char 1 to (length(item 8 of DictEntry)-3) of item 8 of DictEntry&"aif" into descSnd
if the machineType = 256 then
set descFile = getName(descSnd,"snds/Desc") --snd expl
else set descFile = getName(descSnd,"snds:Desc") --snd expl
sound stop 3
if not (the filename of cast "sound desc" = descFile) then
set the filename of cast "sound desc" = descFile
end if
set the filename of cast "video" to videoFile
set the itemDelimiter to ","
set the movierate of sprite 40 = 0
if gSoundOn then
sound playfile 3, the filename of cast "sound desc"
end if
set the directToStage of cast "video" to true
set the loop of cast "video" to true
set the castNum of sprite (SRef+2) to the number of cast "video"
set w = the width of cast "video"
set h = the height of cast "video"
set the width of sprite (SRef+2) to integer(w/2.0) --2.5
set the height of sprite (SRef+2) to integer(h/2.0)
--put the rect of sprite (SRef+2)
--set the movierate of sprite 40 to 1
cursor 0
end videoSetUp
on checkMatch
global FlippedWord,FlippedSign,NumPlayers,player,p1Correct,p2Correct
global signCast,WordCast,gMatchList,gNumTries,gClockOn
if not (FlippedWord = 0 or FlippedSign = 0) then
if SignCast = WordCast then
add gMatchList, WordCast
if NumPlayers = 2 then
if player = 1 then
--
add p1Correct, WordCast
--
else
--
add p2Correct, WordCast
--
end if
end if
repeat with i = 1 to 10000
if the mouseDown then exit repeat
end repeat
set fWordTemp = flippedWord
set fSignTemp = flippedSign
setWord
setSign
updatestage
set the loch of sprite 2 to -100
set the loch of sprite fWordTemp+2 to -100
set the loch of sprite fSignTemp+2 to -100
set FlippedSign = 0
set FlippedWord = 0
updatescore
else
if NumPlayers = 2 then setPlayer --2
end if
if count(gMatchList) = 12 then
saveResults
set gClockOn = false
mouseUp (script "summary script")
end if
end if
set gNumTries = gNumTries+1
end checkMatch
on updatescore3
global player,NumPlayers
if NumPlayers = 2 then
if player = 1 then
put string(integer(field "p1 score")+1) into field "p1 score"
else
put string(integer(field "p2 score")+1) into field "p2 score"
end if
else
put string(integer(field "p2 title")+1) into field "p2 title"
end if
end updatescore