home *** CD-ROM | disk | FTP | other *** search
/ GQ - Louise, World Cup, …remy Clarkson, Armageddon / GQCD.iso / files / game.dxr / 00001.ls next >
Encoding:
Text File  |  1998-05-21  |  2.7 KB  |  95 lines

  1. global gShipObj, gGameObj, gGUIobj, CURSORSTART, asteroidList, weaponList, asteroidDataList, gInTestMode
  2.  
  3. on startMovie
  4.   set the volume of sound 1 to 127
  5.   set the volume of sound 2 to 127
  6.   set gInTestMode to 0
  7.   set CURSORSTART to the memberNum of member "myCursor"
  8.   set the actorList to []
  9.   set asteroidList to []
  10.   set weaponList to assembleWeapons()
  11.   set asteroidDataList to assembleAsteroids()
  12.   if gInTestMode then
  13.     set myTime to 0.20000000000000001
  14.   else
  15.     set myTime to 5
  16.   end if
  17.   set gGameObj to new(script "gameScript")
  18.   init(gGameObj, 43, myTime, 50)
  19.   set gShipObj to new(script "shipScript", 45.0, 190.0)
  20.   setSpriteNUm(gShipObj, 30)
  21.   setUpPanelObj()
  22.   puppetSprite(33, 1)
  23. end
  24.  
  25. on setUpPanelObj
  26.   set myList to [31, 32, 34, 35, 36, 37, 38, 39, 40, 41]
  27.   repeat with i = 1 to count(myList)
  28.     puppetSprite(getAt(myList, i), 1)
  29.   end repeat
  30.   set gGUIobj to new(script "GUIpanelScript", 31, 32, 34, 35, 36, 37, 38, 39, 40, 41)
  31. end
  32.  
  33. on assembleWeapons
  34.   set laserx1 to ["laserx1", 0.60000000000000009, 1, 1, "pulseX1"]
  35.   set laserx2 to ["laserx2", 0.60000000000000009, 2, 400, "pulseX2"]
  36.   set rocketx1 to ["rocketx1", 0.70000000000000007, 10, 60, "srocketX1"]
  37.   set rocketx2 to ["rocketx2", 0.70000000000000007, 20, 30, "srocketX2"]
  38.   if gInTestMode then
  39.     set nuclear to ["nuclear", 0.80000000000000004, 400, 3, "nuke"]
  40.   else
  41.     set nuclear to ["nuclear", 0.80000000000000004, 400, 0, "nuke"]
  42.   end if
  43.   return [laserx1, laserx2, rocketx1, rocketx2, nuclear]
  44. end
  45.  
  46. on assembleAsteroids
  47.   set memberList to ["tinyRock", "smallRock", "mediumRock", "largeRock", "megaRock"]
  48.   set speedList to [4.0, 3.5, 3.0, 2.0, 1.40000000000000013]
  49.   set energyList to [1, 4, 20, 40, 400]
  50.   set soundList to ["tEX", "sEX", "mEX", "lEX", "NuclearBlast"]
  51.   return [memberList, speedList, energyList, soundList]
  52. end
  53.  
  54. on getLoc myDegrees, myDistance
  55.   set myRadians to getRadians(myDegrees)
  56.   set myX to sin(myRadians) * myDistance
  57.   set myY to 480 - (cos(myRadians) * myDistance)
  58.   return point(myX, myY)
  59. end
  60.  
  61. on getRadians degrees
  62.   return degrees / 360.0 * (2 * PI)
  63. end
  64.  
  65. on getDegrees radians
  66.   return radians / (2 * PI) * 360.0
  67. end
  68.  
  69. on getIndex list, iPos, jPos
  70.   return getAt(getAt(list, iPos), jPos)
  71. end
  72.  
  73. on SetIndex list, iPos, jPos, myValue
  74.   setAt(getAt(list, iPos), jPos, myValue)
  75. end
  76.  
  77. on getName whichSprite
  78.   set myName to the name of the member of sprite whichSprite
  79.   return chars(myName, 1, the length of myName - 5)
  80. end
  81.  
  82. on getID whichSprite
  83.   set myName to the name of the member of sprite whichSprite
  84.   return chars(myName, the length of myName - 4, the length of myName - 4)
  85. end
  86.  
  87. on playSound whichChannel, whichSound
  88.   puppetSound(whichChannel, 0)
  89.   puppetSound(whichChannel, whichSound)
  90. end
  91.  
  92. on stopMovie
  93.   set the actorList to []
  94. end
  95.