home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 2008-09-11 | 131.1 KB | 3,482 lines
package Aether_fla { import adobe.utils.*; import flash.accessibility.*; import flash.display.*; import flash.errors.*; import flash.events.*; import flash.external.*; import flash.filters.*; import flash.geom.*; import flash.media.*; import flash.net.*; import flash.printing.*; import flash.system.*; import flash.text.*; import flash.ui.*; import flash.utils.*; import flash.xml.*; public dynamic class MainTimeline extends MovieClip { public var durrr:int; public var floating:Boolean; public var starsC:MovieClip; public var planet1mass:*; public var back2:MovieClip; public var gemed:Boolean; public var currentCloud:MovieClip; public var strength:Number; public var bg:MovieClip; public var speed:Vector; public var center:Vector; public var cc:int; public var stars:Array; public var bn:Number; public var SFX:Array; public var paus:Boolean; public var i:int; public var j:int; public var cn:Number; public var pos2:Vector; public var n:*; public var currentPlanet:*; public var f:int; public var speedFactor:Number; public var grounded:Boolean; public var kRight:Boolean; public var k:int; public var kUp:Boolean; public var abs:*; public var sfx:SoundChannel; public var dir:Dir; public var won:Array; public var momentum:Number; public var beatgame:Boolean; public var framey:String; public var area:*; public var srange:Number; public var flasher:Flasher; public var talk:Talk; public var ff:int; public var background5:Background5; public var speedC:Vector; public var clouds:Array; public var gg:int; public var explode:Boolean; public var back:MovieClip; public var density:*; public var speedP:Number; public var loadPerc:Number; public var i8:int; public var crazies:Array; public var fished:int; public var rope:MovieClip; public var GR:Vector; public var effects:MovieClip; public var j8:int; public var sdensity:*; public var pollupy:Number; public var sqrt:*; public var kA:Boolean; public var kD:Boolean; public var range:Number; public var kM:Boolean; public var kS:Boolean; public var kW:Boolean; public var btn1:SimpleButton; public var btn3:SimpleButton; public var mc2:MovieClip; public var mc3:MovieClip; public var splashes:Array; public var earths:Array; public var bubbles:Array; public var planet1r2:*; public var gemSounds:Array; public var fader:Number; public var transformSFX:SoundTransform; public var n2:*; public var bmp:Bitmap; public var n8:int; public var mc:MovieClip; public var planet:MovieClip; public var planet2:MovieClip; public var linkAG:SimpleButton; public var mp:int; public var fadery:MovieClip; public var planet1mass2:*; public var mus2:T2; public var mus3:T3; public var mus4:T4; public var mus5:T5; public var mus1:T1; public var box:MovieClip; public var musB:TB; public var planets:Array; public var talph:Number; public var planet1r:*; public var ttt:int; public var timerGGG:int; public var shrink:Boolean; public var namesT:int; public var len:Number; public var brange:Number; public var linkED:SimpleButton; public var anchored:Boolean; public var wholegame:MovieClip; public var Gravity:Vector; public var str:Number; public var transform1:SoundTransform; public var transform2:SoundTransform; public var transform4:SoundTransform; public var cut:MovieClip; public var transform5:SoundTransform; public var bdensity:*; public var transformB:SoundTransform; public var fish:Array; public var sn:Number; public var stag:BitmapData; public var grav:Vector; public var linkGG:SimpleButton; public var pos:Vector; public var arr:Array; public var transform3:SoundTransform; public var transformW:SoundTransform; public var aliens:Array; public var linkAG2:SimpleButton; public var particles:Array; public var controls:int; public var ended:Boolean; public var bobber:Bobber; public var base:BitmapData; public var elastic:Number; public var gassed:int; public var pauzz:Paus; public var mass:Number; public var friction:Number; public var kLeft:Boolean; public var rspeed:Number; public var latching:Boolean; public var timeE:int; public var faderTIM:int; public var log:logo; public var names:Names; public var hi1:Number; public var hi2:Number; public var kSpace:Boolean; public var mooned:int; public var Vecg:Vector; public var Vec:Vector; public var Vecp:Vector; public var sarea:*; public var ggg:*; public var channel2:SoundChannel; public var channel4:SoundChannel; public var channel1:SoundChannel; public var channel3:SoundChannel; public var channel5:SoundChannel; public var wi1:Number; public var wi2:Number; public var foregrounds:Array; public var gemCounter:int; public var charH:Number; public var channelW:SoundChannel; public var channelB:SoundChannel; public var loadBX:TextField; public var bubblesC:MovieClip; public var kDown:Boolean; public var cam:Cam; public var container1:MovieClip; public var container2:MovieClip; public var container3:MovieClip; public var container4:MovieClip; public var win1:Win1; public var win2:Win2; public var win3:Win3; public var win4:Win4; public var barea:*; public var inside:Boolean; public function MainTimeline() { super(); addFrameScript(0,frame1,2,frame3,3,frame4,4,frame5,5,frame6,6,frame7,7,frame8,8,frame9); } public function backBTN(param1:Event) : * { framey = "game"; fadery.play(); } public function ag_btnclick2(param1:MouseEvent) : * { navigateToURL(new URLRequest("http://www.armorgames.com"),"_blank"); } public function ed_btnclick(param1:MouseEvent) : * { navigateToURL(new URLRequest("http://www.thisisacryforhelp.com"),"_blank"); } public function goBTN(param1:Event) : * { cut.play(); } public function updo() : * { gotoAndStop(framey); } internal function frame5() : * { stop(); btn1.addEventListener(MouseEvent.CLICK,backBTN,false,0,true); } internal function frame9() : * { stop(); btn1.addEventListener(MouseEvent.CLICK,backBTN2,false,0,true); } internal function frame6() : * { stop(); framey = "inst"; btn1.addEventListener(MouseEvent.CLICK,goBTN,false,0,true); } internal function frame1() : * { linkAG.addEventListener(MouseEvent.CLICK,ag_btnclick,false,0,true); linkGG.addEventListener(MouseEvent.CLICK,gg_btnclick,false,0,true); linkED.addEventListener(MouseEvent.CLICK,ed_btnclick,false,0,true); stop(); base = new BitmapData(100,100,true,0); stag = new BitmapData(stage.stageWidth,stage.stageHeight,true,2434861); bmp = new Bitmap(stag); box.addChild(bmp); log = new logo(); base.draw(log); abs = Math.abs; sqrt = Math.sqrt; arr = new Array(); loadPerc = new Number(0); shrink = false; wi1 = (stage.stageWidth - 400) / 2; hi1 = (stage.stageHeight - 400) / 2; wi2 = (stage.stageWidth - 200) / 2; hi2 = (stage.stageHeight - 200) / 2; timerGGG = 30; i8 = 0; while(i8 < 100) { j8 = 0; while(j8 < 100) { arr.push(new Array(0,0,0,0,0)); n8 = arr.length - 1; arr[n8][0] = base.getPixel32(i8,j8); arr[n8][1] = new Number(i8 * 4 + wi1); arr[n8][2] = new Number(j8 * 4 + hi1); arr[n8][3] = Math.random() * 700; arr[n8][4] = Math.random() * 700; arr[n8][5] = Math.random() * 10 - 5; arr[n8][6] = Math.random() * 10 - 5; arr[n8][7] = i8; arr[n8][8] = j8; ++j8; } ++i8; } explode = false; loaderInfo.addEventListener(ProgressEvent.PROGRESS,calculatepcent,false,0,true); addEventListener(Event.ENTER_FRAME,update2,false,0,true); stage.addEventListener(MouseEvent.MOUSE_DOWN,expl,false,0,true); stage.addEventListener(MouseEvent.MOUSE_UP,uexpl,false,0,true); stage.showDefaultContextMenu = false; stage.quality = "MEDIUM"; framey = "title"; try { MochiBot.track(this,"c0587ff8"); } catch(e:Error) { } } public function advance() : * { framey = "title"; fadery.play(); } public function update2(param1:Event) : * { var _loc2_:Boolean = false; var _loc3_:int = 0; var _loc4_:Number = NaN; if(loadPerc >= 1) { loadPerc = 1; shrink = true; } loadBX.text = String(Math.round(loadPerc * 100)) + "% Loaded"; log.gotoAndStop(Math.floor(loadPerc * 100) + 1); base.draw(log); _loc2_ = false; if(shrink == true) { if(abs(mouseX - stage.stageWidth / 2) <= 50 && abs(mouseY - stage.stageHeight / 2) < 50) { _loc2_ = true; } } stag.colorTransform(new Rectangle(0,0,stage.stageWidth,stage.stageHeight),new ColorTransform(1,1,1,0.9,0,0,0,0)); if(timerGGG > 0) { _loc3_ = 0; while(_loc3_ < arr.length) { if(timerGGG <= 0) { arr[_loc3_][0] = 0; } else { arr[_loc3_][0] = base.getPixel32(arr[_loc3_][7],arr[_loc3_][8]); } if(!shrink) { arr[_loc3_][5] += (arr[_loc3_][1] - arr[_loc3_][3]) / 50; arr[_loc3_][6] += (arr[_loc3_][2] - arr[_loc3_][4]) / 50; _loc4_ = sqrt((arr[_loc3_][3] - mouseX) * (arr[_loc3_][3] - mouseX) + (arr[_loc3_][4] - mouseY) * (arr[_loc3_][4] - mouseY)); if(explode) { arr[_loc3_][5] += 450 * (arr[_loc3_][3] - mouseX) / (_loc4_ * _loc4_ + 30); arr[_loc3_][6] += 450 * (arr[_loc3_][4] - mouseY) / (_loc4_ * _loc4_ + 30); } else { arr[_loc3_][5] += 90 * (arr[_loc3_][3] - mouseX) / (_loc4_ * _loc4_ + 30); arr[_loc3_][6] += 90 * (arr[_loc3_][4] - mouseY) / (_loc4_ * _loc4_ + 30); } } else { arr[_loc3_][3] += ((arr[_loc3_][1] - wi1) / 2 + wi2 - arr[_loc3_][3]) / 5; arr[_loc3_][4] += ((arr[_loc3_][2] - hi1) / 2 + hi2 - arr[_loc3_][4]) / 5; arr[_loc3_][5] = 0; arr[_loc3_][6] = 0; } arr[_loc3_][5] *= 0.95; arr[_loc3_][6] *= 0.95; if(arr[_loc3_][5] > 50) { arr[_loc3_][5] = 50; } if(arr[_loc3_][5] < -50) { arr[_loc3_][5] = -50; } if(arr[_loc3_][6] > 50) { arr[_loc3_][6] = 50; } if(arr[_loc3_][6] < -50) { arr[_loc3_][6] = -50; } arr[_loc3_][3] += arr[_loc3_][5]; arr[_loc3_][4] += arr[_loc3_][6]; stag.fillRect(new Rectangle(arr[_loc3_][3],arr[_loc3_][4],2,2),arr[_loc3_][0]); _loc3_++; } } bmp.bitmapData = stag; if(shrink == true) { --timerGGG; if(timerGGG == 0) { box.addChild(log); log.scaleX = 2; log.scaleY = 2; log.x = wi2; log.y = hi2; } if(timerGGG <= 0) { if(abs(mouseX - stage.stageWidth / 2) <= 100 && abs(mouseY - stage.stageHeight / 2) < 100) { log.gotoAndStop(101); } else { log.gotoAndStop(100); } if(explode && abs(mouseX - stage.stageWidth / 2) <= 100 && abs(mouseY - stage.stageHeight / 2) < 100) { framey = "logos"; fadery.play(); loaderInfo.removeEventListener(ProgressEvent.PROGRESS,calculatepcent); removeEventListener(Event.ENTER_FRAME,update2); stage.removeEventListener(MouseEvent.MOUSE_DOWN,expl); stage.removeEventListener(MouseEvent.MOUSE_UP,uexpl); } } explode = false; } } internal function frame7() : * { stop(); paus = false; pauzz = new Paus(); clouds = new Array(); crazies = new Array(); back = new MovieClip(); back2 = new MovieClip(); mc = new MovieClip(); mc2 = new MovieClip(); mc3 = new MovieClip(); starsC = new MovieClip(); container1 = new MovieClip(); mc.addChild(back2); mc.addChild(starsC); mc.addChild(back); container2 = new MovieClip(); container3 = new MovieClip(); container4 = new MovieClip(); bg = new BG(); bubblesC = new MovieClip(); effects = new MovieClip(); bubbles = new Array(); aliens = new Array(); ttt = 0; Gravity = new Vector(0,0); mc.addChild(bg); wholegame.addChild(mc3); names = new Names(); wholegame.addChild(names); wholegame.addChild(pauzz); pauzz.visible = false; names.gotoAndStop(2); names.alpha = 0; timeE = 90; namesT = 0; mc3.addChild(mc2); mc2.addChild(mc); mc.addChild(container1); mc.addChild(container2); mc.addChild(container3); mc.addChild(container4); fader = 1; faderTIM = 0; dir = new Dir(); dir.alpha = 0; dir.d1.gotoAndStop(1); dir.d2.gotoAndStop(2); dir.d3.gotoAndStop(3); dir.d4.gotoAndStop(4); dir.d5.gotoAndStop(5); ended = false; durrr = 300; dir.visible = false; container4.addChild(dir); range = 1900; srange = 1300; cam = new Cam(700,700,mc); cam.x = range / 2; cam.y = range / 2; speedC = new Vector(0,4); density = 1 / 90000; area = range * range; cn = density * area; sdensity = 1 / 16000; sarea = srange * srange; sn = sdensity * sarea; brange = 2800; bdensity = 1 / 5000000; barea = brange * brange; bn = bdensity * barea; momentum = 0; mass = 20; friction = 1; strength = 1; speed = new Vector(0,0); pos = new Vector(0,0); len = 180; pos2 = new Vector(0,0); rope = new MovieClip(); bobber = new Bobber(); center = new Vector(0,500); anchored = false; rspeed = 0; speedFactor = 0.5; controls = 1; inside = false; currentCloud = null; elastic = 10; speedP = 0; charH = 30; stars = new Array(); fish = new Array(); splashes = new Array(); floating = false; pollupy = 0; fished = 0; won = new Array(false,false,false,false); particles = new Array(); f = 0; while(f < 10) { fish.push(new Array(new Fish(),new Vector(3,0),3,1)); fished += 1; ++f; } ff = 0; while(ff < 30) { fish.push(new Array(new Fish2(),new Vector(1,0),3,2)); ++ff; } k = 0; while(k < fish.length) { bubblesC.addChild(fish[k][0]); fish[k][0].x = 4000 + Math.random() * 500 - 250; fish[k][0].y = 29000 + Math.random() * 500 - 250; ++k; } background5 = new Background5(); container1.addChild(background5); planets = new Array(); planets.push(new Array(new Planet1(),8000000,0)); planets.push(new Array(new Planet2(),8000000,0,0)); planets.push(new Array(new Planet3(),8000000,0,0)); planets.push(new Array(new Planet4(),8000000,0,0)); planets.push(new Array(new Planet5(),8000000,0)); planets.push(new Array(new Moon(),0,138 / 2,new Vector(0,0),1)); planets.push(new Array(new Moon(),0,138 / 2,new Vector(0,0),1)); planets.push(new Array(new Moon(),0,138 / 2,new Vector(0,0),1)); planets.push(new Array(new Moon(),0,138 / 2,new Vector(0,0),1)); container1.addChild(planets[5][0]); container1.addChild(planets[6][0]); container1.addChild(planets[7][0]); container1.addChild(planets[8][0]); container1.addChild(planets[0][0]); container1.addChild(planets[1][0]); container1.addChild(planets[2][0]); container1.addChild(planets[3][0]); container1.addChild(planets[4][0]); foregrounds = new Array(); foregrounds.push(new Foreground2()); foregrounds.push(new Foreground3()); foregrounds.push(new Foreground4()); container3.addChild(foregrounds[0]); container3.addChild(foregrounds[1]); container3.addChild(foregrounds[2]); planets[0][0].x = 0; planets[0][0].y = 1000; planets[1][0].x = 0; planets[1][0].y = -20000; foregrounds[0].x = 0; foregrounds[0].y = -20000; planets[2][0].x = 25000; planets[2][0].y = 3000; foregrounds[1].x = 25000; foregrounds[1].y = 3000; foregrounds[1].planet.visible = false; planets[3][0].x = 4000; planets[3][0].y = 29000; foregrounds[2].x = 4000; foregrounds[2].y = 29000; planets[4][0].x = -30000; planets[4][0].y = -10000; background5.x = -30000; background5.y = -10000; planets[5][0].x = -30000; planets[5][0].y = -11000; planets[6][0].x = -31000; planets[6][0].y = -10300; planets[7][0].x = -29100; planets[7][0].y = -10100; planets[8][0].x = -29800; planets[8][0].y = -8700; planets[5][0].gotoAndStop(1); planets[6][0].gotoAndStop(2); planets[7][0].gotoAndStop(3); planets[8][0].gotoAndStop(4); planets.push(new Array(new Island(),0,157 / 2)); container1.addChild(planets[9][0]); planets[9][0].x = 4000; planets[9][0].y = 28600; planets.push(new Array(new MoonE(),80000,187 / 2)); container1.addChild(planets[10][0]); planets[10][0].x = 200; planets[10][0].y = -700; planets[10][0].rotation = Vector.angle2(new Vector(0,-1),new Vector(planets[10][0].x - planets[0][0].x,planets[10][0].y - planets[0][0].y)); planets.push(new Array(new MoonG(),80000,187 / 2)); container1.addChild(planets[11][0]); planets[11][0].x = -200; planets[11][0].y = -18000; planets[11][0].rotation = Vector.angle2(new Vector(0,-1),new Vector(planets[11][0].x - planets[1][0].x,planets[11][0].y - planets[1][0].y)); planets.push(new Array(new MoonH(),80000,187 / 2)); container1.addChild(planets[12][0]); planets[12][0].x = 23000; planets[12][0].y = 3100; planets[12][0].rotation = Vector.angle2(new Vector(0,-1),new Vector(planets[12][0].x - planets[2][0].x,planets[12][0].y - planets[2][0].y)); planets.push(new Array(new MoonB(),80000,187 / 2)); container1.addChild(planets[13][0]); planets[13][0].x = -28000; planets[13][0].y = -9500; planets[13][0].rotation = Vector.angle2(new Vector(0,-1),new Vector(planets[13][0].x - planets[4][0].x,planets[13][0].y - planets[4][0].y)); planets.push(new Array(new MoonL(),80000,45)); container1.addChild(planets[14][0]); planets[14][0].x = -27700; planets[14][0].y = -9500; planets[14][0].rotation = Vector.angle2(new Vector(0,-1),new Vector(planets[14][0].x - planets[4][0].x,planets[14][0].y - planets[4][0].y)); mp = 5; while(mp < 9) { Vecp = new Vector(planets[mp][0].x - planets[4][0].x,planets[mp][0].y - planets[4][0].y); planets[mp][0].rotation = Vector.angle2(new Vector(0,-1),Vecp); ++mp; } mooned = 0; gassed = 4; gemCounter = 0; planets[0][2] = 774 / 2; planets[1][2] = 445.8 / 2; planets[1][3] = 1616.4 / 2; planets[2][2] = 1344.7 / 2; planets[2][3] = 330.7 / 2; planets[3][2] = 187 / 2; planets[3][3] = 415; planets[4][2] = 672; earths = new Array(648 / 2,478 / 2,305 / 2,50); talk = new Talk(); aliem(); container1.addChild(bubblesC); container4.addChild(talk); talk.alpha = 0; talk.txt.text = ""; talk.visible = false; container1.addChild(rope); cc = 0; while(cc < 8) { clouds.push(new Array(new Gem(),2)); container1.addChild(clouds[cc][0]); clouds[cc][0].gotoAndStop(Math.floor(Math.random() * 3) + 1); clouds[cc][0].rotation = Math.random() * 360; Vec = new Vector(500,0); Vec.rotate(cc * (360 / 8)); clouds[cc][0].x = planets[2][0].x + Vec.x; clouds[cc][0].y = planets[2][0].y + Vec.y; ++cc; } gg = 0; while(gg < 4) { ggg = clouds.push(new Array(new Gasteroid(),3)) - 1; container4.addChild(clouds[ggg][0]); Vecg = new Vector(0,1300); Vecg.rotate(gg * (360 / 4)); clouds[ggg][0].rotation = Vector.angle2(new Vector(0,-1),Vecg); clouds[ggg][0].x = planets[1][0].x + Vecg.x; clouds[ggg][0].y = planets[1][0].y + Vecg.y; ++gg; } gemed = false; grounded = false; currentPlanet = 2; container1.addChild(bobber); container1.addChild(effects); bobber.x = center.x; bobber.y = center.y; flasher = new Flasher(); wholegame.addChild(flasher); latching = false; while(Math.random() < cn) { --cn; n = clouds.push(new Array(new Cloud(),0)) - 1; container2.addChild(clouds[n][0]); clouds[n][0].x = Math.random() * range; clouds[n][0].y = Math.random() * range; grav = new Vector(0,0); i = 0; while(i < 5) { planet = planets[i][0]; planet1mass = planets[i][1]; planet1r = planets[i][2]; GR = new Vector(planet.x - clouds[n][0].x,planet.y - clouds[n][0].y); str = GR.length; GR.length = planet1mass / (str * str); grav.x += GR.x; grav.y += GR.y; ++i; } clouds[n][0].rotation = Vector.angle2(new Vector(0,1),grav); clouds[n][0].gotoAndStop(Math.floor(Math.random() * 4) + 1); clouds[n][0].scaleX = (Math.round(Math.random()) - 0.5) * 2; j = 0; while(j < planets.length) { planet2 = planets[j][0]; planet1mass2 = planets[j][1]; planet1r2 = planets[j][2]; if(j == 1) { if((clouds[n][0].x - planet2.x) * (clouds[n][0].x - planet2.x) + (clouds[n][0].y - planet2.y) * (clouds[n][0].y - planet2.y) < (planet1r + 100) * (planet1r2 + 100)) { container2.removeChild(clouds[n][0]); clouds.splice(n,1); break; } } else if(j >= 5) { if((clouds[n][0].x - planet2.x) * (clouds[n][0].x - planet2.x) + (clouds[n][0].y - planet2.y) * (clouds[n][0].y - planet2.y) < (planet1r2 + 25) * (planet1r2 + 25)) { container2.removeChild(clouds[n][0]); clouds.splice(n,1); break; } } else if((clouds[n][0].x - planet2.x) * (clouds[n][0].x - planet2.x) + (clouds[n][0].y - planet2.y) * (clouds[n][0].y - planet2.y) < (planet1r2 + 200) * (planet1r2 + 200)) { container2.removeChild(clouds[n][0]); clouds.splice(n,1); break; } ++j; } } while(Math.random() < sn) { --sn; n2 = stars.push(new Star()) - 1; starsC.addChild(stars[n2]); stars[n2].x = Math.random() * srange; stars[n2].y = Math.random() * srange; stars[n2].rotation = Math.random() * 360; stars[n2].gotoAndStop(Math.floor(Math.random() * 9) + 1); } stage.addEventListener(Event.RENDER,shake); addEventListener(Event.ENTER_FRAME,update,false,0,true); talph = 0; kUp = false; kDown = false; kLeft = false; kRight = false; kSpace = false; kW = false; kA = false; kS = false; kD = false; kM = false; stage.addEventListener(KeyboardEvent.KEY_DOWN,keyHandelerD,false,0,true); stage.addEventListener(KeyboardEvent.KEY_UP,keyHandelerU,false,0,true); stage.addEventListener(MouseEvent.MOUSE_DOWN,mouseHandelerD,false,0,true); stage.addEventListener(MouseEvent.MOUSE_UP,mouseHandelerU,false,0,true); } public function keyHandelerD(param1:KeyboardEvent) : * { var _loc2_:* = undefined; if(!paus) { if(param1.keyCode == 87) { kW = true; } if(param1.keyCode == 65) { kA = true; } if(param1.keyCode == 83) { kS = true; } if(param1.keyCode == 68) { kD = true; } if(param1.keyCode == 38) { kUp = true; } if(param1.keyCode == 40) { kDown = true; } if(param1.keyCode == 37) { kLeft = true; } if(param1.keyCode == 39) { kRight = true; } if(param1.keyCode == 32) { kSpace = true; } } if(param1.keyCode == 27 || param1.keyCode == 80) { if(paus == false) { paus = true; stage.frameRate = 0; pauzz.visible = true; } else { paus = false; stage.frameRate = 30; pauzz.visible = false; } } if(param1.keyCode == 81) { _loc2_ = stage.quality; if(_loc2_ == "LOW") { stage.quality = "HIGH"; } if(_loc2_ == "MEDIUM") { stage.quality = "LOW"; } if(_loc2_ == "HIGH") { stage.quality = "MEDIUM"; } } } public function updo2() : * { framey = "inst"; fadery.play(); } public function ag_btnclick(param1:MouseEvent) : * { navigateToURL(new URLRequest("http://www.armorgames.com"),"_blank"); } public function keyHandelerU(param1:KeyboardEvent) : * { if(param1.keyCode == 87) { kW = false; } if(param1.keyCode == 65) { kA = false; } if(param1.keyCode == 83) { kS = false; } if(param1.keyCode == 68) { kD = false; } if(param1.keyCode == 38) { kUp = false; } if(param1.keyCode == 40) { kDown = false; } if(param1.keyCode == 37) { kLeft = false; } if(param1.keyCode == 39) { kRight = false; } if(param1.keyCode == 32) { kSpace = false; } } internal function frame3() : * { if(gemSounds == undefined) { beatgame = false; mus1 = new T1(); mus2 = new T2(); mus3 = new T3(); mus4 = new T4(); mus5 = new T5(); musB = new TB(); gemSounds = new Array(new G1(),new G2(),new G3(),new G4(),new G5(),new G6(),new G7(),new G8()); SFX = new Array(new SFX1(),new SFX2(),new SFX3(),new SFX4(),new SFX5(),new SFX6(),new SFX7()); win1 = new Win1(); win2 = new Win2(); win3 = new Win3(); win4 = new Win4(); channel1 = new SoundChannel(); channel2 = new SoundChannel(); channel3 = new SoundChannel(); channel4 = new SoundChannel(); channel5 = new SoundChannel(); channelW = new SoundChannel(); channelB = new SoundChannel(); sfx = new SoundChannel(); transform1 = new SoundTransform(0,0); transform2 = new SoundTransform(0,0); transform3 = new SoundTransform(0,0); transform4 = new SoundTransform(0,0); transform5 = new SoundTransform(0,0); transformW = new SoundTransform(1.5,0); transformB = new SoundTransform(1,0); transformSFX = new SoundTransform(1,0); channel2 = mus2.play(0,65535); channel5 = mus5.play(channel2.position,65535); channel1 = mus1.play(channel2.position,65535); channelB = musB.play(channel2.position,65535); channel3 = mus4.play(channel2.position,65535); channel4 = mus3.play(channel2.position,65535); channel1.soundTransform = transform1; channel2.soundTransform = transform2; channel3.soundTransform = transform3; channel4.soundTransform = transform4; channel5.soundTransform = transform5; channelB.soundTransform = transformB; channelW.soundTransform = transformW; sfx.soundTransform = transformSFX; } } internal function frame8() : * { stop(); beatgame = true; removeEventListener(Event.ENTER_FRAME,update); removeEventListener(KeyboardEvent.KEY_DOWN,keyHandelerD); removeEventListener(KeyboardEvent.KEY_UP,keyHandelerU); removeEventListener(MouseEvent.MOUSE_DOWN,mouseHandelerD); removeEventListener(MouseEvent.MOUSE_UP,mouseHandelerU); btn1.addEventListener(MouseEvent.CLICK,goBTN,false,0,true); } public function update(param1:Event) : * { var i:int = 0; var vSPEED:Number = NaN; var force:Vector = null; var rad2:Vector = null; var pFl:* = undefined; var netForce:Vector = null; var busty:Boolean = false; var numcg:Boolean = false; var bbbbbbb:Boolean = false; var strn:* = undefined; var winned:int = 0; var planet:MovieClip = null; var planet1mass:* = undefined; var planet1r:* = undefined; var GR:Vector = null; var str:Number = NaN; var aaaaaa:Vector = null; var nnn:* = undefined; var rVAL:Vector = null; var bobbery:Vector = null; var n:Vector = null; var C:Number = NaN; var Y:Number = NaN; var X:Number = NaN; var xp1:Vector = null; var xp2:Vector = null; var rad:Vector = null; var j:int = 0; var pp:int = 0; var ang:Vector = null; var disss:Vector = null; var dissst:Vector = null; var disst:Vector = null; var nnnn:Vector = null; var aaan:Vector = null; var shortestC:int = 0; var distC:Number = NaN; var ass:Boolean = false; var grav:Vector = null; var planet2:MovieClip = null; var planet1mass2:* = undefined; var planet1r2:* = undefined; var CFF:int = 0; var rrr:Vector = null; var rr:Vector = null; var targSiz:Number = NaN; var e:Event = param1; try { if(ended) { lockControls(); } i = 0; while(i < clouds.length) { if(clouds[i] == null || clouds[i] == undefined || clouds[i][0] == null || clouds[i][0] == undefined || clouds[i][1] == null || clouds[i][1] == undefined || isNaN(clouds[i][1])) { clouds.splice(i,1); i--; } i++; } vSPEED = 0; foregrounds[0].alpha = gassed / 4; if(!inside && planets[2][0].planet.currentFrame == 1) { foregrounds[1].planet.visible = false; planets[2][0].planet.visible = true; } if(inside && planets[2][0].planet.currentFrame == 1) { planets[2][0].planet.play(); foregrounds[1].planet.play(); foregrounds[1].planet.visible = true; planets[2][0].planet.visible = false; } if(!inside && planets[2][0].planet.currentFrame != 1) { planets[2][0].planet.play(); foregrounds[1].planet.play(); } if(planets[0][0].currentFrame == 6) { if(currentPlanet == 10 || grounded) { --timeE; if(timeE <= 0) { framey = "ending"; fadery.play(); } } } Gravity = new Vector(0,0); i = 0; while(i < planets.length) { planet = planets[i][0]; planet1mass = planets[i][1]; planet1r = planets[i][2]; GR = new Vector(planet.x - bobber.x,planet.y - bobber.y); str = GR.length; GR.length = planet1mass / (str * str); Gravity.x += GR.x; Gravity.y += GR.y; i++; } if(Gravity.length > 2) { Gravity.length = 2; } if(Gravity.length < 0.2 && planets[0][0].currentFrame != 6) { names.gotoAndStop(6); } force = new Vector((Number(kD) - Number(kA)) * strength,(Number(kS) - Number(kW)) * strength); if(grounded && kW && controls == 2) { bobber.gotoAndStop(6); force.y *= 25; controls = 1; } if(grounded && currentPlanet >= 5) { aaaaaa = new Vector(bobber.x - planets[currentPlanet][0].x,bobber.y - planets[currentPlanet][0].y); force.rotate(Vector.angle2(new Vector(0,-1),aaaaaa)); } else { force.rotate(Vector.angle2(new Vector(0,1),Gravity)); } if(force.length > 0 && !anchored && !latching && bobber.currentFrame == 1 && controls == 1) { bobber.ani.play(); rspeed = Vector.angle2(new Vector(0,-1).rotateNew(bobber.rotation),force) / 5; } if(bobber.currentFrame == 7 && bobber.ani.currentFrame == 8) { bobber.gotoAndStop(1); } friction = 1 - Gravity.length / 100; if(anchored) { friction = 1; } if(planets[0][0].currentFrame == 5) { aaaaaa = new Vector(bobber.x - planets[0][0].x,bobber.y - planets[0][0].y); if(aaaaaa.length < 700) { namesT = 200; names.gotoAndStop(1); friction = 0.95; force.x = 0; force.y = 0; lockControls(); if(speed.length > 10) { speed.length -= (speed.length - 10) / 10; } } } rad2 = new Vector(planets[1][0].x - bobber.x,planets[1][0].y - bobber.y); if(rad2.length < planets[1][3]) { if(names.currentFrame != 2) { namesT = 200; names.gotoAndStop(2); } friction -= gassed * 0.05; if(anchored) { friction = 1 - gassed * 0.007; } else if(!grounded) { force.scale(10); } } rad2 = new Vector(planets[3][0].x - bobber.x,planets[3][0].y - bobber.y); pFl = floating; floating = false; if(rad2.length < planets[3][3]) { Gravity.scale(-1); floating = true; if(names.currentFrame != 4) { namesT = 200; names.gotoAndStop(4); } if(anchored) { friction = 0.99; } else { friction = 0.94; } } if(floating == !pFl && speed.length > 25) { sfx = SFX[4].play(); transformSFX.volume = 3; nnn = splashes.push(new Splash()) - 1; effects.addChild(splashes[nnn]); GR = new Vector(planets[3][0].x - (bobber.x + speed.x),planets[3][0].y - (bobber.y + speed.y)); GR.length = planets[3][3]; splashes[nnn].x = planets[3][0].x - GR.x; splashes[nnn].y = planets[3][0].y - GR.y; splashes[nnn].rotation = Vector.angle2(new Vector(0,1),GR); } if(rad2.length < planets[3][3] - 30) { if(foregrounds[2].alpha > 0.2) { foregrounds[2].alpha -= 0.02; } } else if(foregrounds[2].alpha < 1) { foregrounds[2].alpha += 0.1; } if(!anchored && !grounded) { if(!floating) { force.scale(0.1); } else { force.scale(3); } } if(anchored) { force.scale(1.5); } netForce = new Vector(0,0); netForce = Vector.add(Gravity,netForce); netForce = Vector.add(force,netForce); speed.x += netForce.x; speed.y += netForce.y; speed.scale(friction); busty = false; if(anchored) { center.x = currentCloud.x; center.y = currentCloud.y; controls = 1; grounded = false; rVAL = new Vector(pos.x,pos.y); pos.x += speed.x * speedFactor; pos.y += speed.y * speedFactor; if(pos.length > len) { n = new Vector(pos.length - len,0); n.rotate(Vector.angle2(new Vector(1,0),pos)); speed.x += n.x / -elastic; speed.y += n.y / -elastic; pos.length -= n.length / elastic; } rope.graphics.clear(); if(pos.length < len) { C = len / 2; Y = pos.length / 2; X = Math.sqrt(C * C - Y * Y); xp1 = new Vector(pos.x,pos.y); xp1 = xp1.perpendicular(-1); xp2 = new Vector(pos.x,pos.y); xp2 = xp2.perpendicular(1); xp1.length = X; xp2.length = X; xp1.x += pos.x / 2; xp1.y += pos.y / 2; xp2.x += pos.x / 2; xp2.y += pos.y / 2; if((xp1.x - pos2.x) * (xp1.x - pos2.x) + (xp1.y - pos2.y) * (xp1.y - pos2.y) < (xp2.x - pos2.x) * (xp2.x - pos2.x) + (xp2.y - pos2.y) * (xp2.y - pos2.y)) { pos2.x = xp1.x; pos2.y = xp1.y; } else { pos2.x = xp2.x; pos2.y = xp2.y; } } else { pos2.x = pos.x / 2; pos2.y = pos.y / 2; } if(!floating) { rspeed += Vector.angle2(new Vector(0,1).rotateNew(bobber.rotation),Vector.add(Vector.subtract(pos,pos2),Gravity)) / 30; } else { rspeed += Vector.angle2(new Vector(0,1).rotateNew(bobber.rotation),Vector.add(Gravity,Vector.subtract(pos,pos2))) / 30; } vSPEED = Vector.angle2(rVAL,pos); rspeed *= 0.95; bobbery = new Vector(0,-charH).rotateNew(bobber.rotation + rspeed * speedFactor); bobber.x = pos.x + center.x + bobbery.x; bobber.y = pos.y + center.y + bobbery.y; i = 0; while(i < planets.length) { if(!(i == 0 && planets[0][0].currentFrame == 6)) { if(!(i >= 5 && i <= 8 && planets[i][4] == 0)) { planet = planets[i][0]; planet1mass = planets[i][1]; planet1r = planets[i][2]; rad = new Vector(planet.x - bobber.x,planet.y - bobber.y); if(inside && i == 2) { if(rad.length > planet1r + 30) { inside = false; j = 0; while(j < 10) { pp = int(particles.push(new Array(new Particle2(),new Vector(0,Math.random() * 3 + 10),new Vector(Gravity.x / 3,Gravity.y / 3),0.99,Math.random() * 100 - 50,20)) - 1); particles[pp][1].rotate(Vector.angle2(new Vector(0,-1),Gravity) + Math.random() * 30 - 15); particles[pp][0].x = planets[2][0].x - rad.x / rad.length * planets[2][2]; particles[pp][0].y = planets[2][0].y - rad.y / rad.length * planets[2][2]; particles[pp][0].gotoAndStop(Math.floor(Math.random() * 4) + 1); particles[pp][0].rotation = Math.random() * 360; effects.addChild(particles[pp][0]); j++; } nnn = splashes.push(new Poof()) - 1; effects.addChild(splashes[nnn]); splashes[nnn].x = planets[currentPlanet][0].x - rad.x / rad.length * planets[2][2]; splashes[nnn].y = planets[currentPlanet][0].y - rad.y / rad.length * planets[2][2]; splashes[nnn].rotation = Vector.angle2(new Vector(0,1),rad); } else { planet1r = planets[i][3]; } } if(rad.length < planet1r + charH) { busty = true; rad.length = planet1r + charH; bobber.x = planet.x - rad.x; bobber.y = planet.y - rad.y; rad.length = Vector.dot(rad,speed) / rad.length; speed.x -= rad.x * 1.4; speed.y -= rad.y * 1.4; if(i >= 5) { speed.rotate(Vector.angle2(new Vector(0,1),rad)); speed.y = 0; speed.rotate(-Vector.angle2(new Vector(0,1),rad)); } } } } i++; } rope.graphics.lineStyle(4,14277081); rope.graphics.moveTo(center.x,center.y); rope.graphics.curveTo(pos2.x + center.x,pos2.y + center.y,bobber.x + bobbery.x,bobber.y + bobbery.y); rope.graphics.lineStyle(1,16777215); rope.graphics.moveTo(center.x,center.y); rope.graphics.curveTo(pos2.x + center.x,pos2.y + center.y,bobber.x + bobbery.x,bobber.y + bobbery.y); } else { rspeed *= 0.99; rope.graphics.clear(); ang = new Vector(bobber.x - planets[currentPlanet][0].x,bobber.y - planets[currentPlanet][0].y); if(currentPlanet == 2 && !inside && planets[2][0].box.hitTestObject(bobber.box) && ang.length < planets[currentPlanet][2] + charH + 5) { inside = true; if(controls == 2) { speed = new Vector(speedP * planets[2][2] * (Math.PI / 180),0); speed.rotate(Vector.angle2(new Vector(0,-1),ang)); } controls = 1; grounded = false; } if(controls == 1) { bobber.x += speed.x * speedFactor; bobber.y += speed.y * speedFactor; } else if(controls == 2) { if(kD) { speedP += 0.2; if(inside) { speedP += 0.4; } if(currentPlanet == 0) { speedP += 0.16; } if(currentPlanet == 1) { speedP += 0.2 - gassed * 0.05; } if(currentPlanet >= 5) { speedP += 1; } if(currentPlanet == 0) { speedP += (planets[0][0].currentFrame - 1) / 10; } } if(kA) { speedP -= 0.2; if(inside) { speedP -= 0.4; } if(currentPlanet == 1) { speedP -= 0.2 - gassed * 0.05; } if(currentPlanet == 0) { speedP -= 0.16; } if(currentPlanet >= 5) { --speedP; } if(currentPlanet == 0) { speedP -= (planets[0][0].currentFrame - 1) / 10; } } speedP *= 0.92; ang.rotate(speedP * speedFactor); speed = new Vector(speedP * ang.length * (Math.PI / 180),0); speed.rotate(Vector.angle2(new Vector(0,-1),ang)); ang.length = planets[currentPlanet][2]; if(inside) { ang.length = planets[currentPlanet][3]; } if(!floating) { bobber.x = ang.x + planets[currentPlanet][0].x; bobber.y = ang.y + planets[currentPlanet][0].y; } } grounded = false; i = int(planets.length - 1); while(i >= 0) { if(!(i == 0 && planets[0][0].currentFrame == 6)) { if(!(i >= 5 && i <= 8 && planets[i][4] == 0)) { planet = planets[i][0]; planet1mass = planets[i][1]; planet1r = planets[i][2]; rad = new Vector(planet.x - bobber.x,planet.y - bobber.y); if(rad.length < planet1r + charH + 50 && !floating && i <= 4 || bobber.currentFrame == 6 && rad.length < planet1r + 180 && !floating && i <= 4 || rad.length < planet1r + charH && !floating && i > 4) { bobber.rotation += Vector.angle2(new Vector(0,1).rotateNew(bobber.rotation),rad) / 4; } if(inside && i == 2) { if(rad.length > planet1r + charH + 6) { inside = false; j = 0; while(j < 10) { pp = int(particles.push(new Array(new Particle2(),new Vector(0,Math.random() * 3 + 10),new Vector(Gravity.x / 3,Gravity.y / 3),0.99,Math.random() * 100 - 50,20)) - 1); particles[pp][1].rotate(Vector.angle2(new Vector(0,-1),Gravity) + Math.random() * 30 - 15); particles[pp][0].x = planets[2][0].x - rad.x / rad.length * planets[2][2]; particles[pp][0].y = planets[2][0].y - rad.y / rad.length * planets[2][2]; particles[pp][0].gotoAndStop(Math.floor(Math.random() * 4) + 1); particles[pp][0].rotation = Math.random() * 360; effects.addChild(particles[pp][0]); j++; } nnn = splashes.push(new Poof()) - 1; effects.addChild(splashes[nnn]); splashes[nnn].x = planets[currentPlanet][0].x - rad.x / rad.length * planets[2][2]; splashes[nnn].y = planets[currentPlanet][0].y - rad.y / rad.length * planets[2][2]; splashes[nnn].rotation = Vector.angle2(new Vector(0,1),rad); } else { planet1r = planets[i][3]; } } if(rad.length < planet1r + charH) { if(i == 0 && planets[0][0].currentFrame == 5) { planets[0][0].gotoAndStop(6); ended = true; sfx = SFX[5].play(); transformSFX.volume = 3; speed.scale(0.5); if(speed.length > 5) { speed.length = 5; } planets[0][1] = 0; j = 0; while(j < 40) { pp = int(particles.push(new Array(new Particle1(),new Vector(Math.random() * 10 + 5,0),new Vector(0,0),0.95,Math.random() * 100 - 50,40)) - 1); particles[pp][1].rotate(Math.random() * 360); particles[pp][0].x = planets[0][0].x; particles[pp][0].y = planets[0][0].y; particles[pp][0].gotoAndStop(Math.floor(Math.random() * 4) + 1); particles[pp][0].rotation = Math.random() * 360; effects.addChild(particles[pp][0]); j++; } } else { rad.length = planet1r + charH; bobber.x = planet.x - rad.x; bobber.y = planet.y - rad.y; rad.length = Vector.dot(rad,speed) / rad.length; speed.x -= rad.x * 1.2; speed.y -= rad.y * 1.2; rspeed = 0; grounded = true; if(Math.abs(Vector.dot(speed,rad) / rad.length) < 25 && !floating) { if(controls == 1) { speedP = Vector.dot(speed.perpendicular(),rad) / (rad.length * planet1r) * (180 / Math.PI); speed = new Vector(speedP * planet1r * (Math.PI / 180),0); speed.rotate(Vector.angle2(new Vector(0,1),rad)); } controls = 2; if(currentPlanet != i) { currentPlanet = i; } if(i <= 4 && names.currentFrame != i + 1) { namesT = 200; names.gotoAndStop(i + 1); } } } } } } i--; } } if(bobber.currentFrame != 1 && bobber.currentFrame != 2 && bobber.currentFrame != 7 && (floating || Gravity.length < 1)) { bobber.gotoAndStop(1); } if(currentPlanet == 9 && floating && controls == 2) { controls = 1; grounded = false; } if(mooned != 4) { i = 0; while(i < 4) { disss = new Vector(planets[4][0].x - planets[5 + i][0].x,planets[4][0].y - planets[5 + i][0].y); if(disss.length < planets[4][2] + planets[5 + i][2] + 100) { planets[5 + i][4] = 0; if(controls == 2 && currentPlanet == 5 + i) { controls = 1; grounded = false; } } if(disss.length < planets[4][2] + planets[5 + i][2] && Boolean(planets[5 + i][0].visible)) { j = 0; while(j < 3) { pp = int(particles.push(new Array(new Particle2(),new Vector(0,Math.random() * 3 + 10),new Vector(Gravity.x / 3,Gravity.y / 3),0.99,Math.random() * 100 - 50,20)) - 1); particles[pp][1].rotate(Vector.angle2(new Vector(0,-1),Gravity) + Math.random() * 60 - 30); disst = new Vector(disss.x,disss.y); disst.norm(); disst.rotate(Math.random() * 6 - 3); particles[pp][0].x = planets[4][0].x - disst.x * planets[4][2]; particles[pp][0].y = planets[4][0].y - disst.y * planets[4][2]; particles[pp][0].gotoAndStop(Math.floor(Math.random() * 4) + 1); particles[pp][0].rotation = Math.random() * 360; effects.addChild(particles[pp][0]); j++; } nnn = splashes.push(new Smoke()) - 1; effects.addChild(splashes[nnn]); dissst = new Vector(disss.x,disss.y); dissst.norm(); dissst.rotate(Math.random() * 6 - 3); splashes[nnn].x = planets[4][0].x - dissst.x * planets[4][2] + Math.random() * 40 - 20; splashes[nnn].y = planets[4][0].y - dissst.y * planets[4][2] + Math.random() * 40 - 20; splashes[nnn].rotation = Math.random() * 360; if(planets[4][0].currentFrame == 1) { planets[4][0].gotoAndStop(2); sfx = SFX[6].play(); transformSFX.volume = 1.5; } } if(disss.length < planets[4][2] - planets[5 + i][2] - 50) { planets[5 + i][3].scale(0); if(planets[4][0].currentFrame == 2 && Boolean(planets[5 + i][0].visible)) { planets[4][0].gotoAndStop(1); mooned += 1; sfx.stop(); sfx = SFX[2].play(); transformSFX.volume = 2; } planets[5 + i][0].visible = false; } if(currentPlanet == 5 + i && controls == 2 && grounded) { if(planets[5 + i][0].ani.currentFrame == 1 && talph == 0) { planets[5 + i][0].ani.gotoAndStop(2); talph = 1; } if(talph == 1) { talk.visible = true; if(i == 0) { talk.txt.text = "\nI\'ll never go back home."; } if(i == 1) { talk.txt.text = "\nI\'ll go home when he leaves!"; } if(i == 2) { talk.txt.text = "\nPersonally, I think hes pretty cool"; } if(i == 3) { talk.txt.text = "\nI hate him so much..."; } talk.bubb.scaleX = -1; nnnn = new Vector(talk.bubb.scaleX * -130 * talk.scaleX,-100 * talk.scaleY); nnnn.rotate(Vector.angle2(new Vector(0,-1),new Vector(0,-1).rotateNew(planets[5 + i][0].rotation))); talk.x = planets[5 + i][0].x + nnnn.x; talk.y = planets[5 + i][0].y + nnnn.y; talk.rotation = planets[5 + i][0].rotation; } } else if(planets[5 + i][0].ani.currentFrame == 2) { planets[5 + i][0].ani.gotoAndStop(1); talph = 0; } if(currentPlanet == 5 + i && controls == 2 && grounded) { aaan = new Vector(planets[5 + i][0].x - bobber.x,planets[5 + i][0].y - bobber.y); if(Vector.angle(aaan,Gravity) < 30) { aaan.norm(); planets[5 + i][3].x += aaan.x / 7; planets[5 + i][3].y += aaan.y / 7; } } if(planets[5 + i][4] != 0) { planets[5 + i][3].scale(0.95); } else if(planets[5 + i][3].length < 1) { planets[5 + i][3].length = 1; } planets[5 + i][0].x += planets[5 + i][3].x; planets[5 + i][0].y += planets[5 + i][3].y; i++; } } if(mooned == 4 && planets[4][0].currentFrame == 1) { planets[4][0].gotoAndStop(3); } bobber.rotation += rspeed * speedFactor; if(latching && !anchored) { latching = false; anchored = true; bobbery = new Vector(0,-charH).rotateNew(bobber.rotation); center.x = currentCloud.x; center.y = currentCloud.y; pos.x = bobber.x - bobbery.x - center.x; pos.y = bobber.y - bobbery.y - center.y; len = pos.length; if(len < 100 + Gravity.length * 20) { len = 100 + Gravity.length * 20; } if(len > 600) { len = 600; } rope.graphics.lineStyle(4,14277081); rope.graphics.moveTo(bobber.x + bobbery.x,bobber.y + bobbery.y); rope.graphics.lineTo(bobber.x + bobbery.x - 2 * (bobber.x + bobbery.x - center.x) / 3,bobber.y + bobbery.y - 2 * (bobber.y + bobbery.y - center.y) / 3); rope.graphics.lineStyle(1,16777215); rope.graphics.moveTo(bobber.x + bobbery.x,bobber.y + bobbery.y); rope.graphics.lineTo(bobber.x + bobbery.x - 2 * (bobber.x + bobbery.x - center.x) / 3,bobber.y + bobbery.y - 2 * (bobber.y + bobbery.y - center.y) / 3); } if(kM && !anchored && !latching && bobber.currentFrame != 2) { shortestC = -1; distC = 150 * 150; i = 0; while(i < clouds.length) { if((clouds[i][1] == 0 || clouds[i][1] == 3) && !inside || clouds[i][1] == 2 && inside) { if((clouds[i][0].x - mc.mouseX) * (clouds[i][0].x - mc.mouseX) + (clouds[i][0].y - mc.mouseY) * (clouds[i][0].y - mc.mouseY) < distC) { if((clouds[i][0].x - bobber.x) * (clouds[i][0].x - bobber.x) + (clouds[i][0].y - bobber.y) * (clouds[i][0].y - bobber.y) < 600 * 600) { distC = (clouds[i][0].x - mc.mouseX) * (clouds[i][0].x - mc.mouseX) + (clouds[i][0].y - mc.mouseY) * (clouds[i][0].y - mc.mouseY); shortestC = i; } } } i++; } if(shortestC != -1) { center.x = clouds[shortestC][0].x; center.y = clouds[shortestC][0].y; currentCloud = clouds[shortestC][0]; bobber.gotoAndStop(2); } } if(bobber.currentFrame == 2 && bobber.ani != undefined && bobber.ani.currentFrame == 3 && !latching) { latching = true; bobbery = new Vector(0,-charH).rotateNew(bobber.rotation); rope.graphics.lineStyle(4,14277081); rope.graphics.moveTo(bobber.x + bobbery.x,bobber.y + bobbery.y); rope.graphics.lineTo(bobber.x + bobbery.x - (bobber.x + bobbery.x - center.x) / 3,bobber.y + bobbery.y - (bobber.y + bobbery.y - center.y) / 3); rope.graphics.lineStyle(1,16777215); rope.graphics.moveTo(bobber.x + bobbery.x,bobber.y + bobbery.y); rope.graphics.lineTo(bobber.x + bobbery.x - (bobber.x + bobbery.x - center.x) / 3,bobber.y + bobbery.y - (bobber.y + bobbery.y - center.y) / 3); } if(!anchored && !latching && bobber.currentFrame == 2 && bobber.ani != undefined && bobber.ani.currentFrame == 6 && controls == 1) { bobber.gotoAndStop(1); } if(bobber.currentFrame == 2 && !anchored) { rspeed = 0; bobber.rotation += Vector.angle2(new Vector(0,-1).rotateNew(bobber.rotation),new Vector(currentCloud.x - bobber.x,currentCloud.y - bobber.y)) / 3; } if(!kM) { anchored = false; latching = false; currentCloud = null; if(bobber.currentFrame == 2) { bobber.gotoAndStop(1); } } speedC.x = -cam.x; speedC.y = -cam.y; cam.x += (cam.x - bobber.x) / -4; cam.y += (cam.y - bobber.y) / -4; speedC.x += cam.x; speedC.y += cam.y; area = range * Math.abs(speedC.x) + (range - Math.abs(speedC.x)) * Math.abs(speedC.y); cn = area * density; while(Math.random() < cn) { ass = false; if(Math.random() > Gravity.length - 0.3) { ass = true; } --cn; if(ass && Math.random() > 0.5 || !ass) { nnn = clouds.push(new Array(new Cloud(),0)) - 1; container2.addChild(clouds[nnn][0]); if(Math.random() < Math.abs(range * speedC.x) / area) { clouds[nnn][0].x = cam.x + Math.random() * speedC.x + range / 2 * (Math.abs(speedC.x) / speedC.x) - speedC.x; clouds[nnn][0].y = cam.y + Math.random() * range - range / 2; } else { clouds[nnn][0].x = cam.x + Math.random() * range - range / 2; clouds[nnn][0].y = cam.y + Math.random() * speedC.y + range / 2 * (Math.abs(speedC.y) / speedC.y) - speedC.y; } if(!ass) { grav = new Vector(0,0); i = 0; while(i < 5) { planet = planets[i][0]; planet1mass = planets[i][1]; planet1r = planets[i][2]; GR = new Vector(planet.x - clouds[nnn][0].x,planet.y - clouds[nnn][0].y); str = GR.length; GR.length = planet1mass / (str * str); grav.x += GR.x; grav.y += GR.y; i++; } clouds[nnn][0].rotation = Vector.angle2(new Vector(0,1),grav); clouds[nnn][0].gotoAndStop(Math.floor(Math.random() * 4) + 1); } else { clouds[nnn][0].rotation = Math.random() * 360; clouds[nnn][0].gotoAndStop(Math.floor(Math.random() * 6) + 5); } clouds[nnn][0].scaleX = (Math.round(Math.random()) - 0.5) * 2; j = 0; while(j < planets.length) { planet2 = planets[j][0]; planet1mass2 = planets[j][1]; planet1r2 = planets[j][2]; if(j == 3) { planet1r2 = planets[3][3]; } if(j == 1) { if((clouds[nnn][0].x - planet2.x) * (clouds[nnn][0].x - planet2.x) + (clouds[nnn][0].y - planet2.y) * (clouds[nnn][0].y - planet2.y) < (planet1r2 + 100) * (planet1r2 + 100)) { container2.removeChild(clouds[nnn][0]); clouds.splice(nnn,1); break; } } else if(j >= 5) { if((clouds[nnn][0].x - planet2.x) * (clouds[nnn][0].x - planet2.x) + (clouds[nnn][0].y - planet2.y) * (clouds[nnn][0].y - planet2.y) < (planet1r2 + 25) * (planet1r2 + 25)) { container2.removeChild(clouds[nnn][0]); clouds.splice(nnn,1); break; } } else if((clouds[nnn][0].x - planet2.x) * (clouds[nnn][0].x - planet2.x) + (clouds[nnn][0].y - planet2.y) * (clouds[nnn][0].y - planet2.y) < (planet1r2 + 200) * (planet1r2 + 200)) { container2.removeChild(clouds[nnn][0]); clouds.splice(nnn,1); break; } j++; } } } numcg = true; bbbbbbb = false; i = 0; while(i < clouds.length) { if(clouds[i][1] == 0) { if(Math.abs(cam.x - clouds[i][0].x) > range / 2 || Math.abs(cam.y - clouds[i][0].y) > range / 2) { container2.removeChild(clouds[i][0]); clouds.splice(i,1); i--; } if(inside && currentCloud == clouds[i][0]) { anchored = false; latching = false; currentCloud = null; if(bobber.currentFrame == 2) { bobber.gotoAndStop(1); } } } if(clouds[i][1] == 2) { clouds[i][0].visible = foregrounds[1].planet.visible; if(currentCloud == clouds[i][0] && clouds[i][0].ani.currentFrame == 1 && anchored && !((grounded || controls == 2 || busty || !inside) && !gemed)) { if(gemCounter != -1) { clouds[i][0].ani.gotoAndStop(2); sfx = gemSounds[gemCounter].play(); transformSFX.volume = 1; gemCounter += 1; } } if((grounded || controls == 2 || busty || !inside) && clouds[i][0].ani.currentFrame == 2 && !gemed) { clouds[i][0].ani.gotoAndStop(1); if(gemCounter != -1) { sfx = SFX[3].play(); transformSFX.volume = 2; } gemCounter = -1; } if(!inside && currentCloud == clouds[i][0]) { anchored = false; latching = false; currentCloud = null; if(bobber.currentFrame == 2) { bobber.gotoAndStop(1); } } if(clouds[i][0].ani.currentFrame == 1) { numcg = false; } } if(clouds[i][1] == 3) { if(currentCloud == clouds[i][0]) { bbbbbbb = true; pollupy += vSPEED; CFF = Math.abs(pollupy) / 3; if(CFF <= 1) { CFF = 2; } if(CFF >= 201) { clouds[i][0].gaser.gotoAndPlay(201); j = 0; while(j < 20) { pp = int(particles.push(new Array(new Particle1(),new Vector(Math.random() * 10 + 5,0),new Vector(0,0),0.97,Math.random() * 100 - 50,40)) - 1); particles[pp][1].rotate(Math.random() * 360); particles[pp][0].x = clouds[i][0].x; particles[pp][0].y = clouds[i][0].y; particles[pp][0].gotoAndStop(Math.floor(Math.random() * 4) + 1); particles[pp][0].rotation = Math.random() * 360; effects.addChild(particles[pp][0]); j++; } sfx = SFX[1].play(); transformSFX.volume = 1; clouds[i][0].gas.play(); --gassed; clouds[i][1] = -1; anchored = false; latching = false; currentCloud = null; if(bobber.currentFrame == 2) { bobber.gotoAndStop(1); } } else if(clouds[i][0].gaser.currentFrame != CFF) { clouds[i][0].gaser.gotoAndStop(CFF); stage.invalidate(); } } else if(clouds[i][0].gaser.currentFrame != 1 && clouds[i][1] == 3) { CFF = Math.abs(pollupy) / 3; if(CFF <= 0) { CFF = 1; } if(CFF >= 201) { clouds[i][0].gaser.gotoAndPlay(201); j = 0; while(j < 20) { pp = int(particles.push(new Array(new Particle1(),new Vector(Math.random() * 10 + 5,0),new Vector(0,0),0.97,Math.random() * 100 - 50,40)) - 1); particles[pp][1].rotate(Math.random() * 360); particles[pp][0].x = clouds[i][0].x; particles[pp][0].y = clouds[i][0].y; particles[pp][0].gotoAndStop(Math.floor(Math.random() * 4) + 1); particles[pp][0].rotation = Math.random() * 360; effects.addChild(particles[pp][0]); j++; } sfx = SFX[1].play(); transformSFX.volume = 1; --gassed; clouds[i][1] = -1; anchored = false; latching = false; currentCloud = null; if(bobber.currentFrame == 2) { bobber.gotoAndStop(1); } } else if(clouds[i][0].gaser.currentFrame != CFF) { clouds[i][0].gaser.gotoAndStop(CFF); stage.invalidate(); } } } i++; } if(gemCounter == -1 && !anchored) { gemCounter = 0; } if(pollupy != 0) { if(pollupy > 0) { pollupy -= 3; if(pollupy < 0) { pollupy = 0; } } else { pollupy += 3; if(pollupy > 0) { pollupy = 0; } } } if(!bbbbbbb && pollupy != 0) { pollupy = Math.abs(pollupy); pollupy -= 15; if(pollupy < 0) { pollupy = 0; } } if(numcg) { gemed = true; } alien(); speedC.scale(2); sarea = srange * Math.abs(speedC.x) + (srange - Math.abs(speedC.x)) * Math.abs(speedC.y); sn = sarea * sdensity; while(Math.random() < sn) { --sn; nnn = stars.push(new Star()) - 1; starsC.addChild(stars[nnn]); if(Math.random() < Math.abs(srange * speedC.x) / sarea) { stars[nnn].x = cam.x + Math.random() * speedC.x + srange / 2 * (Math.abs(speedC.x) / speedC.x) - speedC.x; stars[nnn].y = cam.y + Math.random() * srange - srange / 2; } else { stars[nnn].x = cam.x + Math.random() * srange - srange / 2; stars[nnn].y = cam.y + Math.random() * speedC.y + srange / 2 * (Math.abs(speedC.y) / speedC.y) - speedC.y; } stars[nnn].rotation = Math.random() * 360; stars[nnn].gotoAndStop(Math.floor(Math.random() * 9) + 1); } i = 0; while(i < stars.length) { stars[i].x += speedC.x / 3; stars[i].y += speedC.y / 3; if(stars[i].visible) { if(stars[i].currentFrame >= 4 && Math.random() < 0.1) { stars[i].visible = !stars[i].visible; } } else if(stars[i].currentFrame >= 4 && Math.random() < 0.5) { stars[i].visible = !stars[i].visible; } if(Math.abs(cam.x - stars[i].x) > srange / 2 || Math.abs(cam.y - stars[i].y) > srange / 2) { starsC.removeChild(stars[i]); stars.splice(i,1); i--; } i++; } barea = brange * Math.abs(speedC.x) + (brange - Math.abs(speedC.x)) * Math.abs(speedC.y); bn += barea * bdensity; while(Math.random() < bn) { --bn; if(crazies.length <= 5) { if(Math.random() < 0.3) { nnn = crazies.push(new Array(new Crazy(),1)) - 1; back.addChild(crazies[nnn][0]); if(Math.random() < Math.abs(brange * speedC.x) / barea) { crazies[nnn][0].x = cam.x + Math.random() * speedC.x + brange / 2 * (Math.abs(speedC.x) / speedC.x) - speedC.x; crazies[nnn][0].y = cam.y + Math.random() * brange - brange / 2; } else { crazies[nnn][0].x = cam.x + Math.random() * brange - brange / 2; crazies[nnn][0].y = cam.y + Math.random() * speedC.y + brange / 2 * (Math.abs(speedC.y) / speedC.y) - speedC.y; } crazies[nnn][0].rotation = Math.random() * 360; crazies[nnn][0].scaleX = (Math.round(Math.random()) - 0.5) * 2; crazies[nnn][0].gotoAndStop(Math.floor(Math.random() * 4) + 1); if(won[crazies[nnn][0].currentFrame - 1] == false) { crazies[nnn][0].gotoAndStop(5); } } else { nnn = crazies.push(new Array(new Planets(),2)) - 1; back2.addChild(crazies[nnn][0]); if(Math.random() < Math.abs(brange * speedC.x) / barea) { crazies[nnn][0].x = cam.x + Math.random() * speedC.x + brange / 2 * (Math.abs(speedC.x) / speedC.x) - speedC.x; crazies[nnn][0].y = cam.y + Math.random() * brange - brange / 2; } else { crazies[nnn][0].x = cam.x + Math.random() * brange - brange / 2; crazies[nnn][0].y = cam.y + Math.random() * speedC.y + brange / 2 * (Math.abs(speedC.y) / speedC.y) - speedC.y; } crazies[nnn][0].rotation = Math.random() * 360; crazies[nnn][0].scaleX = (Math.round(Math.random()) - 0.5) * 2; crazies[nnn][0].gotoAndStop(Math.floor(Math.random() * 11) + 1); } } } i = 0; while(i < crazies.length) { if(crazies[i][1] == 1) { crazies[i][0].x += speedC.x / 4; crazies[i][0].y += speedC.y / 4; if(Math.abs(cam.x - crazies[i][0].x) > brange / 2 || Math.abs(cam.y - crazies[i][0].y) > brange / 2) { back.removeChild(crazies[i][0]); crazies.splice(i,1); i--; } } else { crazies[i][0].x += speedC.x / 2.5; crazies[i][0].y += speedC.y / 2.5; if(Math.abs(cam.x - crazies[i][0].x) > brange / 2 || Math.abs(cam.y - crazies[i][0].y) > brange / 2) { back2.removeChild(crazies[i][0]); crazies.splice(i,1); i--; } } i++; } if(bg.b1.alpha <= 0) { bg.b1.alpha = 0; bg.b1.visible = false; } else { bg.b1.visible = true; } if(bg.b2.alpha <= 0) { bg.b2.alpha = 0; bg.b2.visible = false; } else { bg.b2.visible = true; } if(bg.b3.alpha <= 0) { bg.b3.alpha = 0; bg.b3.visible = false; } else { bg.b3.visible = true; } if(bg.b4.alpha <= 0) { bg.b4.alpha = 0; bg.b4.visible = false; } else { bg.b4.visible = true; } if(bg.b5.alpha <= 0) { bg.b5.alpha = 0; bg.b5.visible = false; } else { bg.b5.visible = true; } dir.alpha = (1 - (bg.b1.alpha + bg.b2.alpha + bg.b3.alpha + bg.b4.alpha + bg.b5.alpha)) * 3; if(dir.alpha <= 0) { dir.visible = false; } else { dir.visible = true; } if(floating && Math.random() < 0.2) { nnn = bubbles.push(new Bubble()) - 1; bubblesC.addChild(bubbles[nnn]); bobbery = new Vector(0,-charH).rotateNew(bobber.rotation); bubbles[nnn].x = bobber.x + bobbery.x; bubbles[nnn].y = bobber.y + bobbery.y; bubbles[nnn].gotoAndStop(Math.floor(Math.random() * 3) + 1); } i = 0; while(i < bubbles.length) { rrr = new Vector(bubbles[i].x - planets[3][0].x,bubbles[i].y - planets[3][0].y); if(rrr.length > planets[3][3]) { bubblesC.removeChild(bubbles[i]); bubbles.splice(i,1); i--; } else { rrr.norm(); rrr.scale(2); bubbles[i].x += rrr.x + Math.random() - 0.5; bubbles[i].y += rrr.y + Math.random() - 0.5; } i++; } if(planets[3][0].visible) { i = 0; while(i < fish.length) { fish[i][0].visible = true; rr = new Vector(fish[i][0].x - planets[3][0].x,fish[i][0].y - planets[3][0].y); if(rr.length == 0) { rr.x = 0.1; } fish[i][0].rotation = Vector.angle2(new Vector(0,-1),rr); fish[i][1].rotate(fish[i][2]); if(Math.random() < 0.05) { fish[i][2] = Math.random() * 10 - 5; } if(rr.length > planets[3][3] - 50) { fish[i][1].x -= rr.x / rr.length; fish[i][1].y -= rr.y / rr.length; } if(rr.length < planets[3][2] + 30) { fish[i][1].x += rr.x / rr.length; fish[i][1].y += rr.y / rr.length; } if(Vector.dot(rr.perpendicular(),fish[i][1]) < 0) { fish[i][0].scaleX = -1; } else { fish[i][0].scaleX = 1; } if(fish[i][3] == 1) { if(fish[i][1].length < 1) { fish[i][1].length = 1; } if(fish[i][1].length > 4) { fish[i][1].length = 4; } } else { if(fish[i][1].length < 0.3) { fish[i][1].length = 0.3; } if(fish[i][1].length > 2) { fish[i][1].length = 2; } } fish[i][0].x += fish[i][1].x; fish[i][0].y += fish[i][1].y; if(Boolean(fish[i][0].box.hitTestObject(bobber.mouth)) && fish[i][3] == 1) { if(bobber.currentFrame != 7) { bobber.gotoAndStop(7); sfx = SFX[0].play(); transformSFX.volume = 1; } if(fish[i][3] == 1) { --fished; } bubblesC.removeChild(fish[i][0]); fish.splice(i,0); i--; } i++; } } else { i = 0; while(i < fish.length) { fish[i][0].visible = false; i++; } } i = 0; while(i < splashes.length) { if(splashes[i].currentFrame == 20) { effects.removeChild(splashes[i]); splashes.splice(i,1); i--; } i++; } i = 0; while(i < particles.length) { particles[i][1].x += particles[i][2].x; particles[i][1].y += particles[i][2].y; particles[i][1].scale(particles[i][3]); particles[i][0].x += particles[i][1].x; particles[i][0].y += particles[i][1].y; particles[i][0].rotation += particles[i][4]; --particles[i][5]; if(particles[i][5] < 0) { particles[i][0].alpha -= 0.08; } if(particles[i][0].alpha <= 0) { effects.removeChild(particles[i][0]); particles.splice(i,1); i--; } i++; } if(controls == 2) { if(kA) { bobber.scaleX = 1; } if(kD) { bobber.scaleX = -1; } } if(bobber.currentFrame == 5 && bobber.ani.currentFrame == 3) { bobber.gotoAndStop(3); } ++ttt; if(ttt > 4) { ttt = 0; } if(bobber.currentFrame == 4 && ttt == 0) { nnn = splashes.push(new Dust()) - 1; effects.addChild(splashes[nnn]); GR = new Vector(planets[currentPlanet][0].x - bobber.x,planets[currentPlanet][0].y - bobber.y); GR.length -= charH; splashes[nnn].x = planets[currentPlanet][0].x - GR.x; splashes[nnn].scaleX = bobber.scaleX; splashes[nnn].y = planets[currentPlanet][0].y - GR.y; splashes[nnn].rotation = Vector.angle2(new Vector(0,1),GR); } if(controls == 2 && bobber.currentFrame != 3 && bobber.currentFrame != 2 && bobber.currentFrame != 5) { if(bobber.currentFrame == 4) { if(!kA && !kD) { bobber.gotoAndStop(3); } } else { bobber.gotoAndStop(5); nnn = splashes.push(new Poof()) - 1; effects.addChild(splashes[nnn]); GR = new Vector(planets[currentPlanet][0].x - (bobber.x + speed.x),planets[currentPlanet][0].y - (bobber.y + speed.y)); GR.length -= charH; splashes[nnn].x = planets[currentPlanet][0].x - GR.x; splashes[nnn].y = planets[currentPlanet][0].y - GR.y; splashes[nnn].rotation = Vector.angle2(new Vector(0,1),GR); } } if(controls == 2 && (kA || kD) && bobber.currentFrame != 4 && bobber.currentFrame != 2 && bobber.currentFrame != 5) { bobber.gotoAndStop(4); ttt = 4; } if(faderTIM > 0) { fader = 3; --faderTIM; } else { fader = 1; } Gravity = new Vector(planets[0][0].x - bobber.x,planets[0][0].y - bobber.y); strn = Gravity.length; Gravity.length = 672.35 / strn * 2; if(Gravity.length > 1) { Gravity.length = 1; } dir.d1.rotation = Vector.angle2(new Vector(0,-1),Gravity); transform1.volume = Gravity.length * 1.5 / fader; bg.b1.alpha = Gravity.length * 1.2 - 0.2; Gravity = new Vector(planets[1][0].x - bobber.x,planets[1][0].y - bobber.y); strn = Gravity.length; Gravity.length = 672.35 / strn * 2; if(Gravity.length > 1) { Gravity.length = 1; } dir.d2.rotation = Vector.angle2(new Vector(0,-1),Gravity); if(gassed == 0) { transform2.volume = 0.65 / fader; if(won[0] == false) { flasher.play(); planets[1][0].gotoAndStop(2); won[0] = true; transformW.volume = 1.5; channelW.soundTransform = transformW; channelW = win1.play(); faderTIM = 120; } } else { transform2.volume = Gravity.length / fader; } bg.b2.alpha = Gravity.length * 1.2 - 0.2; Gravity = new Vector(planets[2][0].x - bobber.x,planets[2][0].y - bobber.y); strn = Gravity.length; Gravity.length = 672.35 / strn * 2; if(Gravity.length > 1) { Gravity.length = 1; } dir.d3.rotation = Vector.angle2(new Vector(0,-1),Gravity); if(gemed) { transform3.volume = 1 / fader; if(won[1] == false) { flasher.play(); planets[2][0].gotoAndStop(2); foregrounds[1].gotoAndStop(2); stage.invalidate(); won[1] = true; transformW.volume = 1.75; channelW.soundTransform = transformW; channelW = win2.play(); faderTIM = 120; } } else { transform3.volume = Gravity.length * 1.3 / fader; } bg.b3.alpha = Gravity.length * 1.2 - 0.2; Gravity = new Vector(planets[3][0].x - bobber.x,planets[3][0].y - bobber.y); strn = Gravity.length; Gravity.length = 672.35 / strn * 2; if(Gravity.length > 1) { Gravity.length = 1; } dir.d4.rotation = Vector.angle2(new Vector(0,-1),Gravity); if(fished == 0) { transform4.volume = 0.8 / fader; if(won[2] == false) { flasher.play(); planets[3][0].gotoAndStop(2); foregrounds[2].gotoAndStop(2); planets[9][0].gotoAndStop(2); won[2] = true; transformW.volume = 1.5; channelW.soundTransform = transformW; channelW = win3.play(); faderTIM = 120; } } else { transform4.volume = Gravity.length * 1.3 / fader; } bg.b4.alpha = Gravity.length * 1.2 - 0.2; Gravity = new Vector(planets[4][0].x - bobber.x,planets[4][0].y - bobber.y); strn = Gravity.length; Gravity.length = 672.35 / strn * 2; if(Gravity.length > 1) { Gravity.length = 1; } dir.d5.rotation = Vector.angle2(new Vector(0,-1),Gravity); if(mooned == 4) { transform5.volume = 1 / fader; if(won[3] == false) { flasher.play(); won[3] = true; transformW.volume = 2; channelW.soundTransform = transformW; channelW = win4.play(); faderTIM = 120; } } else { transform5.volume = Gravity.length * 2 / fader; } bg.b5.alpha = Gravity.length * 1.2 - 0.2; sfx.soundTransform = transformSFX; channel1.soundTransform = transform1; channel2.soundTransform = transform2; channel3.soundTransform = transform3; channel4.soundTransform = transform4; channel5.soundTransform = transform5; channelB.soundTransform = transformB; Gravity = new Vector(0,0); i = 0; while(i < 5) { planet = planets[i][0]; planet1mass = planets[i][1]; planet1r = planets[i][2]; GR = new Vector(planet.x - bobber.x,planet.y - bobber.y); str = GR.length; GR.length = planet1mass / (str * str); Gravity.x += GR.x; Gravity.y += GR.y; i++; } if(Gravity.length > 5) { targSiz = 900 - 5 * 70; } else { targSiz = 900 - Gravity.length * 70; } i = 5; while(i < planets.length) { planet = planets[i][0]; planet1mass = planets[i][1]; planet1r = planets[i][2]; GR = new Vector(planet.x - bobber.x,planet.y - bobber.y); str = GR.length; GR.length = planet1mass / (str * str); Gravity.x += GR.x; Gravity.y += GR.y; i++; } if(Gravity.length > 5) { Gravity.length = 5; } if(!ended) { cam.w += (cam.w - targSiz) / -4; cam.h += (cam.h - targSiz) / -4; cam.r += Vector.angle2(new Vector(0,1).rotateNew(cam.r),Gravity) / 8; } dir.x = cam.x; dir.y = cam.y; bg.x = cam.x; bg.y = cam.y; bg.rotation = cam.r; i = 0; while(i < 5) { planet = planets[i][0]; GR = new Vector(planet.x - cam.x,planet.y - cam.y); if(GR.length > 2000) { planet.visible = false; } else { planet.visible = true; } i++; } i = 0; while(i < foregrounds.length) { planet = foregrounds[i]; GR = new Vector(planet.x - cam.x,planet.y - cam.y); if(GR.length > 2000) { planet.visible = false; } else { planet.visible = true; } i++; } if(isNaN(bobber.rotation) || bobber.rotation == undefined) { bobber.rotation = 0; } if(speed.x == undefined || isNaN(speed.x) || speed.y == undefined || isNaN(speed.y)) { speed.x = 0; speed.y = 0; } if(namesT != 0) { --namesT; names.visible = true; if(names.alpha < 1) { names.alpha += 0.03; } } else if(names.alpha > 0) { names.alpha -= 0.03; } else { names.visible = false; } dir.d2.visible = !won[0]; dir.d3.visible = !won[1]; dir.d4.visible = !won[2]; dir.d5.visible = !won[3]; if(planets[0][0].currentFrame == 6) { dir.d1.visible = false; } winned = int(won[0]) + int(won[1]) + int(won[2]) + int(won[3]); if(planets[0][0].currentFrame != winned + 1 && planets[0][0].currentFrame != 6) { planets[0][0].gotoAndStop(winned + 1); planets[0][2] = earths[winned - 1]; } talk.scaleX = cam.sx + 0.3; talk.scaleY = cam.sy + 0.3; dir.scaleX = cam.sx; dir.scaleY = cam.sy; bg.scaleX = cam.sy; bg.scaleY = cam.sy; cam.update(); } catch(e:Error) { } } internal function frame4() : * { stop(); linkAG.addEventListener(MouseEvent.CLICK,ag_btnclick,false,0,true); linkAG2.addEventListener(MouseEvent.CLICK,ag_btnclick2,false,0,true); linkGG.addEventListener(MouseEvent.CLICK,gg_btnclick,false,0,true); linkED.addEventListener(MouseEvent.CLICK,ed_btnclick,false,0,true); btn1.addEventListener(MouseEvent.CLICK,playBTN,false,0,true); btn3.addEventListener(MouseEvent.CLICK,downloadable,false,0,true); } public function mouseHandelerD(param1:MouseEvent) : * { if(!paus) { kM = true; } } public function lockControls() : * { kW = false; kS = false; kA = false; kD = false; kUp = false; kDown = false; kLeft = false; kRight = false; kM = false; kSpace = false; } public function mouseHandelerU(param1:MouseEvent) : * { if(!paus) { kM = false; } } public function gg_btnclick(param1:MouseEvent) : * { navigateToURL(new URLRequest("http://www.glaielgames.com"),"_blank"); } public function credy() : * { framey = "credits"; fadery.play(); } public function downloadable(param1:MouseEvent) : * { navigateToURL(new URLRequest("http://www.armorgames.com/misc/downloads/aether.zip"),"_blank"); } public function expl(param1:MouseEvent) : * { explode = true; } public function goBTN2(param1:Event) : * { cut.play(); } public function calculatepcent(param1:ProgressEvent) : * { loadPerc = param1.bytesLoaded / param1.bytesTotal; } public function playBTN(param1:Event) : * { framey = "cutscene"; fadery.play(); } public function aliem() : * { var _loc1_:int = 0; var _loc2_:int = 0; var _loc3_:int = 0; var _loc4_:int = 0; var _loc5_:int = 0; var _loc6_:int = 0; var _loc7_:int = 0; var _loc8_:Vector = null; var _loc9_:Vector = null; var _loc10_:int = 0; var _loc11_:MovieClip = null; var _loc12_:* = undefined; var _loc13_:* = undefined; var _loc14_:Vector = null; var _loc15_:Number = NaN; aliens.push(new Array(new Hippo(),1,2,0,0.4,new Array("\nSometimes my stomach hurts...","\nI\'ll be happy when I\'m dead."),new Vector(100,-90))); aliens.push(new Array(new Bird(),1,100,0,3,new Array("\nIt\'s sad to be alone.","\nAt least no one can hurt me here."),new Vector(50,-50))); _loc1_ = 0; while(_loc1_ < 15) { aliens.push(new Array(new Bird(),1.1,2,0,0.8,new Array(""),new Vector(0,0))); _loc1_++; } aliens.push(new Array(new Boy1(),1,1,0,1,new Array("\nI\'m stuck \nhere because I\'m  bad.","I\'m going to blow this place up one day."),new Vector(70,-80))); aliens.push(new Array(new Boy2(),1.2,1,0,1,new Array("...\nWhy do you look like me?\n..."),new Vector(0,-170))); aliens.push(new Array(new Dead(),1.2,12,0,1,new Array("\nI\'m cool cause I\'m dead.","\n\nMy feet itch..."),new Vector(50,-70))); aliens.push(new Array(new Screamo2(),1,11,0,1,new Array("\n\nAAAAHHHHH!!","\n\nDon\'t Hurt Me!"),new Vector(70,-90))); _loc2_ = 0; while(_loc2_ < 4) { aliens.push(new Array(new Screamo1(),1.1,11,0,1.5,new Array(""),new Vector(60,-70))); _loc2_++; } aliens.push(new Array(new Slug(),1.3,4,0,0.2,new Array("I\'ll never amount to anything, they all think I\'m dumb.","\nOne day I\'ll be great and show them all!"),new Vector(140,-130))); aliens.push(new Array(new Sunfish(),2,3,new Vector(3,0),3,new Array("\nYou\'re nothing special.","\nLeave me alone."),new Vector(90,-70),planets[3][2],planets[3][3] - 100,0)); _loc3_ = 0; while(_loc3_ < 70) { _loc7_ = int(aliens.push(new Array(new Wiggle(),2.1,4,new Vector(Math.random() * 4 - 2,Math.random() * 4 - 2),2,new Array(""),new Vector(0,0),planets[4][2] + 20,planets[4][2] + 200,0))); aliens[_loc7_ - 1][0].ani.gotoAndPlay(Math.floor(Math.random() * 16) + 1); _loc3_++; } _loc4_ = 0; while(_loc4_ < 25) { aliens.push(new Array(new Birdy(),2.2,0,new Vector(0,-5),6,new Array(""),new Vector(0,0),planets[0][2],planets[0][2] + 300,0)); _loc4_++; } aliens.push(new Array(new Tube1(),3,14,0,0.4,new Array("\n\nI\'m glad I left.","\nI wonder if they think about me."),new Vector(70,-70))); aliens.push(new Array(new Tube2(),3.2,13,0,0.4,new Array("\nWe are glad he\'s gone."),new Vector(70,-70))); aliens.push(new Array(new Tube2(),3.1,13,0,0.4,new Array(""),new Vector(70,-70))); aliens.push(new Array(new Tube2(),3.1,13,0,0.4,new Array(""),new Vector(70,-70))); _loc5_ = int(aliens.push(new Array(new Runaway(),4,-1,0,0.4,new Array("\nI\'m so outta here!","\nWhere\'s the bathroom?"),new Vector(100,-80))) - 1); aliens[_loc5_][0].x = 0; aliens[_loc5_][0].y = 10000; _loc5_ = int(aliens.push(new Array(new Spaceman(),4,-1,0,0.4,new Array("\nYou really shouldn\'t be out here.","\nIt\'s not safe out here alone."),new Vector(100,-80))) - 1); aliens[_loc5_][0].x = 10000; aliens[_loc5_][0].y = -1000; _loc5_ = int(aliens.push(new Array(new Lost(),4,-1,0,0.4,new Array("\nAm I going to die?"),new Vector(60,-50))) - 1); aliens[_loc5_][0].x = -12000; aliens[_loc5_][0].y = 1000; _loc6_ = 0; while(_loc6_ < aliens.length) { container1.addChild(aliens[_loc6_][0]); if(aliens[_loc6_][1] != 4) { if(aliens[_loc6_][2] != 100) { if(aliens[_loc6_][1] != 1.2) { (_loc8_ = new Vector(planets[aliens[_loc6_][2]][2],0)).rotate(Math.random() * 360); aliens[_loc6_][0].x = planets[aliens[_loc6_][2]][0].x + _loc8_.x; aliens[_loc6_][0].y = planets[aliens[_loc6_][2]][0].y + _loc8_.y; aliens[_loc6_][0].rotation = Vector.angle2(new Vector(0,-1),_loc8_); } else { _loc8_ = new Vector(0,-planets[aliens[_loc6_][2]][2]); aliens[_loc6_][0].x = planets[aliens[_loc6_][2]][0].x + _loc8_.x; aliens[_loc6_][0].y = planets[aliens[_loc6_][2]][0].y + _loc8_.y; aliens[_loc6_][0].rotation = Vector.angle2(new Vector(0,-1),_loc8_); } } else { (_loc8_ = new Vector(planets[2][3],0)).rotate(Math.random() * 360); aliens[_loc6_][0].x = planets[2][0].x + _loc8_.x; aliens[_loc6_][0].y = planets[2][0].y + _loc8_.y; aliens[_loc6_][0].rotation = Vector.angle2(new Vector(0,-1),_loc8_); } } else { _loc9_ = new Vector(0,0); _loc10_ = 0; while(_loc10_ < 5) { _loc11_ = planets[_loc10_][0]; _loc12_ = planets[_loc10_][1]; _loc13_ = planets[_loc10_][2]; _loc15_ = (_loc14_ = new Vector(_loc11_.x - aliens[_loc6_][0].x,_loc11_.y - aliens[_loc6_][0].y)).length; _loc14_.length = _loc12_ / (_loc15_ * _loc15_); _loc9_.x += _loc14_.x; _loc9_.y += _loc14_.y; _loc10_++; } aliens[_loc6_][0].rotation = Vector.angle2(new Vector(0,1),_loc9_); } _loc6_++; } } public function alien() : * { var _loc1_:int = 0; var _loc2_:Number = NaN; var _loc3_:MovieClip = null; var _loc4_:Number = NaN; var _loc5_:Vector = null; var _loc6_:Vector = null; var _loc7_:Vector = null; var _loc8_:Number = NaN; var _loc9_:Number = NaN; var _loc10_:Vector = null; _loc1_ = 0; while(_loc1_ < aliens.length) { if(aliens[_loc1_][2] != 100 && aliens[_loc1_][2] != -1) { aliens[_loc1_][0].visible = planets[aliens[_loc1_][2]][0].visible; } if(aliens[_loc1_][0].visible) { if(aliens[_loc1_][1] == 1 || aliens[_loc1_][1] == 1.1 || aliens[_loc1_][1] == 1.2 || aliens[_loc1_][1] == 1.3) { if(Math.random() < 0.05) { aliens[_loc1_][3] = (Math.floor(Math.random() * 3) - 1) * aliens[_loc1_][4]; } if(aliens[_loc1_][2] == 2 && aliens[_loc1_][0].y < planets[2][0].y && aliens[_loc1_][0].x - planets[2][0].x < 100 && aliens[_loc1_][0].x - planets[2][0].x >= 0) { aliens[_loc1_][3] = aliens[_loc1_][4]; } if(aliens[_loc1_][2] == 2 && aliens[_loc1_][0].y < planets[2][0].y && aliens[_loc1_][0].x - planets[2][0].x > -100 && aliens[_loc1_][0].x - planets[2][0].x < 0) { aliens[_loc1_][3] = -aliens[_loc1_][4]; } if(aliens[_loc1_][1] == 1.2) { aliens[_loc1_][3] = 0; } if(aliens[_loc1_][2] == 100) { _loc2_ = Number(planets[2][3]); _loc3_ = planets[2][0]; } else { _loc2_ = Number(planets[aliens[_loc1_][2]][2]); _loc3_ = planets[aliens[_loc1_][2]][0]; } _loc4_ = (aliens[_loc1_][0].x - bobber.x) * (aliens[_loc1_][0].x - bobber.x) + (aliens[_loc1_][0].y - bobber.y) * (aliens[_loc1_][0].y - bobber.y); if(aliens[_loc1_][1] != 1.1) { if(_loc4_ < 100 * 100 || _loc4_ < 150 * 150 && aliens[_loc1_][1] == 1.3) { if(talph == 0) { if(aliens[_loc1_][0].currentFrame != 3 && aliens[_loc1_][0].currentFrame != 4) { if(aliens[_loc1_][1] == 1.3) { _loc5_ = new Vector(aliens[_loc1_][0].y - bobber.y,-aliens[_loc1_][0].x + bobber.x); if(Vector.dot(_loc5_,Gravity) < 0) { aliens[_loc1_][0].gotoAndStop(4); talk.visible = true; talk.txt.text = aliens[_loc1_][5][0]; talph = 1; talk.bubb.scaleX = 1; } else { aliens[_loc1_][0].gotoAndStop(3); talk.visible = true; talk.txt.text = aliens[_loc1_][5][1]; talph = 1; talk.bubb.scaleX = -1; } _loc6_ = new Vector(talk.bubb.scaleX * -aliens[_loc1_][6].x * talk.scaleX,aliens[_loc1_][6].y * talk.scaleY); if(talk.bubb.scaleX == 1) { _loc6_.y = -90; } _loc6_.rotate(Vector.angle2(new Vector(0,-1),new Vector(0,-1).rotateNew(aliens[_loc1_][0].rotation))); talk.x = aliens[_loc1_][0].x + _loc6_.x; talk.y = aliens[_loc1_][0].y + _loc6_.y; talk.rotation = aliens[_loc1_][0].rotation; } else { aliens[_loc1_][0].gotoAndStop(3); talk.visible = true; talk.txt.text = aliens[_loc1_][5][Math.floor(Math.random() * aliens[_loc1_][5].length)]; talph = 1; } } } if(talph == 1 && (aliens[_loc1_][0].currentFrame == 3 || aliens[_loc1_][0].currentFrame == 4)) { if(aliens[_loc1_][1] != 1.2 && aliens[_loc1_][1] != 1.3) { _loc5_ = new Vector(aliens[_loc1_][0].y - bobber.y,-aliens[_loc1_][0].x + bobber.x); if(Vector.dot(_loc5_,Gravity) < 0) { aliens[_loc1_][0].scaleX = 1; } else { aliens[_loc1_][0].scaleX = -1; } } if(aliens[_loc1_][1] != 1.3) { (_loc6_ = new Vector(aliens[_loc1_][0].scaleX * -aliens[_loc1_][6].x * talk.scaleX,aliens[_loc1_][6].y * talk.scaleY)).rotate(Vector.angle2(new Vector(0,-1),new Vector(0,-1).rotateNew(aliens[_loc1_][0].rotation))); talk.x = aliens[_loc1_][0].x + _loc6_.x; talk.y = aliens[_loc1_][0].y + _loc6_.y; talk.rotation = aliens[_loc1_][0].rotation; talk.bubb.scaleX = aliens[_loc1_][0].scaleX; } } } else if((aliens[_loc1_][0].currentFrame == 3 || aliens[_loc1_][0].currentFrame == 4) && (_loc4_ > 150 * 150 && aliens[_loc1_][1] != 1.3 || _loc4_ > 200 * 200 && aliens[_loc1_][1] == 1.3)) { if(aliens[_loc1_][0].currentFrame == 3 || aliens[_loc1_][0].currentFrame == 4) { aliens[_loc1_][0].gotoAndStop(1); talph = 0; } } } if(aliens[_loc1_][3] != 0 && aliens[_loc1_][0].currentFrame != 3 && aliens[_loc1_][0].currentFrame != 4) { (_loc7_ = new Vector(aliens[_loc1_][0].x - _loc3_.x,aliens[_loc1_][0].y - _loc3_.y)).rotate(aliens[_loc1_][3]); _loc7_.length = _loc2_; if(aliens[_loc1_][1] != 1.3) { if(aliens[_loc1_][3] > 0) { aliens[_loc1_][0].scaleX = -1; } else { aliens[_loc1_][0].scaleX = 1; } } if(aliens[_loc1_][0].currentFrame == 1) { aliens[_loc1_][0].gotoAndStop(2); } aliens[_loc1_][0].x = _loc3_.x + _loc7_.x; aliens[_loc1_][0].y = _loc3_.y + _loc7_.y; aliens[_loc1_][0].rotation = Vector.angle2(new Vector(0,-1),_loc7_); } else if(aliens[_loc1_][0].currentFrame == 2) { aliens[_loc1_][0].gotoAndStop(1); } if(aliens[_loc1_][2] == 1 && gassed == 0) { container1.removeChild(aliens[_loc1_][0]); aliens.splice(_loc1_,1); _loc1_--; } } } if(aliens[_loc1_][1] == 2.2) { aliens[_loc1_][7] = planets[0][2]; if(planets[0][2] < 100) { container1.removeChild(aliens[_loc1_][0]); aliens.splice(_loc1_,1); _loc1_--; } } if(aliens[_loc1_][1] == 2 || aliens[_loc1_][1] == 2.1 || aliens[_loc1_][1] == 2.2) { _loc8_ = Number(aliens[_loc1_][7]); _loc9_ = Number(aliens[_loc1_][8]); if(aliens[_loc1_][2] == 100) { _loc3_ = planets[2][0]; } else { _loc3_ = planets[aliens[_loc1_][2]][0]; } if((_loc10_ = new Vector(aliens[_loc1_][0].x - _loc3_.x,aliens[_loc1_][0].y - _loc3_.y)).length2 == 0) { _loc10_.x = 0.1; } aliens[_loc1_][0].rotation = Vector.angle2(new Vector(0,-1),_loc10_); if(aliens[_loc1_][1] != 2.1) { aliens[_loc1_][3].rotate(aliens[_loc1_][9]); if(Math.random() < 0.05) { aliens[_loc1_][9] = Math.random() * 20 - 10; } } if(_loc10_.length2 > _loc9_ * _loc9_) { aliens[_loc1_][3].x -= _loc10_.x / _loc10_.length; aliens[_loc1_][3].y -= _loc10_.y / _loc10_.length; } if(_loc10_.length2 < _loc8_ * _loc8_) { aliens[_loc1_][3].x += _loc10_.x / _loc10_.length; aliens[_loc1_][3].y += _loc10_.y / _loc10_.length; if(aliens[_loc1_][1] == 2.2 && aliens[_loc1_][0].currentFrame == 1) { aliens[_loc1_][0].gotoAndStop(4); } } if(aliens[_loc1_][1] != 2.1) { if(Vector.dot(_loc10_.perpendicular(),aliens[_loc1_][3]) < 0) { aliens[_loc1_][0].scaleX = -1; } else { aliens[_loc1_][0].scaleX = 1; } } if(aliens[_loc1_][3].length2 < 1) { aliens[_loc1_][3].length = 1; } if(aliens[_loc1_][3].length2 > aliens[_loc1_][4] * aliens[_loc1_][4]) { aliens[_loc1_][3].length = aliens[_loc1_][4]; } _loc4_ = (aliens[_loc1_][0].x - bobber.x) * (aliens[_loc1_][0].x - bobber.x) + (aliens[_loc1_][0].y - bobber.y) * (aliens[_loc1_][0].y - bobber.y); if(aliens[_loc1_][1] == 2.2 && (_loc4_ < 100 * 100 || Math.random() < 0.005 || _loc10_.length2 > (_loc8_ + 10) * (_loc8_ + 10)) && aliens[_loc1_][0].currentFrame == 4) { aliens[_loc1_][0].gotoAndStop(1); } if(aliens[_loc1_][0].currentFrame != 4) { aliens[_loc1_][0].x += aliens[_loc1_][3].x; aliens[_loc1_][0].y += aliens[_loc1_][3].y; } if(aliens[_loc1_][1] != 2.1 && aliens[_loc1_][1] != 2.2) { if(_loc4_ < 150 * 150) { if(talph == 0) { if(aliens[_loc1_][0].currentFrame != 2 && aliens[_loc1_][0].currentFrame != 3) { aliens[_loc1_][0].gotoAndStop(2); talk.visible = true; talk.txt.text = aliens[_loc1_][5][Math.floor(Math.random() * aliens[_loc1_][5].length)]; talph = 1; } } if(talph == 1 && (aliens[_loc1_][0].currentFrame == 2 || aliens[_loc1_][0].currentFrame == 3)) { (_loc6_ = new Vector(-aliens[_loc1_][0].scaleX * -aliens[_loc1_][6].x * talk.scaleX,aliens[_loc1_][6].y * talk.scaleY)).rotate(Vector.angle2(new Vector(0,-1),new Vector(0,-1).rotateNew(aliens[_loc1_][0].rotation))); talk.x = aliens[_loc1_][0].x + _loc6_.x; talk.y = aliens[_loc1_][0].y + _loc6_.y; talk.rotation = aliens[_loc1_][0].rotation; talk.bubb.scaleX = -aliens[_loc1_][0].scaleX; } } else if((aliens[_loc1_][0].currentFrame == 2 || aliens[_loc1_][0].currentFrame == 3) && _loc4_ > 150 * 150) { if(aliens[_loc1_][0].currentFrame == 2 || aliens[_loc1_][0].currentFrame == 3) { aliens[_loc1_][0].gotoAndStop(1); talph = 0; } } } } if(aliens[_loc1_][1] == 3 || aliens[_loc1_][1] == 3.1 || aliens[_loc1_][1] == 3.2) { _loc4_ = (aliens[_loc1_][0].x - bobber.x) * (aliens[_loc1_][0].x - bobber.x) + (aliens[_loc1_][0].y - bobber.y) * (aliens[_loc1_][0].y - bobber.y); if(aliens[_loc1_][1] == 3) { if(_loc4_ < 150 * 150 && currentPlanet == aliens[_loc1_][2]) { if(aliens[_loc1_][0].currentFrame == 1 && aliens[_loc1_][0].ani != null && aliens[_loc1_][0].ani.currentFrame >= 9) { aliens[_loc1_][0].gotoAndStop(2); } } else if(aliens[_loc1_][0].currentFrame == 2 && aliens[_loc1_][0].ani != null && aliens[_loc1_][0].ani.currentFrame >= 9) { aliens[_loc1_][0].gotoAndStop(1); } } else if(Math.random() < 0.03 && aliens[_loc1_][0].currentFrame != 3) { if(aliens[_loc1_][0].currentFrame == 1 && aliens[_loc1_][0].ani != null && aliens[_loc1_][0].ani.currentFrame >= 9) { aliens[_loc1_][0].gotoAndStop(2); } else if(aliens[_loc1_][0].currentFrame == 2 && aliens[_loc1_][0].ani != null && aliens[_loc1_][0].ani.currentFrame >= 9) { aliens[_loc1_][0].gotoAndStop(1); } } if(_loc4_ < 50 * 50 && aliens[_loc1_][0].currentFrame == 2) { if(talph == 0 && aliens[_loc1_][1] != 3.1) { if(aliens[_loc1_][0].currentFrame == 2 && aliens[_loc1_][0].ani != null && aliens[_loc1_][0].ani.currentFrame >= 9) { aliens[_loc1_][0].gotoAndStop(3); talk.visible = true; talk.txt.text = aliens[_loc1_][5][Math.floor(Math.random() * aliens[_loc1_][5].length)]; talph = 1; talk.bubb.scaleX = 1; (_loc6_ = new Vector(aliens[_loc1_][0].scaleX * -aliens[_loc1_][6].x * talk.scaleX,aliens[_loc1_][6].y * talk.scaleY)).rotate(Vector.angle2(new Vector(0,-1),new Vector(0,-1).rotateNew(aliens[_loc1_][0].rotation))); talk.x = aliens[_loc1_][0].x + _loc6_.x; talk.y = aliens[_loc1_][0].y + _loc6_.y; talk.rotation = aliens[_loc1_][0].rotation; talk.bubb.scaleX = aliens[_loc1_][0].scaleX; } } } if(_loc4_ > 100 * 100 && aliens[_loc1_][0].currentFrame == 3) { talph = 0; aliens[_loc1_][0].gotoAndStop(1); } } if(aliens[_loc1_][1] == 4) { if((_loc4_ = (aliens[_loc1_][0].x - bobber.x) * (aliens[_loc1_][0].x - bobber.x) + (aliens[_loc1_][0].y - bobber.y) * (aliens[_loc1_][0].y - bobber.y)) < 150 * 150) { if(talph == 0) { if(aliens[_loc1_][0].currentFrame == 1) { aliens[_loc1_][0].gotoAndStop(2); talk.visible = true; talk.txt.text = aliens[_loc1_][5][Math.floor(Math.random() * aliens[_loc1_][5].length)]; talph = 1; talk.bubb.scaleX = 1; (_loc6_ = new Vector(aliens[_loc1_][0].scaleX * -aliens[_loc1_][6].x * talk.scaleX,aliens[_loc1_][6].y * talk.scaleY)).rotate(Vector.angle2(new Vector(0,-1),new Vector(0,-1).rotateNew(aliens[_loc1_][0].rotation))); talk.x = aliens[_loc1_][0].x + _loc6_.x; talk.y = aliens[_loc1_][0].y + _loc6_.y; talk.rotation = aliens[_loc1_][0].rotation; talk.bubb.scaleX = aliens[_loc1_][0].scaleX; } } } if(_loc4_ > 200 * 200 && aliens[_loc1_][0].currentFrame == 2) { talph = 0; aliens[_loc1_][0].gotoAndStop(1); } } _loc1_++; } talk.alpha += (talph - (talk.alpha - (talph - 0.5))) / 10; if(talk.alpha < 0.01) { talk.visible = false; } else { talk.visible = true; } } public function backBTN2(param1:Event) : * { framey = "title"; fadery.play(); } public function shake(param1:Event) : * { var e:Event = param1; try { if(clouds[8][1] != -1) { clouds[8][0].gaser.poppy.gotoAndPlay(Math.floor(Math.random() * 5) + 1); } if(clouds[9][1] != -1) { clouds[9][0].gaser.poppy.gotoAndPlay(Math.floor(Math.random() * 5) + 1); } if(clouds[10][1] != -1) { clouds[10][0].gaser.poppy.gotoAndPlay(Math.floor(Math.random() * 5) + 1); } if(clouds[11][1] != -1) { clouds[11][0].gaser.poppy.gotoAndPlay(Math.floor(Math.random() * 5) + 1); } if(gemed && inside) { foregrounds[1].planet.gotoAndStop(30); planets[2][0].planet.gotoAndStop(30); } } catch(e:Error) { } } public function uexpl(param1:MouseEvent) : * { explode = false; } } }