home *** CD-ROM | disk | FTP | other *** search
Text File | 1987-10-02 | 6.7 KB | 244 lines | [TEXT/ttxt] |
- SCRIPTS FOR STACK: Mr. Potatohead
- ======================================================
-
- ** STACK SCRIPT ************************************
- on openStack
- hide menuBar
- hide message
- send "newGame" to bkgnd 1
- end openStack
-
- on closeStack
- show menuBar
- end closeStack
-
- ** BACKGROUND #1: Potato ************************************
-
- on mouseDown
- global thePart
-
- -- This stuff makes each button follow the mouse when it is the
- -- current face part, as determined by the die roll. It shows up
- -- here just once, instead of being duplicated in each button.
-
- if the short name of the target = thePart then
- repeat while the mouse is down
- show bkgnd button thePart at the mouseloc
- end repeat
- end if
- end mouseDown
-
- on mouseUp
- global partsVisible,counter
- if partsVisible = 6 then
- put "You Win!" into line 1 of bkgnd field "youWin!"
- put counter && "rolls" into line 2 of bkgnd field "youWin!"
- if counter < 7 then
- put "Awesome!" into line 3 of bkgnd field "youWin!"
- else
- if counter < 10 then
- put "Good game!" into line 3 of bkgnd field "youWin!"
- else
- if counter < 15 then
- put "Pretty Good" into line 3 of bkgnd field youWin!
- else
- if counter < 25 then
- put "not too good" into line 3 of bkgnd field "youWin!"
- else
- put "work at it" into line 3 of bkgnd field "youWin!"
- end if
- end if
- end if
- end if
- show bkgnd field "youWin!"
- end if
- end mouseUp
-
- on newGame
-
- -- Sent by either the openStack handler or bkgnd button, "newGame"
- global counter,partsVisible
- put zero into counter
- put zero into partsVisible
- hide bkgnd button "mouth"
- hide bkgnd button "nose"
- hide bkgnd button "leftEye"
- hide bkgnd button "leftEar"
- hide bkgnd button "rightEye"
- hide bkgnd button "rightEar"
- repeat until the mouseClick
- set hilite of bkgnd button "Click Me for Luck" to true
- set hilite of bkgnd button "Click Me for Luck" to false
- end repeat
- set hilite of bkgnd button "Click Me for Luck" to false
- end newGame
-
- on whichPart
- -- This script was the first generation attempt. It created a new
- -- button every time the die was "rolled", set its properties, in-
- -- cluding loading its script, and then showing it. Pretty soon
- -- the stack was loaded with buttons. Not good.
- -- This all works, but is not necessary. Much better to just recycle
- -- the same buttons.
- global thePart
- set lockscreen to true
- set editbkgnd to true
- doMenu New button
- set editbkgnd to false
- hide bkgnd button "new button"
- set name of bkgnd button "new button" to thePart
- set showName of bkgnd button thePart to false
- set style of bkgnd button thePart to transparent
- set icon of bkgnd button thePart to thePart
- show bkgnd button thePart at 215,269
- choose browse tool
- set the script of bkgnd button thePart to ¬
- "on mouseDown" & return ¬
- & "global thePart" & return ¬
- & "set hilite of bkgnd button thePart to true" & return ¬
- & "repeat while the mouse is down" & return ¬
- & "show bkgnd button thePart at the mouseloc" & return ¬
- & "end repeat" & return ¬
- & "set hilite of bkgnd button thePart to false" & return ¬
- & "end mouseDown"
- end whichPart
-
- on showPart
- -- this is now part of the script for bkgnd button "Click Me for Luck"
- global thePart
- if the visible of bkgnd button thePart = false then
- show bkgnd button thePart at 215,269
- end if
- end showPart
-
- ** BKGND #1, FIELD #2 ************************************
- on mouseUp
- hide bkgnd field 2
- end mouseUp
-
- ** BKGND #1, BUTTON #1: Click Me for Luck ************************************
- on mouseUp
- global thePart, counter, partsVisible
- add 1 to counter
- repeat 15 times
- go to any card of this background
- end repeat
- get the short name of this card
- put first word of it into thePart
- if the visible of bkgnd button thePart is false then
- show bkgnd button thePart at 215,269
- add 1 to partsVisible
- else
- put "Roll Again" into bkgnd field 1
- show bkgnd field 1
- wait 1 seconds
- hide bkgnd field 1
- end if
- end mouseUp
-
- ** BKGND #1, BUTTON #2: What Do I Do Now? ************************************
- on mouseUp
- push card
- visual iris open
- go to card "potatoHelp"
- end mouseUp
-
- ** BKGND #1, BUTTON #3: Go Home ************************************
- on mouseUp
- visual dissolve to black
- visual dissolve to white
- doMenu "Home"
- end mouseUp
-
- ** BKGND #1, BUTTON #10: newGame ************************************
- on mouseUp
- hide bkgnd field "youWin!"
- newGame
- end mouseUp
-
- ** BKGND #1, BUTTON #11 ************************************
- on mouseUp
- show bkgnd button "mouth"
- show bkgnd button "nose"
- show bkgnd button "leftEye"
- show bkgnd button "leftEar"
- show bkgnd button "rightEye"
- show bkgnd button "rightEar"
- end mouseUp
-
- ** BKGND #1, BUTTON #12 ************************************
- on mouseDown
- put empty into bkgnd field 2
- show bkgnd field 2
- put "Bill Robertson" into line 1 of bkgnd field 2
- put "microPRINT" into line 2 of bkgnd field 2
- put "214 Third Avenue" into line 3 of bkgnd field 2
- put "Waltham, MA 02154" into line 4 of bkgnd field 2
- put "GEnie:BILLR" into line 6 of bkgnd field 2
- wait 2 seconds
- end mouseDown
-
- on mouseUp
- hide bkgnd field 2
- end mouseUp
-
- ** CARD #13, FIELD #1 ************************************
- on mouseUp
- hide card button "Got It!"
- hide card field 1
- visual dissolve to black
- go to this card
- show card field 2
- end mouseUp
- ** CARD #13, FIELD #2: ************************************
- on mouseUp
- hide card field 2
- visual dissolve to black
- go to this card
- show card field 3
- show card button 2
- end mouseUp
-
- ** CARD #13, FIELD #3: ************************************
- on openField
- show card button 1
- end openField
-
- on mouseUp
- hide card button 2
- hide card field 3
- visual dissolve to black
- go to this card
- show card field 1
- show card button "Got It!"
- end mouseUp
-
-
-
- ** CARD #13, BUTTON #1: Got it! ************************************
- on mouseUp
- visual iris close
- pop card
- end mouseUp
-
- ** CARD #13, BUTTON #2: Look at my script ************************************
- on mouseUp
- choose button tool
- doMenu "New Button"
- set hilite of card button "New Button" to true
- set textAlign of card button "new Button" to left
- set textAlign of card button "new Button" to right
- set textAlign of card button "new Button" to left
- set textAlign of card button "new Button" to right
- set textSize of card button "new Button" to 9
- set textAlign of card button "new Button" to left
- set textAlign of card button "new Button" to right
- set textAlign of card button "new Button" to left
- set textAlign of card button "new Button" to right
- wait 1 seconds
- click at the loc of card button "New Button"
- doMenu "Clear Button"
- choose browse tool
- end mouseUp
-
-