home *** CD-ROM | disk | FTP | other *** search
- on makeToadStoolField
- global gDifficultyLevel, gGameSol, gNodeMap, gMasterMoves, gNumberOfMovesLeft, gFrogList, gGameState, gFrogNode
- gNodeMap = field("nodes")
- if gDifficultyLevel = 1 then
- baseColour = random(6)
- end if
- gMasterMoves = "24,21,25,22,26,23,27,29,30,31,32,36,33,37,34,38,35,39"
- myChoices = the number of items in gGameState
- whichItem = random(myChoices)
- whichPath = value(item whichItem of gGameState)
- if myChoices > 1 then
- delete item whichItem of gGameState
- else
- repeat with i = 1 to the number of lines in field "mazePaths"
- put i into item i of gGameState
- end repeat
- end if
- gGameSol = line whichPath of field "mazePaths"
- FrogColour = value(item gNumberOfMovesLeft of gFrogList)
- sprite(41).member = string(FrogColour) & "_frog_04.01"
- sprite(50 + gNumberOfMovesLeft).locH = -200
- puppetSound("splash")
- case gDifficultyLevel of
- 1:
- topColour = FrogColour
- baseColour = random(6)
- repeat while topColour = baseColour
- baseColour = random(6)
- end repeat
- pathLength = the number of items in gGameSol
- prevColour = FrogColour
- repeat with i = 1 to pathLength
- baseColour = random(6)
- repeat while (baseColour = topColour) or (baseColour = prevColour)
- baseColour = random(6)
- end repeat
- prevColour = baseColour
- newStool = string(baseColour) & string(topColour) & "_stool"
- whichSprite = value(item value(item i of gGameSol) of gMasterMoves)
- sprite(whichSprite).myNextName = newStool
- end repeat
- theColour = topColour
- 2:
- theColour = FrogColour
- pathLength = the number of items in gGameSol
- prevColour = FrogColour
- repeat with i = 1 to pathLength
- if random(20) > 5 then
- topColour = FrogColour
- baseColour = random(6)
- repeat while (baseColour = topColour) or (baseColour = prevColour)
- baseColour = random(6)
- end repeat
- prevColour = baseColour
- else
- baseColour = FrogColour
- topColour = random(6)
- repeat while (baseColour = topColour) or (topColour = prevColour)
- topColour = random(6)
- end repeat
- prevColour = topColour
- end if
- newStool = string(baseColour) & string(topColour) & "_stool"
- whichSprite = value(item value(item i of gGameSol) of gMasterMoves)
- sprite(whichSprite).myNextName = newStool
- end repeat
- AllSpots = 1
- repeat with i = 1 to pathLength
- whichSprite = value(item value(item i of gGameSol) of gMasterMoves)
- spotColour = char 2 of the myNextName of sprite(whichSprite)
- if spotColour <> FrogColour then
- AllSpots = 0
- exit repeat
- end if
- end repeat
- if AllSpots then
- repeat with i = 1 to 2
- whichStool = random(pathLength)
- targetSprite = value(item value(item whichStool of gGameSol) of gMasterMoves)
- newStool = sprite(targetSprite).myNextName
- TEMP = char 2 of newStool
- put char 1 of newStool into char 2 of newStool
- put TEMP into char 1 of newStool
- sprite(targetSprite).myNextName = newStool
- end repeat
- end if
- AllBases = 1
- repeat with i = 1 to pathLength
- whichSprite = value(item value(item i of gGameSol) of gMasterMoves)
- baseColour = char 1 of the myNextName of sprite(whichSprite)
- if baseColour <> FrogColour then
- AllBases = 0
- exit repeat
- end if
- end repeat
- if AllBases then
- repeat with i = 1 to 2
- whichStool = random(pathLength)
- targetSprite = value(item value(item whichStool of gGameSol) of gMasterMoves)
- newStool = sprite(targetSprite).myNextName
- TEMP = char 2 of newStool
- put char 1 of newStool into char 2 of newStool
- put TEMP into char 1 of newStool
- sprite(targetSprite).myNextName = newStool
- end repeat
- end if
- 3:
- pathLength = the number of items in gGameSol
- firstToadStoolSprite = value(item value(item 1 of gGameSol) of gMasterMoves)
- FirstStool = char 1 to 2 of the name of the member of sprite(firstToadStoolSprite)
- if not (FirstStool contains string(FrogColour)) then
- if random(10) > 5 then
- put string(FrogColour) into char 1 of FirstStool
- else
- put string(FrogColour) into char 2 of FirstStool
- end if
- sprite(firstToadStoolSprite).myNextName = FirstStool & "_stool"
- end if
- repeat with i = 2 to pathLength
- thePrevSprite = value(item value(item i - 1 of gGameSol) of gMasterMoves)
- if random(10) > 5 then
- theCommonColour = char 1 of the myNextName of sprite(thePrevSprite)
- theotherColour = char 2 of the myNextName of sprite(thePrevSprite)
- else
- theCommonColour = char 2 of the myNextName of sprite(thePrevSprite)
- theotherColour = char 1 of the myNextName of sprite(thePrevSprite)
- end if
- if random(10) > 5 then
- topColour = theCommonColour
- baseColour = random(6)
- repeat while (baseColour = topColour) or (baseColour = theotherColour)
- baseColour = random(6)
- end repeat
- else
- baseColour = theCommonColour
- topColour = random(6)
- repeat while (baseColour = topColour) or (topColour = theotherColour)
- topColour = random(6)
- end repeat
- end if
- newStool = string(baseColour) & string(topColour) & "_stool"
- whichSprite = value(item value(item i of gGameSol) of gMasterMoves)
- sprite(whichSprite).myNextName = newStool
- end repeat
- end case
- repeat with i = 21 to 38
- if not (i = 28) then
- notOnthePath = 1
- repeat with j = 1 to the number of items in gGameSol
- if string(i) = item value(item j of gGameSol) of gMasterMoves then
- notOnthePath = 0
- exit repeat
- end if
- end repeat
- if notOnthePath then
- oddTColour = random(6)
- repeat while oddTColour = theColour
- oddTColour = random(6)
- end repeat
- oddBColour = random(6)
- repeat while (oddBColour = theColour) or (oddBColour = oddTColour)
- oddBColour = random(6)
- end repeat
- newStool = string(oddBColour) & string(oddTColour) & "_stool"
- sprite(i).myNextName = newStool
- updateStage()
- end if
- end if
- end repeat
- startNodeList = "1,8,11"
- startNode = item 1 of gGameSol
- repeat with i = 1 to 3
- if item i of startNodeList <> startNode then
- whichNodeSprite = value(item value(item i of startNodeList) of gMasterMoves)
- theStoolColours = char 1 to 2 of the myNextName of sprite(whichNodeSprite)
- if theStoolColours contains string(FrogColour) then
- choices = "123456"
- delete char FrogColour of choices
- whichBase = random(5)
- baseColour = char whichBase of choices
- delete char whichBase of choices
- topColour = char random(4) of choices
- sprite(whichNodeSprite).myNextName = baseColour & topColour & "_stool"
- end if
- end if
- end repeat
- gFrogNode = 0
- repeat with i = 20 to 40
- set the cursor of sprite i to 0
- end repeat
- if the frame < label("glinda_demo") then
- set the cursor of sprite 24 to 280
- set the cursor of sprite 29 to 280
- set the cursor of sprite 32 to 280
- end if
- sprite(41).startH = sprite(28).locH - 85
- sprite(41).startV = sprite(28).locV - 5
- sprite(41).finH = sprite(28).locH - 8
- sprite(41).finV = sprite(41).startV - 15
- sprite(41).stepNo = 1
- end
-
- on changeFrog
- global gFrogNode, gGameSol, gMasterMoves, gFrameCounter
- if gFrogNode = 0 then
- whichSprite = value(item value(item 1 of gGameSol) of gMasterMoves)
- colourSet = char 1 to 2 of the myNextName of sprite(whichSprite)
- else
- whichSprite = value(item gFrogNode of gMasterMoves)
- colourSet = char 1 to 2 of the name of the member of sprite(whichSprite)
- end if
- FrogColour = char 1 of the name of the member of sprite(41)
- if FrogColour = char 1 of colourSet then
- FrogColour = char 2 of colourSet
- else
- FrogColour = char 1 of colourSet
- end if
- theFrog = sprite(41).member.name
- put FrogColour into char 1 of theFrog
- sprite(41).member = theFrog
- gFrameCounter = 0
- end
-
- on CheckFrog
- global gFrameCounter, gDifficultyLevel, gFrogNode
- if gFrogNode > 0 then
- if (gDifficultyLevel = 3) and (gFrameCounter > 80) then
- changeFrog()
- end if
- end if
- end
-