home *** CD-ROM | disk | FTP | other *** search
- global gShipObj, gGameObj, gGUIobj, CURSORSTART, asteroidList, weaponList, asteroidDataList, gInTestMode
-
- on startMovie
- set the volume of sound 1 to 127
- set the volume of sound 2 to 127
- set gInTestMode to 0
- set CURSORSTART to the memberNum of member "myCursor"
- set the actorList to []
- set asteroidList to []
- set weaponList to assembleWeapons()
- set asteroidDataList to assembleAsteroids()
- if gInTestMode then
- set myTime to 0.20000000000000001
- else
- set myTime to 5
- end if
- set gGameObj to new(script "gameScript")
- init(gGameObj, 43, myTime, 50)
- set gShipObj to new(script "shipScript", 45.0, 190.0)
- setSpriteNUm(gShipObj, 30)
- setUpPanelObj()
- puppetSprite(33, 1)
- end
-
- on setUpPanelObj
- set myList to [31, 32, 34, 35, 36, 37, 38, 39, 40, 41]
- repeat with i = 1 to count(myList)
- puppetSprite(getAt(myList, i), 1)
- end repeat
- set gGUIobj to new(script "GUIpanelScript", 31, 32, 34, 35, 36, 37, 38, 39, 40, 41)
- end
-
- on assembleWeapons
- set laserx1 to ["laserx1", 0.60000000000000009, 1, 1, "pulseX1"]
- set laserx2 to ["laserx2", 0.60000000000000009, 2, 400, "pulseX2"]
- set rocketx1 to ["rocketx1", 0.70000000000000007, 10, 60, "srocketX1"]
- set rocketx2 to ["rocketx2", 0.70000000000000007, 20, 30, "srocketX2"]
- if gInTestMode then
- set nuclear to ["nuclear", 0.80000000000000004, 400, 3, "nuke"]
- else
- set nuclear to ["nuclear", 0.80000000000000004, 400, 0, "nuke"]
- end if
- return [laserx1, laserx2, rocketx1, rocketx2, nuclear]
- end
-
- on assembleAsteroids
- set memberList to ["tinyRock", "smallRock", "mediumRock", "largeRock", "megaRock"]
- set speedList to [4.0, 3.5, 3.0, 2.0, 1.40000000000000013]
- set energyList to [1, 4, 20, 40, 400]
- set soundList to ["tEX", "sEX", "mEX", "lEX", "NuclearBlast"]
- return [memberList, speedList, energyList, soundList]
- end
-
- on getLoc myDegrees, myDistance
- set myRadians to getRadians(myDegrees)
- set myX to sin(myRadians) * myDistance
- set myY to 480 - (cos(myRadians) * myDistance)
- return point(myX, myY)
- end
-
- on getRadians degrees
- return degrees / 360.0 * (2 * PI)
- end
-
- on getDegrees radians
- return radians / (2 * PI) * 360.0
- end
-
- on getIndex list, iPos, jPos
- return getAt(getAt(list, iPos), jPos)
- end
-
- on SetIndex list, iPos, jPos, myValue
- setAt(getAt(list, iPos), jPos, myValue)
- end
-
- on getName whichSprite
- set myName to the name of the member of sprite whichSprite
- return chars(myName, 1, the length of myName - 5)
- end
-
- on getID whichSprite
- set myName to the name of the member of sprite whichSprite
- return chars(myName, the length of myName - 4, the length of myName - 4)
- end
-
- on playSound whichChannel, whichSound
- puppetSound(whichChannel, 0)
- puppetSound(whichChannel, whichSound)
- end
-
- on stopMovie
- set the actorList to []
- end
-