home *** CD-ROM | disk | FTP | other *** search
- on ChapterClick
- global gcurtype, gQTstatus
- if (gcurtype = "qt") or ((gcurtype = "movie") and (the frameLabel = "qt")) then
- if the movieRate of sprite 16 then
- set gQTstatus to 1
- else
- set gQTstatus to 0
- end if
- set the movieRate of sprite 16 to 0
- puppetSprite(16, 1)
- set the locH of sprite 16 to 1000
- end if
- ClickSnd()
- updateStage()
- NavButtonWindow()
- EndTrapMouse()
- end
-
- on NavButtonClose
- global gcurtype
- if not rollOver(33) then
- if the puppet of sprite 33 then
- set the locH of sprite 33 to 1000
- set the locH of sprite 34 to 1000
- updateStage()
- puppetSprite(33, 0)
- puppetSprite(34, 0)
- end if
- end if
- if ((the frameLabel = "qt") and (gcurtype = "movie")) or (gcurtype = "qt") then
- puppetSprite(16, 0)
- end if
- end
-
- on NavButtonWindow
- global gWorld
- puppetSprite(33, 1)
- puppetSprite(34, 1)
- if gWorld = "senses" then
- set the locH of sprite 33 to 428
- set the locH of sprite 34 to 433
- else
- if gWorld = "body" then
- set the locH of sprite 33 to 358
- set the locH of sprite 34 to 361
- else
- if gWorld = "design" then
- set the locH of sprite 33 to 352
- set the locH of sprite 34 to 355
- else
- if gWorld = "power" then
- set the locH of sprite 33 to 327
- set the locH of sprite 34 to 330
- else
- if gWorld = "discover" then
- set the locH of sprite 33 to 439
- set the locH of sprite 34 to 442
- else
- if gWorld = "mind" then
- set the locH of sprite 33 to 431
- set the locH of sprite 34 to 433
- end if
- end if
- end if
- end if
- end if
- end if
- set the height of sprite 33 to the height of cast "chaptertitles" + 10
- end
-
- on NavButtonUpdate
- global gCurChap, gCurArticle, gArticles
- set numarticles to count(getAt(gArticles, gCurChap))
- set the text of field "CurrentChapter" to line gCurChap of field "chaptertitles"
- set the text of field "CurrentArticle" to gCurArticle && "of" && numarticles
- if numarticles = 1 then
- set the visible of sprite 35 to 0
- set the visible of sprite 36 to 0
- else
- set the visible of sprite 35 to 1
- set the visible of sprite 36 to 1
- end if
- end
-
- on DoNugget
- global gNuggetTime, gNuggetDelay, gNuggetOn, gWhichNugget, gMaxNuggets, gStartNuggetCast, gInAMap
- if gInAMap then
- exit
- end if
- if gWhichNugget < 0 then
- exit
- end if
- if the frameLabel = "qt" then
- exit
- end if
- if the frameLabel = "facts" then
- exit
- end if
- set the itemDelimiter to "."
- set tmp to item 2 of the frameLabel
- set the itemDelimiter to ","
- if tmp = "anim" then
- exit
- end if
- if not gNuggetOn then
- if (the ticks - gNuggetTime) > gNuggetDelay then
- set gNuggetOn to 1
- else
- exit
- end if
- end if
- set nsp to 47
- set speed to 5
- if not (the puppet of sprite 47) then
- set gStartNuggetCast to the castNum of sprite 47
- puppetSprite(47, 1)
- set the locH of sprite 47 to 635
- set the locV of sprite 47 to 100 + random(200)
- else
- set tmp to the castNum of sprite 47
- if the name of cast tmp = "nugget6" then
- set tmp to gStartNuggetCast
- else
- set tmp to tmp + 1
- end if
- set the castNum of sprite 47 to tmp
- set the locH of sprite 47 to the locH of sprite 47 - speed
- if the locH of sprite 47 < 0 then
- set gNuggetOn to 0
- set gNuggetTime to the ticks
- puppetSprite(47, 0)
- end if
- end if
- end
-
- on ShowNugget
- global gWhichNugget, gnuggets, gMaxNuggets, gNuggetOn, gNuggetTime, gNuggetList
- ClickSnd()
- updateStage()
- if gNuggetOn = 2 then
- exit
- end if
- set gNuggetOn to 2
- set nsb to 46
- set nsp to 47
- set nspt to 48
- set the itemDelimiter to "#"
- set the text of field "nuggettext" to item gWhichNugget of gnuggets
- set the itemDelimiter to ","
- set h to the height of cast "nuggettext"
- set w to the width of cast "nuggettext"
- set x to the locH of sprite nsp
- set y to the locV of sprite nsp
- put x && y
- if x < 50 then
- set x to 50
- else
- if x > 350 then
- set x to 350
- end if
- end if
- if y < 50 then
- set y to 50
- else
- if y > 400 then
- set y to 400
- end if
- end if
- put x && y
- set the castNum of sprite nsp to the number of cast "nuggetback"
- spriteBox(nsp, x - 15, y - 15, x + w + 15, y + h + 15)
- set the locH of sprite nspt to x
- set the locV of sprite nspt to y
- set temptime to the ticks
- repeat while the mouseDown
- updateStage()
- end repeat
- repeat while (the ticks - temptime) < 30
- updateStage()
- end repeat
- repeat while not (the mouseDown)
- updateStage()
- end repeat
- set gNuggetOn to 0
- set gNuggetTime to the ticks
- set the locH of sprite nsp to 1000
- set the locH of sprite nspt to 1000
- updateStage()
- puppetSprite(nsp, 0)
- puppetSprite(nspt, 0)
- set gWhichNugget to random(gMaxNuggets)
- set tmp to count(gNuggetList)
- if tmp >= gMaxNuggets then
- set gWhichNugget to -1
- else
- repeat while getPos(gNuggetList, gWhichNugget)
- set gWhichNugget to random(gMaxNuggets)
- end repeat
- add(gNuggetList, gWhichNugget)
- end if
- EndTrapMouse()
- end
-