home *** CD-ROM | disk | FTP | other *** search
- on startMovie
- global gBounceRect, Inertia, gravity, gDeltaShowLoc, gDeltaViewSprite
- set gDeltaViewSprite to 7
- set gDeltaShowLoc to [the locH of sprite gDeltaViewSprite, the locV of sprite gDeltaViewSprite]
- set Inertia to 1.0956999999999999
- set gravity to 8.69079999999999941
- set gBounceRect to [the stageLeft, the stageRight, the stageTop, the stageBottom]
- end
-
- on runGame
- global gDeltaShowLoc, gDeltaViewSprite
- setPuppet()
- set gameSP to 4
- set howMany to 18
- set baseCast to 1
- set speed to 1
- set counter to 0
- set Shipdelta to [0, 0]
- repeat while not (the mouseDown)
- set when to the ticks + speed
- set the castNum of sprite gameSP to baseCast + (counter mod howMany)
- set Shipdelta to move(gameSP, Shipdelta)
- Update(when)
- set counter to counter + 1
- showDelta(Shipdelta, gDeltaViewSprite)
- end repeat
- set the castNum of sprite gameSP to baseCast
- updateStage()
- go("Pause")
- end
-
- on unPuppet
- repeat with x = 1 to 48
- puppetSprite(x, 0)
- end repeat
- end
-
- on setPuppet
- repeat with x = 1 to 48
- puppetSprite(x, 1)
- end repeat
- end
-
- on Update when
- repeat while the ticks < when
- end repeat
- updateStage()
- end
-
- on showDelta delta, gDeltaViewSprite
- global gDeltaShowLoc
- set the locH of sprite gDeltaViewSprite to getAt(gDeltaShowLoc, 1) + (getAt(delta, 1) / 5)
- set the locV of sprite gDeltaViewSprite to getAt(gDeltaShowLoc, 2) + (getAt(delta, 2) / 5)
- end
-
- on move whichChan, delta
- global Inertia, gravity
- set deltaH to (the mouseH - the locH of sprite whichChan) / gravity
- set deltaV to (the mouseV - the locV of sprite whichChan) / gravity
- set newvector to [(getAt(delta, 1) + deltaH) / Inertia, (getAt(delta, 2) + deltaV) / Inertia]
- set the locH of sprite whichChan to the locH of sprite whichChan + getAt(newvector, 1)
- set the locV of sprite whichChan to the locV of sprite whichChan + getAt(newvector, 2)
- return newvector
- end
-
- on setVarPos
- global gravity, Inertia
- set topPos to 99
- set the locH of sprite 4 to 134
- set the locV of sprite 4 to topPos + (181 - ((gravity - 1) / 0.08839999999999999))
- set the locH of sprite 5 to 286
- set the locV of sprite 5 to topPos + (181 - ((Inertia - 1.0) / 0.0011))
- end
-
- on GetInertiaFromPos
- global Inertia
- set lowPos to 181 + 99
- set pos to the locV of sprite 5
- set value to lowPos - pos
- set Inertia to 1.0 + (value * 0.0011)
- end
-
- on GetGravityFromPos
- global gravity
- set lowPos to 181 + 99
- set pos to the locV of sprite 4
- set value to lowPos - pos
- set gravity to (value * 0.08839999999999999) + 1
- end
-