STORY   LOOP   FURRY   PORN   GAMES
• C •   SERVICES [?] [R] RND   POPULAR
Archived flashes:
201998
/disc/ · /res/     /show/ · /fap/ · /gg/ · /swf/P0001 · P2193 · P4386

<div style="position:absolute;top:-99px;left:-99px;"><img src="http://swfchan.com:57475/38956763?noj=FRM38956763-21DC" width="1" height="1"></div>

ARIA Arielle Story.swf

This is the info page for
Flash #217524

(Click the ID number above for more basic data on this flash file.)


ActionScript [AS1/AS2]
Combined Code
movieClip 10 aria_laser { #initclip Object.registerClass('aria_laser', FixOnLoad); #endinitclip frame 8 { stop(); this.unloadMovie(); removeMovieClip(this); } } movieClip 13 { } movieClip 23 { frame 1 { stop(); } } movieClip 24 { frame 1 { stop(); } frame 2 { stop(); } instance aria of movieClip 23 { onClipEvent (load) { this.gotoAndStop(_global.aria_girl); } } } movieClip 27 { } movieClip 28 { frame 1 { stop(); } } movieClip 30 { } movieClip 31 { frame 1 { stop(); } frame 20 { gotoAndStop(1); } } movieClip 36 { frame 1 { stop(); } } movieClip 39 { } movieClip 42 { } button 43 { on (release) { if (sphere_selection._currentframe == 1) { sphere_selection.gotoAndStop(2); _root.previous_selection = _root.current_selection; _root.current_selection = this; if (_root.current_selection != null && _root.previous_selection != null && _root.previous_selection.units > 1 && _root.previous_selection != _root.current_selection && _root.spheres_under_your_control[_root.previous_selection.fleet_number] == 1) { _root.create_laser(_root.current_selection, _root.previous_selection); _root.create_your_attack_squad(_root.current_selection, _root.previous_selection, Math.floor(_root.previous_selection.units / 2)); } } else { sphere_selection.gotoAndStop(1); } } } movieClip 45 sphere { frame 1 { stop(); } instance sphere_control of movieClip 24 { onClipEvent (enterFrame) { if (_root.spheres_under_your_control[_parent.fleet_number] == 1) { this.gotoAndStop(2); } if (_parent.units < 1000) { _parent.gotoAndStop(_parent.units + 1); } else { _parent.gotoAndStop(1000); } } } } movieClip 47 e3 { } movieClip 52 { } movieClip 55 { } movieClip 59 { } movieClip 60 e2 { } movieClip 64 { } movieClip 67 e1 { } movieClip 71 { } movieClip 76 { } movieClip 81 { } movieClip 86 { } movieClip 91 { } movieClip 96 { } movieClip 101 { } movieClip 106 { } movieClip 111 { } movieClip 116 { } movieClip 121 { } movieClip 124 { frame 1 { stop(); } } movieClip 125 enemy_ship { } movieClip 128 { } movieClip 129 e4 { } frame 1 { stop(); } movieClip 138 { } movieClip 142 { } movieClip 144 { } movieClip 146 { } movieClip 147 { frame 1 { function myWidth(moveObj, newWidth) { moveObj.w = moveObj._width; moveObj.dwidth = newWidth - moveObj.w; moveObj.t = 0; NFRAMES = 6; moveObj.onEnterFrame = function () { if (moveObj.t++ < NFRAMES) { moveObj._width = easeOutQuad(moveObj.t, moveObj.w, moveObj.dwidth, NFRAMES); } else { delete this.onEnterFrame; } }; } function myMove(moveObj, newX) { moveObj.x = moveObj._x; moveObj.dx = newX - moveObj.x; moveObj.t = 0; NFRAMES = 6; moveObj.onEnterFrame = function () { if (moveObj.t++ < NFRAMES) { moveObj._x = easeOutQuad(moveObj.t, moveObj.x, moveObj.dx, NFRAMES); } else { delete this.onEnterFrame; } }; } percentLoaded = Math.round((_root.getBytesLoaded() / _root.getBytesTotal()) * 100); this.myWidth(this.loadBar, percentLoaded * 1.94); this.myMove(this.mc_loadNum, percentLoaded * 1.9 - 8); mc_loadNum.loadNum.text = percentLoaded; easeOutQuad = function (time, beginX, changeX, durationX) { time /= durationX / 2; if (time < 1) { return (changeX / 2) * time * time + beginX; } return (-changeX / 2) * (--time * (time - 2) - 1) + beginX; }; } frame 2 { if (percentLoaded < 100) { gotoAndPlay('loading'); } } frame 25 { _root.gotoAndStop(33); } } movieClip 528 __Packages.FixOnLoad { #initclip if (!_global.FixOnLoad) { var v1 = function () { super(); }; _global.FixOnLoad = v1; _global.FixOnLoad extends MovieClip; var v2 = v1.prototype; v2.onLoad = function () {}; ASSetPropFlags(_global.FixOnLoad.prototype, null, 1); } #endinitclip } frame 2 { stop(); } movieClip 151 { } movieClip 157 { frame 1 { stop(); } } button 159 { on (release) { _parent.nextFrame(); stext.gotoAndStop(2); play(); } } movieClip 160 { frame 4 { stext.gotoAndStop(1); } frame 5 { stop(); } frame 10 { gotoAndPlay(1); } } movieClip 161 { frame 1 { stop(); } frame 1 { stext.stext.story_text = 'Arielle: Sir? you wanted to speak with me?'; } frame 2 { stext.stext.story_text = 'Harold: My my, my dear you are looking lovely in that suit.'; } frame 3 { stext.stext.story_text = 'Arielle: Thank you sir. What is it you wanted to talk about?'; } frame 4 { stext.stext.story_text = 'Harold: ...Huh? Ah yes! It is about that good for nothing Jeo!'; } frame 5 { stext.stext.story_text = 'Arielle: We were supposed to meet earlier to discuss your mission parameters. Do you know what happened to him?'; } frame 6 { stext.stext.story_text = 'Harold: He won\'t be coming! the traitor! He has ran off after attacking Miss Lynnelle!'; } frame 7 { stext.stext.story_text = 'Arielle: What? That has to be a joke, he would never do that.'; } frame 8 { stext.stext.story_text = 'Harold: Well he did! And we already have teams looking for him!'; } frame 9 { stext.stext.story_text = 'Arielle: Maybe I should go find him myself and find out what really happened.'; } frame 10 { stext.stext.story_text = 'Harold: I\'m telling you what happened! And keep your mouth shut about it. It is classified.'; } frame 11 { stext.stext.story_text = 'Harold: Only the scouting teams and upper execs know about it. I wasn\'t even supposed to tell you.'; } frame 12 { stext.stext.story_text = 'Harold: You have also been ordered to remain here. And your ship\'s MLaWs has been disabled.'; } frame 13 { stext.stext.story_text = 'Arielle: What!? why!?'; } frame 14 { stext.stext.story_text = 'Harold: Why do you think Ari!? You will run after him!'; } frame 15 { stext.stext.story_text = 'Arielle: ...'; } frame 16 { stext.stext.story_text = 'Harold: ...That is all Ari. Dismissed.'; } frame 17 { stext.stext.story_text = 'Arielle: But...'; } frame 18 { stext.stext.story_text = 'Harold: I\'m not even sure why you like that selfish prick anyway.'; } frame 19 { stext.stext.story_text = 'Harold: You belong to me! Got it? Forget about him, he is a traitor now.'; } frame 20 { stext.stext.story_text = 'Arielle: Understood sir...'; } frame 21 { stext.stext.story_text = 'Harold: Good now get back to you duties.'; } frame 22 { _root.gotoAndStop(3); } } button 162 { on (release) { _root.gotoAndStop(19); } } button 163 { on (release) { _root.gotoAndStop(27); } } button 164 { on (release) { _root.gotoAndStop(15); } } movieClip 166 { frame 1 { if (_global.music == 0) { gotoAndStop(1); } } } movieClip 173 { } movieClip 174 { frame 1 { stop(); } frame 1 { stext.stext.story_text = 'Arielle: Sire... requesting permission to leave...'; } frame 2 { stext.stext.story_text = 'Sire: Hell no.'; } frame 3 { stext.stext.story_text = 'Arielle: But!'; } frame 4 { stext.stext.story_text = 'Sire: Ari!... I\'m sure Harold has told you the situation Jeo is in correct ?'; } frame 5 { stext.stext.story_text = 'Arielle: yes...'; } frame 6 { stext.stext.story_text = 'Sire: Then stay put! This conversation is over. '; } frame 7 { stext.stext.story_text = 'Arielle: ...'; } frame 8 { stext.stext.story_text = 'Sire: ...'; } frame 9 { stext.stext.story_text = 'Sire: Wait! ...'; } frame 10 { stext.stext.story_text = 'Arielle: Sir ?'; } frame 11 { stext.stext.story_text = 'Sire: If Harold tells me personally that it is ok, then you can leave.'; } frame 12 { stext.stext.story_text = 'Sire: I don\'t know anyone else who can find him without putting themselves in danger.'; } frame 13 { stext.stext.story_text = 'Arielle: Thank you! I will go ask him.'; } frame 14 { _root.gotoAndStop(4); } } movieClip 348 { frame 12 { gotoAndPlay(1); } frame 94 { stop(); } } button 349 { on (release) { gotoAndPlay(24); } } movieClip 354 { frame 1 { stop(); } frame 1 { stext.stext.story_text = 'Harold: Ah back again Ari. And what have you been up to I wonder heh heh.'; } frame 2 { stext.stext.story_text = 'Arielle: Sir, I need your permission to leave.'; } frame 3 { stext.stext.story_text = 'Harold: Oh? I wonder what for? hm ?'; } frame 4 { stext.stext.story_text = 'Arielle: Please sir.'; } frame 5 { stext.stext.story_text = 'Harold: Hmm maybe if you do me a small favor...'; } frame 6 { stext.stext.story_text = 'Arielle: Again?... I gave you favor this morning, so this was your plan all along.'; } frame 7 { stext.stext.story_text = 'Harold: Yes we can continue yo help each other out, just as it always has been.'; } frame 8 { stext.stext.story_text = 'Arielle: ...yes sir.'; } frame 9 { _root.sexfx.gotoAndPlay(2); _root.music.stop(); } frame 9 { stext.stext.story_text = 'Harold: Ahh!! this feels so good. It feels better when you are so desperate to find that fool Jeo hah hah!'; } frame 10 { stext.stext.story_text = 'Harold: You must reeeally want to find him. Your pussy is so warm and wet!'; } frame 11 { stext.stext.story_text = 'Harold: But you belong to me, and only me!'; } frame 12 { stext.stext.story_text = 'Harold: Who\'s you daddy? Say it!'; } frame 13 { stext.stext.story_text = 'Arielle: You are daddy.'; } frame 14 { stext.stext.story_text = 'Harold: You like this dick baby?'; } frame 15 { stext.stext.story_text = 'Arielle: I love your dick daddy.'; } frame 16 { stext.stext.story_text = 'Harold: What was that Ari? I can\'t hear you!'; } frame 17 { stext.stext.story_text = 'Arielle: I LOVE YOUR DICK DADDY!'; } frame 18 { stext.stext.story_text = 'Arielle: KEEP FUCKING ME WITH YOUR BIG DICK DADDY!'; } frame 19 { stext.stext.story_text = 'Arielle: Cum in my pussy daddy...'; } instance h of movieClip 348 { onClipEvent (load) { this.gotoAndPlay(13); } } frame 20 { stext.stext.story_text = 'Harold: Ahhh!! Damn! So such came out this time! hah!'; } frame 21 { stext.stext.story_text = 'Harold: I love it when you call me daddy heh heh.'; } frame 22 { stext.stext.story_text = 'Arielle: Can you put me down now please?'; } frame 23 { _root.sexfx.gotoAndStop(1); _root.music.play(); } frame 24 { stext.stext.story_text = 'Harold: Hurry up! Are you going or not? You already have permission.'; } frame 25 { stext.stext.story_text = 'Arielle: Thank you... Harold.'; } frame 26 { stext.stext.story_text = 'Harold: As long as you remain my woman I will help you when I can Ari.'; } frame 27 { stext.stext.story_text = 'Harold: Betray me and I will have to break you.'; } frame 28 { stext.stext.story_text = 'Arielle: ...Understood sir.'; } frame 29 { stext.stext.story_text = 'Harold: Now go finish putting on your gear.'; } frame 30 { stext.stext.story_text = 'Harold: You will be alone. But your team will find you later. If they are competent.'; } frame 31 { stext.stext.story_text = 'Arielle: Tiffany? She should be able to find me.'; } frame 32 { stext.stext.story_text = 'Harold: Well good. Keep in mind no one knows about this, but a few important people.'; } frame 33 { stext.stext.story_text = 'Harold: Everyone will assume you are under orders to remain here.'; } frame 34 { stext.stext.story_text = 'Harold: Also your ship is not space combat ready. Dr. Taylor should help you with that thoguh.'; } frame 35 { stext.stext.story_text = 'Arielle: That should be good enough. I\'ll manage without MLaWs for now.'; } frame 36 { stext.stext.story_text = 'Arielle: I will return with Jeo dead or alive sir.'; } frame 37 { stext.stext.story_text = 'Harold: Good girl. Now get going.'; } frame 38 { _root.gotoAndStop(5); } } movieClip 356 { frame 2 { if (_global.music == 0) { gotoAndStop(1); } } } instance sexfx of movieClip 356 { onClipEvent (load) { this.gotoAndStop(1); } } movieClip 360 { frame 1 { stop(); } frame 1 { stext.stext.story_text = 'Arielle: Jeo I hope you haven\'t done anything stupid... again.'; } frame 2 { _root.gotoAndStop(15); } } movieClip 361 { frame 1 { stop(); } frame 1 { stext.stext.story_text = 'Yui: Agent Arielle. Stand down. I can\'t let you go any further. You are to remain at headquarters.'; } frame 2 { stext.stext.story_text = 'Arielle: Don\'t get in my way!'; } frame 3 { _root.gotoAndStop(19); } } movieClip 362 { frame 1 { stop(); } frame 1 { stext.stext.story_text = 'Arielle: : More attack ships? Identify yourselves or I will shoot. Ugh you guys are so annoying!'; } frame 2 { stext.stext.story_text = 'TT: Agent Arielle, this is Tiffany Taylor We were sent by Harold\'s-'; } frame 3 { stext.stext.story_text = 'Arielle: TIFFANY! FINALLY!'; } frame 4 { stext.stext.story_text = 'TT: Greetings Arielle. It’s been a while.'; } frame 5 { stext.stext.story_text = 'Arielle: Oh! Sorry. I\'m just bit stressed out at the moment.'; } frame 6 { stext.stext.story_text = 'TT: No problem Arielle. I am docked at a nearby abandoned space station, I\'m glad my forces were able to catch up to you.'; } frame 7 { stext.stext.story_text = 'Arielle: Tiffany do you have anything for me ? My ship is lacking the usual stuff...'; } frame 8 { stext.stext.story_text = 'TT: Yes I have your MLaWs and there are some resources here at the station. Make you way back here with the crew.'; } frame 9 { stext.stext.story_text = 'Arielle: I got your coordinates. I\'m on my way.'; } frame 10 { _root.gotoAndStop(21); } } movieClip 376 { frame 1 { stop(); } frame 1 { stext.stext.story_text = 'TT: All done.'; } frame 2 { stext.stext.story_text = 'Arielle: Tiffany thank you! I could kiss you right now!.'; } frame 3 { stext.stext.story_text = 'TT: Oh?'; } frame 4 { stext.stext.story_text = 'Phia: You have to watch what you say around this one sweetie!'; } frame 5 { stext.stext.story_text = 'Arielle: Phia! when did you get here?'; } frame 6 { stext.stext.story_text = 'Phia: I\'ve been here sweetie. Bri is here too.'; } frame 7 { stext.stext.story_text = 'Arielle: Oh... I guess I was distracted by my thoughts.'; } frame 8 { stext.stext.story_text = 'Arielle: I guess Bri is our failsafe plan?...'; } frame 9 { stext.stext.story_text = 'TT: Correct.'; } frame 10 { stext.stext.story_text = 'Arielle: Hello Bri. Sorry I missed you earlier.'; } frame 11 { stext.stext.story_text = 'Bri: No problem. Are we going to look for Jeo together?'; } frame 12 { stext.stext.story_text = 'TT: It would be more effective to split up and search further into space because I don\'t pick up any other ships in this area.'; } frame 13 { stext.stext.story_text = 'Arielle: Jeo\'s ship has a stealth system, so we would need to already be pretty close to it to detect it.'; } frame 14 { stext.stext.story_text = 'TT: Follow your gut Ari. We can always hyper jump to your location when you find him.'; } frame 15 { stext.stext.story_text = 'Arielle: Thanks, I\'ll get going right away then.'; } frame 16 { stext.stext.story_text = 'Bri: Good luck Ari. We will find your boyfriend for sure.'; } frame 17 { stext.stext.story_text = 'Arielle: Thanks.. wait.. what?'; } frame 18 { stext.stext.story_text = 'Phia: What? you mean he isn\'t? Come on sweetie, who are you kidding? I know you better than that.'; } frame 19 { stext.stext.story_text = 'Arielle: Let\'s just find him and bring him in. I want to get this over with.'; } frame 20 { stext.stext.story_text = 'TT: Boyfriend? What about Harold?'; } frame 21 { stext.stext.story_text = 'Arielle: I hate him. It\'s complicated. No one is allowed to bring that up until we get back ok ?'; } frame 22 { stext.stext.story_text = 'TT: Understood.'; } frame 23 { stext.stext.story_text = 'Arielle: I want to see what Jeo has to say for himself once we find him. We can maybe help him clear his name if possible.'; } frame 24 { stext.stext.story_text = 'Arielle: Otherwise we will need to arrest him... But he is not a bad person deep down. I just know it! Something else had to happen.'; } frame 25 { stext.stext.story_text = 'TT: It\'s your call Arielle. And good luck on the search. But you should be just fine with your MLaWs now.'; } frame 26 { stext.stext.story_text = 'Phia: I hope ths is worth it sweeite. He sounds pretty hot if you are willing to do this much for him.'; } frame 27 { _root.gotoAndStop(24); } } movieClip 377 { frame 1 { stop(); } frame 1 { stext.stext.story_text = 'Kim: Arielle, turn back now.'; } frame 2 { stext.stext.story_text = 'Arielle: Back off, this has nothing to do with you.'; } frame 3 { _root.gotoAndStop(27); } } movieClip 378 { frame 1 { stop(); } frame 1 { stext.stext.story_text = 'Arielle: He isn\'t here either...'; } frame 2 { stext.stext.story_text = 'Arielle: where could he be? I can\'t even detect a trace of Khalei in this area.'; } frame 3 { stext.stext.story_text = 'Arielle: But that seems kind of odd... I need to keep looking.'; } frame 4 { stext.stext.story_text = 'Phia: Anyone find anything yet?'; } frame 5 { stext.stext.story_text = 'TT: Not yet. Scanners are at maximum.'; } frame 6 { stext.stext.story_text = 'Bri: nope...'; } frame 7 { stext.stext.story_text = 'Arielle: Negative.'; } frame 8 { stext.stext.story_text = 'Phia: Damnit! I hate this guy already! I\'m missing ALL KINDS of sex to look for this guy!'; } frame 9 { stext.stext.story_text = 'Arielle: Cut the chatter and keep looking. The more we look, the shorter this will take.'; } frame 10 { stext.stext.story_text = 'Phia: Sure thing sweetie.'; } frame 11 { stext.stext.story_text = 'Arielle: Huh? what was that... a blip on my scanner for a second there...'; } frame 12 { stext.stext.story_text = 'Arielle: I think I found something; I\'m going to hyper jump to it. It might be Jeo\'s ship.'; } frame 13 { stext.stext.story_text = 'TT: Understood be careful Ari.'; } frame 14 { stext.stext.story_text = 'Ari: I will. I send everyone my coordinates after I get there.'; } frame 15 { _root.gotoAndStop(31); } } frame 15 { function createEnemies(enemyAmount, enemyBehavior, enemyLibraryClip) { var v3 = 0; while (v3 < enemyAmount) { var v2 = _root.attachMovie(enemyLibraryClip, 'enemy' + _root.enemycount, _root.getNextHighestDepth()); ++_root.enemycount; v2._x = random(Stage.width); v2._y = random(Stage.height); v2._rotation = random(360); if (enemyBehavior == 'typeA') { v2.speed = 1; v2.turnRate = 0.05; v2.agroRange = 500; v2.mode = 'follow'; v2.units = 20; v2.shiptype = 1; } else { if (enemyBehavior == 'typeB') { v2.speed = 10; v2.turnRate = 1; v2.agroRange = 800; v2.mode = 'follow'; v2.units = 10; v2.shiptype = 2; } else { if (enemyBehavior == 'typeC') { v2.speed = 1; v2.turnRate = 0.2; v2.agroRange = 100; v2.mode = 'run'; v2.units = 30; v2.shiptype = 3; } } } v2.distanceX = 0; v2.distanceY = 0; v2.distanceTotal = 0; v2.moveDistanceX = 0; v2.moveDistanceY = 0; v2.moveX = 0; v2.moveY = 0; v2.totalmove = 0; v2.mass = 0.7; v2.radius = v2._width / 2; enemiesArray.push(v2); ++v3; } } function updateEnemies() { var v2 = 0; while (v2 < enemiesArray.length) { var v3 = enemiesArray[v2]; updatePosition(v3, _root.main_ship); ++v2; } } function shootEnemyLasers() { var v2 = 0; while (v2 < enemiesArray.length) { var v3 = enemiesArray[v2]; _root.shoot_enemy_laser(v3); ++v2; } } function updatePosition(follower, target) { follower.distanceX = target._x - follower._x; follower.distanceY = target._y - follower._y; follower.distanceTotal = Math.sqrt(follower.distanceX * follower.distanceX + follower.distanceY * follower.distanceY); if (follower.distanceTotal <= follower.agroRange) { follower.moveDistanceX = follower.turnRate * follower.distanceX / follower.distanceTotal; follower.moveDistanceY = follower.turnRate * follower.distanceY / follower.distanceTotal; follower.moveX += follower.moveDistanceX; follower.moveY += follower.moveDistanceY; follower.totalmove = Math.sqrt(follower.moveX * follower.moveX + follower.moveY * follower.moveY); follower.moveX = follower.speed * follower.moveX / follower.totalmove; follower.moveY = follower.speed * follower.moveY / follower.totalmove; if (follower.mode == 'follow') { follower._x += follower.moveX; follower._y += follower.moveY; follower._rotation = Math.atan2(follower.moveY, follower.moveX) * radians; } else { if (follower.mode == 'run') { follower._x -= follower.moveX; follower._y -= follower.moveY; follower._rotation = Math.atan2(follower.moveY, follower.moveX) * radians + 180; } } } if (follower.shiptype == 1 && follower.hitTest(_root.main_ship.main_ship) == true) { _global.ship_hull -= 1; } } function collide(follower, target) { if (follower.hitTest(target.main_ship) == true) { xdist = target._x - follower._x; ydist = target._y - follower._y; distance = Math.sqrt(ydist * ydist + xdist * xdist); overlap = target.radius + follower.radius - distance; follower.moveX += target.moveX * follower.mass * 0.5; follower.moveY += target.moveY * follower.mass * 0.5; if (target.moveX > 0) { target.moveX += Math.abs(target.moveX - overlap); target._x -= overlap; } else { if (target.moveX < 0) { target.moveX -= Math.abs(target.moveX + overlap); target._x += overlap; } } if (target.moveY > 0) { target.moveY += Math.abs(target.moveY - overlap); target._y -= overlap; } else { if (target.moveY < 0) { target.moveY -= Math.abs(target.moveY + overlap); target._y += overlap; } } target.moveX = target.moveX * target.mass * 0.5; target.moveY = target.moveY * target.mass * 0.5; } } var i = 0; while (i < enemiesArray.length) { var tempEnemy = enemiesArray[i]; _root.delete_mc(tempEnemy); ++i; } stop(); var radiance = 57.29577951308232; var ship_speed = _global.ship_speed; var ship_turn = _global.ship_turn_rate; _root.your_lasers_in_play = 0; _root.enemy_lasers_in_play = 0; _root.weaken = 0; _root.enemy_laser_power = 1; _root.enemy_laser_speed = 5; _root.enemycount = 1; _root.delete_mc = function (mc) { mc.removeMovieClip(); false; }; _global.updateMainShipPosition = function () { _root.main_ship.distanceX = _xmouse - _root.main_ship._x; _root.main_ship.distanceY = _ymouse - _root.main_ship._y; _root.main_ship.distanceTotal = Math.sqrt(_root.main_ship.distanceX * _root.main_ship.distanceX + _root.main_ship.distanceY * _root.main_ship.distanceY); if (_root.main_ship.distanceTotal <= _root.main_ship.agroRange) { _root.main_ship.moveDistanceX = _root.main_ship.turnRate * _root.main_ship.distanceX / _root.main_ship.distanceTotal; _root.main_ship.moveDistanceY = _root.main_ship.turnRate * _root.main_ship.distanceY / _root.main_ship.distanceTotal; _root.main_ship.moveX += _root.main_ship.moveDistanceX; _root.main_ship.moveY += _root.main_ship.moveDistanceY; _root.main_ship.totalmove = Math.sqrt(_root.main_ship.moveX * _root.main_ship.moveX + _root.main_ship.moveY * _root.main_ship.moveY); _root.main_ship.moveX = _root.main_ship.speed * _root.main_ship.moveX / _root.main_ship.totalmove; _root.main_ship.moveY = _root.main_ship.speed * _root.main_ship.moveY / _root.main_ship.totalmove; _root.main_ship._x += _root.main_ship.moveX; _root.main_ship._y += _root.main_ship.moveY; _root.main_ship._rotation = Math.atan2(_root.main_ship.moveY, _root.main_ship.moveX) * radiance; } }; _root.shoot_your_laser = function () { ++_root.your_lasers_in_play; _root.attachMovie('aria_laser', 'aria_laser_' + _root.your_lasers_in_play, _root.getNextHighestDepth()); _root['aria_laser_' + _root.your_lasers_in_play]._x = _root.main_ship._x; _root['aria_laser_' + _root.your_lasers_in_play]._y = _root.main_ship._y; var v9 = _root.main_ship._rotation; _root['aria_laser_' + _root.your_lasers_in_play].lifeTimer = 150; var v5 = _xmouse - _root.main_ship._x; var v6 = _ymouse - _root.main_ship._y; var v8 = Math.sqrt(v5 * v5 + v6 * v6); var v7 = v8 / _global.ship_laser_speed; _root['aria_laser_' + _root.your_lasers_in_play].xSpeed = v5 / v7; _root['aria_laser_' + _root.your_lasers_in_play].ySpeed = v6 / v7; radAngle = Math.atan2(v6, v5); _root['aria_laser_' + _root.your_lasers_in_play]._rotation = int(radAngle * 360 / 6.283185307179586 + 180); _root['aria_laser_' + _root.your_lasers_in_play].onLoad = function () { this.gotoAndStop(_global.aria_girl); }; _root['aria_laser_' + _root.your_lasers_in_play].onEnterFrame = function () { this._x += this.xSpeed; this._y += this.ySpeed; if (this._x == 0 && this._y == 0) { _root.delete_mc(this); } if (_root._currentframe != 15) { _root.delete_mc(this); } --this.lifeTimer; if (this.lifeTimer <= 0) { _root.delete_mc(this); } if (this.hitTest(_root.ls)) { _root.delete_mc(this); } if (this.hitTest(_root.main_sphere.sphere_control) && _root.main_sphere.sphere_control._currentframe == 1) { _root.main_sphere.units -= _global.ship_laser_damage; if (_root.main_sphere.units <= 0) { _root.main_sphere.units = Math.abs(_root.main_sphere.units); _root.main_sphere.sphere_control.gotoAndStop(2); } _root.delete_mc(this); } var v4 = 0; while (v4 < 100) { if (this.hitTest(_root['enemy' + v4]) == true) { _root['enemy' + v4].units -= _global.ship_laser_damage; if (_root['enemy' + v4].units <= 0) { _root.delete_mc(_root['enemy' + v4]); } _root.delete_mc(this); } ++v4; } }; }; _root.shoot_enemy_laser = function (fromShip) { if (fromShip && fromShip.shiptype == 1) { ++_root.enemy_lasers_in_play; _root.attachMovie('aria_laser', 'enemy_laser_' + _root.enemy_lasers_in_play, _root.getNextHighestDepth()); _root['enemy_laser_' + _root.enemy_lasers_in_play].previous_selection = fromShip; _root['enemy_laser_' + _root.enemy_lasers_in_play].current_selection = _root.main_ship; if (_root.main_sphere.sphere_control._currentframe == 2) { _root['enemy_laser_' + _root.enemy_lasers_in_play].current_selection = _root.main_sphere; } _root['enemy_laser_' + _root.enemy_lasers_in_play]._x = _root['enemy_laser_' + _root.enemy_lasers_in_play].previous_selection._x; _root['enemy_laser_' + _root.enemy_lasers_in_play]._y = _root['enemy_laser_' + _root.enemy_lasers_in_play].previous_selection._y; var v4 = _root['enemy_laser_' + _root.enemy_lasers_in_play].current_selection._x - _root['enemy_laser_' + _root.enemy_lasers_in_play].previous_selection._x; var v5 = _root['enemy_laser_' + _root.enemy_lasers_in_play].current_selection._y - _root['enemy_laser_' + _root.enemy_lasers_in_play].previous_selection._y; var v7 = Math.sqrt(v4 * v4 + v5 * v5); if (_root.weaken <= 0) { var v6 = v7 / _root.enemy_laser_speed; } else { var v6 = v7; } _root['enemy_laser_' + _root.enemy_lasers_in_play].xSpeed = v4 / v6; _root['enemy_laser_' + _root.enemy_lasers_in_play].ySpeed = v5 / v6; _root['enemy_laser_' + _root.enemy_lasers_in_play].lifeTimer = 150; trace(v6); if (_root.weaken <= 0) { _root['enemy_laser_' + _root.enemy_lasers_in_play].laserdamage = _root.enemy_laser_power; } else { _root['enemy_laser_' + _root.enemy_lasers_in_play].laserdamage = 1; } radAngle = Math.atan2(v5, v4); _root['enemy_laser_' + _root.enemy_lasers_in_play]._rotation = int(radAngle * 360 / 6.283185307179586 + 180); _root['enemy_laser_' + _root.enemy_lasers_in_play].onLoad = function () { this.gotoAndStop(5); }; _root['enemy_laser_' + _root.enemy_lasers_in_play].onEnterFrame = function () { if (this.hitTest(_root.main_ship.laser)) { _root.delete_mc(this); } if (this.hitTest(_root.support_ship.laser)) { _root.delete_mc(this); } if (_root.disaster == 1) { _root.delete_mc(this); } if (this.previous_selection == undefined) { _root.delete_mc(this); } if (_root._currentframe != 15) { _root.delete_mc(this); } --this.lifeTimer; if (this.lifeTimer <= 0) { _root.delete_mc(this); } this._x += this.xSpeed; this._y += this.ySpeed; if (this._x == 0 && this._y == 0) { _root.delete_mc(this); } if (this._x == this.previous_selection._x && this._y == this.previous_selection._y) { } if (this.hitTest(this.current_selection.main_ship) == true) { _global.ship_hull -= this.laserdamage; _root.delete_mc(this); } if (this.hitTest(_root.main_sphere.sphere_control) == true && _root.main_sphere.sphere_control._currentframe == 2) { _root.main_sphere.units -= this.laserdamage; if (_root.main_sphere.units <= 0) { _root.main_sphere.units = Math.abs(_root.main_sphere.units); _root.main_sphere.sphere_control.gotoAndStop(1); } _root.delete_mc(this); } }; } }; var enemiesArray = new Array(); var radians = 57.29577951308232; } movieClip 379 { } movieClip 380 { frame 1 { stop(); } instance sphere_control of movieClip 24 { onClipEvent (enterFrame) { if (_parent.units < 1000) { _parent.gotoAndStop(_parent.units + 1); } else { _parent.gotoAndStop(1000); } } } } instance main_sphere of movieClip 380 { onClipEvent (load) { this.fleet_number = 0; this.shield_amount = 0; this.units = _global.node_units - 100; } } movieClip 382 { frame 30 { if (_root.main_sphere.sphere_control._currentframe == 2) { _root.main_sphere.units += 1; } _root.shootEnemyLasers(); if (_root.main_sphere.sphere_control._currentframe == 2 && _root.main_sphere.units > 10) { _root.nextFrame(); } if (_root._currentframe == 25) { if (random(10) == 0) { _root.createEnemies(1, 'typeA', 'e1'); _root.createEnemies(1, 'typeB', 'e2'); } } } } instance of movieClip 382 { onClipEvent (load) { _global.delay = _global.ship_laser_delay; } onClipEvent (enterFrame) { _global.updateMainShipPosition(); if (_global.delay > 0) { --_global.delay; } if (_global.delay < 0) { _global.delay = 0; } _root.updateEnemies(); if (Key.isDown(1) == true && _global.delay == 0) { _global.delay = _global.ship_laser_delay; _root.shoot_your_laser(); } _root.lb.gotoAndStop(_global.ship_hull); if (_global.ship_hull <= 0) { _root.deleteEnemies(); _root.gotoAndStop(33); } } } movieClip 385 { } movieClip 388 { } movieClip 389 { frame 1 { stop(); } frame 2 { play(); } frame 108 { gotoAndStop(1); } } movieClip 392 { } movieClip 395 { } movieClip 398 { } movieClip 401 { } movieClip 404 { } movieClip 407 { } movieClip 408 { frame 1 { stop(); } } movieClip 411 { } movieClip 414 { } movieClip 417 { } movieClip 420 { frame 1 { stop(); } } movieClip 421 { frame 1 { stop(); } } movieClip 422 { instance of movieClip 421 { onClipEvent (load) { this.gotoAndStop(_global.aria_girl); } } } instance main_ship of movieClip 422 { onClipEvent (load) { this.main_ship.gotoAndStop(_global.aria_girl); this.speed = 4; this.turnRate = 0.5; this.agroRange = 1200; this.mode = 'follow'; this.distanceX = 0; this.distanceY = 0; this.distanceTotal = 0; this.moveDistanceX = 0; this.moveDistanceY = 0; this.moveX = 0; this.moveY = 0; this.totalmove = 0; this.radius = this.main_ship._width / 2; this.mass = 0.5; } } movieClip 424 { frame 1 { if (_global.music == 0) { gotoAndStop(1); } } } movieClip 428 { } movieClip 431 { } movieClip 432 { } instance cursor of movieClip 432 { onClipEvent (enterFrame) { this._x = _root._xmouse; this._y = _root._ymouse; } } frame 16 { function createEnemies(enemyAmount, enemyBehavior, enemyLibraryClip) { var v3 = 0; while (v3 < enemyAmount) { var v2 = _root.attachMovie(enemyLibraryClip, 'enemy' + _root.enemycount, _root.getNextHighestDepth()); ++_root.enemycount; v2._x = random(Stage.width); v2._y = random(Stage.height); v2._rotation = random(360); if (enemyBehavior == 'typeA') { v2.speed = 1; v2.turnRate = 0.05; v2.agroRange = 500; v2.mode = 'follow'; v2.units = 20; v2.shiptype = 1; } else { if (enemyBehavior == 'typeB') { v2.speed = 10; v2.turnRate = 1; v2.agroRange = 800; v2.mode = 'follow'; v2.units = 10; v2.shiptype = 2; } else { if (enemyBehavior == 'typeC') { v2.speed = 1; v2.turnRate = 0.2; v2.agroRange = 100; v2.mode = 'run'; v2.units = 30; v2.shiptype = 3; } } } v2.distanceX = 0; v2.distanceY = 0; v2.distanceTotal = 0; v2.moveDistanceX = 0; v2.moveDistanceY = 0; v2.moveX = 0; v2.moveY = 0; v2.totalmove = 0; v2.mass = 0.7; v2.radius = v2._width / 2; enemiesArray.push(v2); ++v3; } } function updateEnemies() { var v2 = 0; while (v2 < enemiesArray.length) { var v3 = enemiesArray[v2]; updatePosition(v3, _root.main_ship); ++v2; } } function shootEnemyLasers() { var v2 = 0; while (v2 < enemiesArray.length) { var v3 = enemiesArray[v2]; _root.shoot_enemy_laser(v3); ++v2; } } function updatePosition(follower, target) { follower.distanceX = target._x - follower._x; follower.distanceY = target._y - follower._y; follower.distanceTotal = Math.sqrt(follower.distanceX * follower.distanceX + follower.distanceY * follower.distanceY); if (follower.distanceTotal <= follower.agroRange) { follower.moveDistanceX = follower.turnRate * follower.distanceX / follower.distanceTotal; follower.moveDistanceY = follower.turnRate * follower.distanceY / follower.distanceTotal; follower.moveX += follower.moveDistanceX; follower.moveY += follower.moveDistanceY; follower.totalmove = Math.sqrt(follower.moveX * follower.moveX + follower.moveY * follower.moveY); follower.moveX = follower.speed * follower.moveX / follower.totalmove; follower.moveY = follower.speed * follower.moveY / follower.totalmove; if (follower.mode == 'follow') { follower._x += follower.moveX; follower._y += follower.moveY; follower._rotation = Math.atan2(follower.moveY, follower.moveX) * radians; } else { if (follower.mode == 'run') { follower._x -= follower.moveX; follower._y -= follower.moveY; follower._rotation = Math.atan2(follower.moveY, follower.moveX) * radians + 180; } } } if (follower.shiptype == 1 && follower.hitTest(_root.main_ship.main_ship) == true) { _global.ship_hull -= 1; } } function collide(follower, target) { if (follower.hitTest(target.main_ship) == true) { xdist = target._x - follower._x; ydist = target._y - follower._y; distance = Math.sqrt(ydist * ydist + xdist * xdist); overlap = target.radius + follower.radius - distance; follower.moveX += target.moveX * follower.mass * 0.5; follower.moveY += target.moveY * follower.mass * 0.5; if (target.moveX > 0) { target.moveX += Math.abs(target.moveX - overlap); target._x -= overlap; } else { if (target.moveX < 0) { target.moveX -= Math.abs(target.moveX + overlap); target._x += overlap; } } if (target.moveY > 0) { target.moveY += Math.abs(target.moveY - overlap); target._y -= overlap; } else { if (target.moveY < 0) { target.moveY -= Math.abs(target.moveY + overlap); target._y += overlap; } } target.moveX = target.moveX * target.mass * 0.5; target.moveY = target.moveY * target.mass * 0.5; } } var i = 0; while (i < enemiesArray.length) { var tempEnemy = enemiesArray[i]; _root.delete_mc(tempEnemy); ++i; } stop(); var radiance = 57.29577951308232; var ship_speed = _global.ship_speed; var ship_turn = _global.ship_turn_rate; _root.your_lasers_in_play = 0; _root.enemy_lasers_in_play = 0; _root.weaken = 0; _root.enemy_laser_power = 1; _root.enemy_laser_speed = 5; _root.enemycount = 1; _root.delete_mc = function (mc) { mc.removeMovieClip(); false; }; _global.updateMainShipPosition = function () { _root.main_ship.distanceX = _xmouse - _root.main_ship._x; _root.main_ship.distanceY = _ymouse - _root.main_ship._y; _root.main_ship.distanceTotal = Math.sqrt(_root.main_ship.distanceX * _root.main_ship.distanceX + _root.main_ship.distanceY * _root.main_ship.distanceY); if (_root.main_ship.distanceTotal <= _root.main_ship.agroRange) { _root.main_ship.moveDistanceX = _root.main_ship.turnRate * _root.main_ship.distanceX / _root.main_ship.distanceTotal; _root.main_ship.moveDistanceY = _root.main_ship.turnRate * _root.main_ship.distanceY / _root.main_ship.distanceTotal; _root.main_ship.moveX += _root.main_ship.moveDistanceX; _root.main_ship.moveY += _root.main_ship.moveDistanceY; _root.main_ship.totalmove = Math.sqrt(_root.main_ship.moveX * _root.main_ship.moveX + _root.main_ship.moveY * _root.main_ship.moveY); _root.main_ship.moveX = _root.main_ship.speed * _root.main_ship.moveX / _root.main_ship.totalmove; _root.main_ship.moveY = _root.main_ship.speed * _root.main_ship.moveY / _root.main_ship.totalmove; _root.main_ship._x += _root.main_ship.moveX; _root.main_ship._y += _root.main_ship.moveY; _root.main_ship._rotation = Math.atan2(_root.main_ship.moveY, _root.main_ship.moveX) * radiance; } }; _root.shoot_your_laser = function () { ++_root.your_lasers_in_play; _root.attachMovie('aria_laser', 'aria_laser_' + _root.your_lasers_in_play, _root.getNextHighestDepth()); _root['aria_laser_' + _root.your_lasers_in_play]._x = _root.main_ship._x; _root['aria_laser_' + _root.your_lasers_in_play]._y = _root.main_ship._y; var v9 = _root.main_ship._rotation; _root['aria_laser_' + _root.your_lasers_in_play].lifeTimer = 150; var v5 = _xmouse - _root.main_ship._x; var v6 = _ymouse - _root.main_ship._y; var v8 = Math.sqrt(v5 * v5 + v6 * v6); var v7 = v8 / _global.ship_laser_speed; _root['aria_laser_' + _root.your_lasers_in_play].xSpeed = v5 / v7; _root['aria_laser_' + _root.your_lasers_in_play].ySpeed = v6 / v7; radAngle = Math.atan2(v6, v5); _root['aria_laser_' + _root.your_lasers_in_play]._rotation = int(radAngle * 360 / 6.283185307179586 + 180); _root['aria_laser_' + _root.your_lasers_in_play].onLoad = function () { this.gotoAndStop(_global.aria_girl); }; _root['aria_laser_' + _root.your_lasers_in_play].onEnterFrame = function () { this._x += this.xSpeed; this._y += this.ySpeed; if (this._x == 0 && this._y == 0) { _root.delete_mc(this); } if (_root._currentframe != 16) { _root.delete_mc(this); } --this.lifeTimer; if (this.lifeTimer <= 0) { _root.delete_mc(this); } if (this.hitTest(_root.ls)) { _root.delete_mc(this); } if (this.hitTest(_root.main_sphere.sphere_control) && _root.main_sphere.sphere_control._currentframe == 1) { _root.main_sphere.units -= _global.ship_laser_damage; if (_root.main_sphere.units <= 0) { _root.main_sphere.units = Math.abs(_root.main_sphere.units); _root.main_sphere.sphere_control.gotoAndStop(2); } _root.delete_mc(this); } var v4 = 0; while (v4 < 200) { if (this.hitTest(_root['enemy' + v4]) == true) { _root['enemy' + v4].units -= _global.ship_laser_damage; if (_root['enemy' + v4].units <= 0) { _root.delete_mc(_root['enemy' + v4]); } _root.delete_mc(this); } ++v4; } }; }; _root.shoot_enemy_laser = function (fromShip) { if (fromShip && fromShip.shiptype == 1) { ++_root.enemy_lasers_in_play; _root.attachMovie('aria_laser', 'enemy_laser_' + _root.enemy_lasers_in_play, _root.getNextHighestDepth()); _root['enemy_laser_' + _root.enemy_lasers_in_play].previous_selection = fromShip; _root['enemy_laser_' + _root.enemy_lasers_in_play].current_selection = _root.main_ship; if (_root.main_sphere.sphere_control._currentframe == 2) { _root['enemy_laser_' + _root.enemy_lasers_in_play].current_selection = _root.main_sphere; } _root['enemy_laser_' + _root.enemy_lasers_in_play]._x = _root['enemy_laser_' + _root.enemy_lasers_in_play].previous_selection._x; _root['enemy_laser_' + _root.enemy_lasers_in_play]._y = _root['enemy_laser_' + _root.enemy_lasers_in_play].previous_selection._y; var v4 = _root['enemy_laser_' + _root.enemy_lasers_in_play].current_selection._x - _root['enemy_laser_' + _root.enemy_lasers_in_play].previous_selection._x; var v5 = _root['enemy_laser_' + _root.enemy_lasers_in_play].current_selection._y - _root['enemy_laser_' + _root.enemy_lasers_in_play].previous_selection._y; var v7 = Math.sqrt(v4 * v4 + v5 * v5); if (_root.weaken <= 0) { var v6 = v7 / _root.enemy_laser_speed; } else { var v6 = v7; } _root['enemy_laser_' + _root.enemy_lasers_in_play].xSpeed = v4 / v6; _root['enemy_laser_' + _root.enemy_lasers_in_play].ySpeed = v5 / v6; _root['enemy_laser_' + _root.enemy_lasers_in_play].lifeTimer = 150; trace(v6); if (_root.weaken <= 0) { _root['enemy_laser_' + _root.enemy_lasers_in_play].laserdamage = _root.enemy_laser_power; } else { _root['enemy_laser_' + _root.enemy_lasers_in_play].laserdamage = 1; } radAngle = Math.atan2(v5, v4); _root['enemy_laser_' + _root.enemy_lasers_in_play]._rotation = int(radAngle * 360 / 6.283185307179586 + 180); _root['enemy_laser_' + _root.enemy_lasers_in_play].onLoad = function () { this.gotoAndStop(5); }; _root['enemy_laser_' + _root.enemy_lasers_in_play].onEnterFrame = function () { if (this.hitTest(_root.main_ship.laser)) { _root.delete_mc(this); } if (this.hitTest(_root.support_ship.laser)) { _root.delete_mc(this); } if (_root.disaster == 1) { _root.delete_mc(this); } if (this.previous_selection == undefined) { _root.delete_mc(this); } if (_root._currentframe != 16) { _root.delete_mc(this); } --this.lifeTimer; if (this.lifeTimer <= 0) { _root.delete_mc(this); } this._x += this.xSpeed; this._y += this.ySpeed; if (this._x == 0 && this._y == 0) { _root.delete_mc(this); } if (this._x == this.previous_selection._x && this._y == this.previous_selection._y) { } if (this.hitTest(this.current_selection.main_ship) == true) { _global.ship_hull -= this.laserdamage; _root.delete_mc(this); } if (this.hitTest(_root.main_sphere.sphere_control) == true && _root.main_sphere.sphere_control._currentframe == 2) { _root.main_sphere.units -= this.laserdamage; if (_root.main_sphere.units <= 0) { _root.main_sphere.units = Math.abs(_root.main_sphere.units); _root.main_sphere.sphere_control.gotoAndStop(1); } _root.delete_mc(this); } }; } }; var enemiesArray = new Array(); var radians = 57.29577951308232; createEnemies(5, 'typeB', 'e2'); } instance main_sphere of movieClip 380 { onClipEvent (load) { this.fleet_number = 0; this.shield_amount = 0; this.units = _global.node_units - 40; } } frame 17 { function createEnemies(enemyAmount, enemyBehavior, enemyLibraryClip) { var v3 = 0; while (v3 < enemyAmount) { var v2 = _root.attachMovie(enemyLibraryClip, 'enemy' + _root.enemycount, _root.getNextHighestDepth()); ++_root.enemycount; v2._x = random(Stage.width); v2._y = random(Stage.height); v2._rotation = random(360); if (enemyBehavior == 'typeA') { v2.speed = 1; v2.turnRate = 0.05; v2.agroRange = 500; v2.mode = 'follow'; v2.units = 20; v2.shiptype = 1; } else { if (enemyBehavior == 'typeB') { v2.speed = 10; v2.turnRate = 1; v2.agroRange = 800; v2.mode = 'follow'; v2.units = 10; v2.shiptype = 2; } else { if (enemyBehavior == 'typeC') { v2.speed = 1; v2.turnRate = 0.2; v2.agroRange = 100; v2.mode = 'run'; v2.units = 30; v2.shiptype = 3; } } } v2.distanceX = 0; v2.distanceY = 0; v2.distanceTotal = 0; v2.moveDistanceX = 0; v2.moveDistanceY = 0; v2.moveX = 0; v2.moveY = 0; v2.totalmove = 0; v2.mass = 0.7; v2.radius = v2._width / 2; enemiesArray.push(v2); ++v3; } } function updateEnemies() { var v2 = 0; while (v2 < enemiesArray.length) { var v3 = enemiesArray[v2]; updatePosition(v3, _root.main_ship); if (_root._currentframe != 5) { } ++v2; } } function deleteEnemies() { var v2 = 0; while (v2 < enemiesArray.length) { var v3 = enemiesArray[v2]; _root.delete_mc(v3); ++v2; } } function shootEnemyLasers() { var v2 = 0; while (v2 < enemiesArray.length) { var v3 = enemiesArray[v2]; _root.shoot_enemy_laser(v3); ++v2; } } function updatePosition(follower, target) { follower.distanceX = target._x - follower._x; follower.distanceY = target._y - follower._y; follower.distanceTotal = Math.sqrt(follower.distanceX * follower.distanceX + follower.distanceY * follower.distanceY); if (follower.distanceTotal <= follower.agroRange) { follower.moveDistanceX = follower.turnRate * follower.distanceX / follower.distanceTotal; follower.moveDistanceY = follower.turnRate * follower.distanceY / follower.distanceTotal; follower.moveX += follower.moveDistanceX; follower.moveY += follower.moveDistanceY; follower.totalmove = Math.sqrt(follower.moveX * follower.moveX + follower.moveY * follower.moveY); follower.moveX = follower.speed * follower.moveX / follower.totalmove; follower.moveY = follower.speed * follower.moveY / follower.totalmove; if (follower.mode == 'follow') { follower._x += follower.moveX; follower._y += follower.moveY; follower._rotation = Math.atan2(follower.moveY, follower.moveX) * radians; } else { if (follower.mode == 'run') { follower._x -= follower.moveX; follower._y -= follower.moveY; follower._rotation = Math.atan2(follower.moveY, follower.moveX) * radians + 180; } } } if (follower.shiptype == 1 && follower.hitTest(_root.main_ship.main_ship) == true) { _global.ship_hull -= 1; } } function collide(follower, target) { if (follower.hitTest(target.main_ship) == true) { xdist = target._x - follower._x; ydist = target._y - follower._y; distance = Math.sqrt(ydist * ydist + xdist * xdist); overlap = target.radius + follower.radius - distance; follower.moveX += target.moveX * follower.mass * 0.5; follower.moveY += target.moveY * follower.mass * 0.5; if (target.moveX > 0) { target.moveX += Math.abs(target.moveX - overlap); target._x -= overlap; } else { if (target.moveX < 0) { target.moveX -= Math.abs(target.moveX + overlap); target._x += overlap; } } if (target.moveY > 0) { target.moveY += Math.abs(target.moveY - overlap); target._y -= overlap; } else { if (target.moveY < 0) { target.moveY -= Math.abs(target.moveY + overlap); target._y += overlap; } } target.moveX = target.moveX * target.mass * 0.5; target.moveY = target.moveY * target.mass * 0.5; } } var i = 0; while (i < enemiesArray.length) { var tempEnemy = enemiesArray[i]; _root.delete_mc(tempEnemy); ++i; } stop(); var radiance = 57.29577951308232; var ship_speed = _global.ship_speed; var ship_turn = _global.ship_turn_rate; _root.your_lasers_in_play = 0; _root.enemy_lasers_in_play = 0; _root.weaken = 0; _root.enemy_laser_power = 1; _root.enemy_laser_speed = 5; _global.ship_hull = _global.ship_hull_max; _root.enemycount = 1; _root.delete_mc = function (mc) { mc.removeMovieClip(); false; }; _global.updateMainShipPosition = function () { _root.main_ship.distanceX = _xmouse - _root.main_ship._x; _root.main_ship.distanceY = _ymouse - _root.main_ship._y; _root.main_ship.distanceTotal = Math.sqrt(_root.main_ship.distanceX * _root.main_ship.distanceX + _root.main_ship.distanceY * _root.main_ship.distanceY); if (_root.main_ship.distanceTotal <= _root.main_ship.agroRange) { _root.main_ship.moveDistanceX = _root.main_ship.turnRate * _root.main_ship.distanceX / _root.main_ship.distanceTotal; _root.main_ship.moveDistanceY = _root.main_ship.turnRate * _root.main_ship.distanceY / _root.main_ship.distanceTotal; _root.main_ship.moveX += _root.main_ship.moveDistanceX; _root.main_ship.moveY += _root.main_ship.moveDistanceY; _root.main_ship.totalmove = Math.sqrt(_root.main_ship.moveX * _root.main_ship.moveX + _root.main_ship.moveY * _root.main_ship.moveY); _root.main_ship.moveX = _root.main_ship.speed * _root.main_ship.moveX / _root.main_ship.totalmove; _root.main_ship.moveY = _root.main_ship.speed * _root.main_ship.moveY / _root.main_ship.totalmove; _root.main_ship._x += _root.main_ship.moveX; _root.main_ship._y += _root.main_ship.moveY; _root.main_ship._rotation = Math.atan2(_root.main_ship.moveY, _root.main_ship.moveX) * radiance; } }; _root.shoot_your_laser = function () { ++_root.your_lasers_in_play; _root.attachMovie('aria_laser', 'aria_laser_' + _root.your_lasers_in_play, _root.getNextHighestDepth()); _root['aria_laser_' + _root.your_lasers_in_play]._x = _root.main_ship._x; _root['aria_laser_' + _root.your_lasers_in_play]._y = _root.main_ship._y; var v9 = _root.main_ship._rotation; _root['aria_laser_' + _root.your_lasers_in_play].lifeTimer = 150; var v5 = _xmouse - _root.main_ship._x; var v6 = _ymouse - _root.main_ship._y; var v8 = Math.sqrt(v5 * v5 + v6 * v6); var v7 = v8 / _global.ship_laser_speed; _root['aria_laser_' + _root.your_lasers_in_play].xSpeed = v5 / v7; _root['aria_laser_' + _root.your_lasers_in_play].ySpeed = v6 / v7; radAngle = Math.atan2(v6, v5); _root['aria_laser_' + _root.your_lasers_in_play]._rotation = int(radAngle * 360 / 6.283185307179586 + 180); _root['aria_laser_' + _root.your_lasers_in_play].onLoad = function () { this.gotoAndStop(_global.aria_girl); }; _root['aria_laser_' + _root.your_lasers_in_play].onEnterFrame = function () { this._x += this.xSpeed; this._y += this.ySpeed; if (this._x == 0 && this._y == 0) { _root.delete_mc(this); } if (_root._currentframe != 17) { _root.delete_mc(this); } --this.lifeTimer; if (this.lifeTimer <= 0) { _root.delete_mc(this); } if (this.hitTest(_root.ls)) { _root.delete_mc(this); } if (this.hitTest(_root.main_sphere.sphere_control) && _root.main_sphere.sphere_control._currentframe == 1) { _root.main_sphere.units -= _global.ship_laser_damage; if (_root.main_sphere.units <= 0) { _root.main_sphere.units = 1; _root.main_sphere.sphere_control.gotoAndStop(2); } _root.delete_mc(this); } var v4 = 0; while (v4 < 200) { if (this.hitTest(_root['enemy' + v4]) == true) { _root['enemy' + v4].units -= _global.ship_laser_damage; if (_root['enemy' + v4].units <= 0) { _root.delete_mc(_root['enemy' + v4]); } _root.delete_mc(this); } ++v4; } }; }; _root.shoot_enemy_laser = function (fromShip) { if (fromShip && fromShip.shiptype == 1) { ++_root.enemy_lasers_in_play; _root.attachMovie('aria_laser', 'enemy_laser_' + _root.enemy_lasers_in_play, _root.getNextHighestDepth()); _root['enemy_laser_' + _root.enemy_lasers_in_play].previous_selection = fromShip; _root['enemy_laser_' + _root.enemy_lasers_in_play].current_selection = _root.main_ship; if (_root.main_sphere.sphere_control._currentframe == 2) { _root['enemy_laser_' + _root.enemy_lasers_in_play].current_selection = _root.main_sphere; } _root['enemy_laser_' + _root.enemy_lasers_in_play]._x = _root['enemy_laser_' + _root.enemy_lasers_in_play].previous_selection._x; _root['enemy_laser_' + _root.enemy_lasers_in_play]._y = _root['enemy_laser_' + _root.enemy_lasers_in_play].previous_selection._y; var v4 = _root['enemy_laser_' + _root.enemy_lasers_in_play].current_selection._x - _root['enemy_laser_' + _root.enemy_lasers_in_play].previous_selection._x; var v5 = _root['enemy_laser_' + _root.enemy_lasers_in_play].current_selection._y - _root['enemy_laser_' + _root.enemy_lasers_in_play].previous_selection._y; var v7 = Math.sqrt(v4 * v4 + v5 * v5); if (_root.weaken <= 0) { var v6 = v7 / _root.enemy_laser_speed; } else { var v6 = v7; } _root['enemy_laser_' + _root.enemy_lasers_in_play].xSpeed = v4 / v6; _root['enemy_laser_' + _root.enemy_lasers_in_play].ySpeed = v5 / v6; _root['enemy_laser_' + _root.enemy_lasers_in_play].lifeTimer = 150; if (_root.weaken <= 0) { _root['enemy_laser_' + _root.enemy_lasers_in_play].laserdamage = _root.enemy_laser_power; } else { _root['enemy_laser_' + _root.enemy_lasers_in_play].laserdamage = 1; } radAngle = Math.atan2(v5, v4); _root['enemy_laser_' + _root.enemy_lasers_in_play]._rotation = int(radAngle * 360 / 6.283185307179586 + 180); _root['enemy_laser_' + _root.enemy_lasers_in_play].onLoad = function () { this.gotoAndStop(5); }; _root['enemy_laser_' + _root.enemy_lasers_in_play].onEnterFrame = function () { if (this.hitTest(_root.main_ship.laser)) { _root.delete_mc(this); } if (this.hitTest(_root.support_ship.laser)) { _root.delete_mc(this); } if (_root.disaster == 1) { _root.delete_mc(this); } if (this.previous_selection == undefined) { _root.delete_mc(this); } if (_root._currentframe != 17) { _root.delete_mc(this); } --this.lifeTimer; if (this.lifeTimer <= 0) { _root.delete_mc(this); } this._x += this.xSpeed; this._y += this.ySpeed; if (this._x == 0 && this._y == 0) { _root.delete_mc(this); } if (this._x == this.previous_selection._x && this._y == this.previous_selection._y) { } if (this.hitTest(this.current_selection.main_ship) == true) { _global.ship_hull -= this.laserdamage; _root.delete_mc(this); } if (this.hitTest(_root.main_sphere.sphere_control) == true && _root.main_sphere.sphere_control._currentframe == 2) { _root.main_sphere.units -= this.laserdamage; if (_root.main_sphere.units <= 0) { _root.main_sphere.units = Math.abs(_root.main_sphere.units); _root.main_sphere.sphere_control.gotoAndStop(1); } _root.delete_mc(this); } }; } }; var enemiesArray = new Array(); var radians = 57.29577951308232; createEnemies(2, 'typeA', 'e1'); createEnemies(10, 'typeB', 'e2'); } movieClip 441 { } instance main_sphere of movieClip 380 { onClipEvent (load) { this.fleet_number = 0; this.shield_amount = 0; this.units = _global.node_units; } } movieClip 444 { frame 1 { stop(); } frame 100 { stop(); } } frame 18 { var i = 0; while (i < enemiesArray.length) { var tempEnemy = enemiesArray[i]; _root.delete_mc(tempEnemy); ++i; } _root.gotoAndStop(6); } frame 19 { function createEnemies(enemyAmount, enemyBehavior, enemyLibraryClip) { var v4 = 0; while (v4 < enemyAmount) { var v2 = _root.attachMovie(enemyLibraryClip, 'enemy' + _root.enemycount, _root.getNextHighestDepth()); ++_root.enemycount; v2._x = random(Stage.width); v2._y = random(Stage.height); v2._rotation = random(360); if (enemyBehavior == 'typeA') { v2.speed = 1; v2.turnRate = 0.05; v2.agroRange = 500; v2.mode = 'follow'; v2.units = 20; v2.shiptype = 1; } else { if (enemyBehavior == 'typeB') { v2.speed = 10; v2.turnRate = 1; v2.agroRange = 800; v2.mode = 'follow'; v2.units = 10; v2.shiptype = 2; } else { if (enemyBehavior == 'typeC') { v2.speed = 1; v2.turnRate = 0.2; v2.agroRange = 100; v2.mode = 'run'; v2.units = 30; v2.shiptype = 3; } else { if (enemyBehavior == 'typeD') { v2.speed = 10; v2.turnRate = 1; v2.agroRange = 800; v2.mode = 'follow'; v2.units = 10; v2.shiptype = 4; } } } } v2.distanceX = 0; v2.distanceY = 0; v2.distanceTotal = 0; v2.moveDistanceX = 0; v2.moveDistanceY = 0; v2.moveX = 0; v2.moveY = 0; v2.totalmove = 0; v2.mass = 0.7; v2.radius = v2._width / 2; enemiesArray.push(v2); ++v4; } } function updateEnemies() { var v2 = 0; while (v2 < enemiesArray.length) { var v3 = enemiesArray[v2]; updatePosition(v3, _root.main_ship); ++v2; } } function deleteEnemies() { var v2 = 0; while (v2 < enemiesArray.length) { var v3 = enemiesArray[v2]; _root.delete_mc(v3); ++v2; } } function shootEnemyLasers() { var v2 = 0; while (v2 < enemiesArray.length) { var v3 = enemiesArray[v2]; _root.shoot_enemy_laser(v3); ++v2; } if (_root.boss_ship != undefined) { _root.shoot_enemy_laser(_root.boss_ship); } } function updatePosition(follower, target) { follower.distanceX = target._x - follower._x; follower.distanceY = target._y - follower._y; follower.distanceTotal = Math.sqrt(follower.distanceX * follower.distanceX + follower.distanceY * follower.distanceY); if (follower.distanceTotal <= follower.agroRange) { follower.moveDistanceX = follower.turnRate * follower.distanceX / follower.distanceTotal; follower.moveDistanceY = follower.turnRate * follower.distanceY / follower.distanceTotal; follower.moveX += follower.moveDistanceX; follower.moveY += follower.moveDistanceY; follower.totalmove = Math.sqrt(follower.moveX * follower.moveX + follower.moveY * follower.moveY); follower.moveX = follower.speed * follower.moveX / follower.totalmove; follower.moveY = follower.speed * follower.moveY / follower.totalmove; if (follower.mode == 'follow') { follower._x += follower.moveX; follower._y += follower.moveY; follower._rotation = Math.atan2(follower.moveY, follower.moveX) * radians; } else { if (follower.mode == 'run') { follower._x -= follower.moveX; follower._y -= follower.moveY; follower._rotation = Math.atan2(follower.moveY, follower.moveX) * radians + 180; } } } if (follower.shiptype == 1 && follower.hitTest(_root.main_ship.main_ship) == true) { _global.ship_hull -= 1; } } function collide(follower, target) { if (follower.hitTest(target.main_ship) == true) { xdist = target._x - follower._x; ydist = target._y - follower._y; distance = Math.sqrt(ydist * ydist + xdist * xdist); overlap = target.radius + follower.radius - distance; follower.moveX += target.moveX * follower.mass * 0.5; follower.moveY += target.moveY * follower.mass * 0.5; if (target.moveX > 0) { target.moveX += Math.abs(target.moveX - overlap); target._x -= overlap; } else { if (target.moveX < 0) { target.moveX -= Math.abs(target.moveX + overlap); target._x += overlap; } } if (target.moveY > 0) { target.moveY += Math.abs(target.moveY - overlap); target._y -= overlap; } else { if (target.moveY < 0) { target.moveY -= Math.abs(target.moveY + overlap); target._y += overlap; } } target.moveX = target.moveX * target.mass * 0.5; target.moveY = target.moveY * target.mass * 0.5; } } var i = 0; while (i < enemiesArray.length) { var tempEnemy = enemiesArray[i]; _root.delete_mc(tempEnemy); ++i; } stop(); var radiance = 57.29577951308232; var ship_speed = _global.ship_speed; var ship_turn = _global.ship_turn_rate; _root.your_lasers_in_play = 0; _root.enemy_lasers_in_play = 0; _root.weaken = 0; _root.enemy_laser_power = 1; _root.enemy_laser_speed = 5; _global.ship_hull = _global.ship_hull_max; _root.sship_random = 10; _root.enemycount = 1; _root.delete_mc = function (mc) { mc.removeMovieClip(); false; }; _global.updateMainShipPosition = function () { _root.main_ship.distanceX = _xmouse - _root.main_ship._x; _root.main_ship.distanceY = _ymouse - _root.main_ship._y; _root.main_ship.distanceTotal = Math.sqrt(_root.main_ship.distanceX * _root.main_ship.distanceX + _root.main_ship.distanceY * _root.main_ship.distanceY); if (_root.main_ship.distanceTotal <= _root.main_ship.agroRange) { _root.main_ship.moveDistanceX = _root.main_ship.turnRate * _root.main_ship.distanceX / _root.main_ship.distanceTotal; _root.main_ship.moveDistanceY = _root.main_ship.turnRate * _root.main_ship.distanceY / _root.main_ship.distanceTotal; _root.main_ship.moveX += _root.main_ship.moveDistanceX; _root.main_ship.moveY += _root.main_ship.moveDistanceY; _root.main_ship.totalmove = Math.sqrt(_root.main_ship.moveX * _root.main_ship.moveX + _root.main_ship.moveY * _root.main_ship.moveY); _root.main_ship.moveX = _root.main_ship.speed * _root.main_ship.moveX / _root.main_ship.totalmove; _root.main_ship.moveY = _root.main_ship.speed * _root.main_ship.moveY / _root.main_ship.totalmove; _root.main_ship._x += _root.main_ship.moveX; _root.main_ship._y += _root.main_ship.moveY; _root.main_ship._rotation = Math.atan2(_root.main_ship.moveY, _root.main_ship.moveX) * radiance; } }; _root.shoot_your_laser = function () { ++_root.your_lasers_in_play; _root.attachMovie('aria_laser', 'aria_laser_' + _root.your_lasers_in_play, _root.getNextHighestDepth()); _root['aria_laser_' + _root.your_lasers_in_play]._x = _root.main_ship._x; _root['aria_laser_' + _root.your_lasers_in_play]._y = _root.main_ship._y; var v9 = _root.main_ship._rotation; _root['aria_laser_' + _root.your_lasers_in_play].lifeTimer = 150; var v5 = _xmouse - _root.main_ship._x; var v6 = _ymouse - _root.main_ship._y; var v8 = Math.sqrt(v5 * v5 + v6 * v6); var v7 = v8 / _global.ship_laser_speed; _root['aria_laser_' + _root.your_lasers_in_play].xSpeed = v5 / v7; _root['aria_laser_' + _root.your_lasers_in_play].ySpeed = v6 / v7; radAngle = Math.atan2(v6, v5); _root['aria_laser_' + _root.your_lasers_in_play]._rotation = int(radAngle * 360 / 6.283185307179586 + 180); _root['aria_laser_' + _root.your_lasers_in_play].onLoad = function () { this.gotoAndStop(_global.aria_girl); }; _root['aria_laser_' + _root.your_lasers_in_play].onEnterFrame = function () { this._x += this.xSpeed; this._y += this.ySpeed; if (this._x == 0 && this._y == 0) { _root.delete_mc(this); } if (_root._currentframe != 19) { _root.delete_mc(this); } --this.lifeTimer; if (this.lifeTimer <= 0) { _root.delete_mc(this); } if (this.hitTest(_root.ls)) { _root.delete_mc(this); } if (this.hitTest(_root.main_sphere.sphere_control) && _root.main_sphere.sphere_control._currentframe == 1 && _root.main_sphere.shield_amount <= 0) { _root.main_sphere.units -= _global.ship_laser_damage; if (_root.main_sphere.units <= 0) { _root.main_sphere.units = 1; _root.main_sphere.sphere_control.gotoAndStop(2); } _root.delete_mc(this); } if (this.hitTest(_root.main_sphere.sphere_control) && _root.main_sphere.sphere_control._currentframe == 1 && _root.main_sphere.shield_amount > 0) { _root.main_sphere.shield_amount -= 1; if (_root.main_sphere.shield_amount <= 0) { _root.main_sphere.shield.gotoAndStop(1); } _root.delete_mc(this); } var v4 = 0; while (v4 < 200) { if (this.hitTest(_root['enemy' + v4]) == true && _root['enemy' + v4].shiptype != 4) { _root['enemy' + v4].units -= _global.ship_laser_damage; if (_root['enemy' + v4].units <= 0) { _root.delete_mc(_root['enemy' + v4]); } _root.delete_mc(this); } ++v4; } }; }; _root.shoot_enemy_laser = function (fromShip) { if (fromShip && fromShip.shiptype == 1 || fromShip == _root.boss_ship) { ++_root.enemy_lasers_in_play; _root.attachMovie('aria_laser', 'enemy_laser_' + _root.enemy_lasers_in_play, _root.getNextHighestDepth()); _root['enemy_laser_' + _root.enemy_lasers_in_play].previous_selection = fromShip; _root['enemy_laser_' + _root.enemy_lasers_in_play].current_selection = _root.main_ship; if (_root.main_sphere.sphere_control._currentframe == 2) { _root['enemy_laser_' + _root.enemy_lasers_in_play].current_selection = _root.main_sphere; } _root['enemy_laser_' + _root.enemy_lasers_in_play]._x = _root['enemy_laser_' + _root.enemy_lasers_in_play].previous_selection._x; _root['enemy_laser_' + _root.enemy_lasers_in_play]._y = _root['enemy_laser_' + _root.enemy_lasers_in_play].previous_selection._y; var v4 = _root['enemy_laser_' + _root.enemy_lasers_in_play].current_selection._x - _root['enemy_laser_' + _root.enemy_lasers_in_play].previous_selection._x; var v5 = _root['enemy_laser_' + _root.enemy_lasers_in_play].current_selection._y - _root['enemy_laser_' + _root.enemy_lasers_in_play].previous_selection._y; var v8 = Math.sqrt(v4 * v4 + v5 * v5); if (_root.weaken <= 0) { var v6 = v8 / _root.enemy_laser_speed; } else { var v6 = v8; } _root['enemy_laser_' + _root.enemy_lasers_in_play].xSpeed = v4 / v6; _root['enemy_laser_' + _root.enemy_lasers_in_play].ySpeed = v5 / v6; _root['enemy_laser_' + _root.enemy_lasers_in_play].lifeTimer = 150; if (_root.weaken <= 0) { _root['enemy_laser_' + _root.enemy_lasers_in_play].laserdamage = _root.enemy_laser_power; } else { _root['enemy_laser_' + _root.enemy_lasers_in_play].laserdamage = 1; } radAngle = Math.atan2(v5, v4); _root['enemy_laser_' + _root.enemy_lasers_in_play]._rotation = int(radAngle * 360 / 6.283185307179586 + 180); _root['enemy_laser_' + _root.enemy_lasers_in_play].onLoad = function () { this.gotoAndStop(5); }; _root['enemy_laser_' + _root.enemy_lasers_in_play].onEnterFrame = function () { if (this.hitTest(_root.main_ship.laser)) { _root.delete_mc(this); } if (this.hitTest(_root.support_ship.laser)) { _root.delete_mc(this); } if (_root.disaster == 1) { _root.delete_mc(this); } if (this.previous_selection == undefined) { _root.delete_mc(this); } if (_root._currentframe != 19) { _root.delete_mc(this); } --this.lifeTimer; if (this.lifeTimer <= 0) { _root.delete_mc(this); } this._x += this.xSpeed; this._y += this.ySpeed; if (this._x == 0 && this._y == 0) { _root.delete_mc(this); } if (this._x == this.previous_selection._x && this._y == this.previous_selection._y) { } if (this.hitTest(this.current_selection.main_ship) == true) { _global.ship_hull -= this.laserdamage; _root.delete_mc(this); } if (this.hitTest(_root.main_ship.main_ship) == true) { _global.ship_hull -= this.laserdamage; _root.delete_mc(this); } if (this.hitTest(_root.main_sphere.sphere_control) == true && _root.main_sphere.sphere_control._currentframe == 2) { _root.main_sphere.units -= this.laserdamage; if (_root.main_sphere.units <= 0) { _root.main_sphere.units = Math.abs(_root.main_sphere.units); _root.main_sphere.sphere_control.gotoAndStop(1); } _root.delete_mc(this); } }; } }; var enemiesArray = new Array(); var radians = 57.29577951308232; createEnemies(4, 'typeA', 'e1'); createEnemies(10, 'typeB', 'e2'); } movieClip 448 { } instance main_sphere of movieClip 380 { onClipEvent (load) { this.fleet_number = 0; this.shield_amount = 5; this.shield.gotoAndStop(3); this.units = _global.node_units; } } instance of movieClip 382 { onClipEvent (load) { _global.delay = _global.ship_laser_delay; } onClipEvent (enterFrame) { _global.updateMainShipPosition(); if (_global.delay > 0) { --_global.delay; } if (_global.delay < 0) { _global.delay = 0; } _root.updateEnemies(); if (Key.isDown(1) == true && _global.delay == 0) { _global.delay = _global.ship_laser_delay; _root.shoot_your_laser(); } _root.lb.gotoAndStop(_global.ship_hull); if (_global.ship_hull <= 0) { _root.deleteEnemies(); _root.gotoAndStop(18); } } } instance boss_ship of movieClip 124 { onClipEvent (load) { this.gotoAndStop(13); } } instance main_ship of movieClip 422 { onClipEvent (load) { this.main_ship.gotoAndStop(_global.aria_girl); this.speed = 4; this.turnRate = 0.5; this.agroRange = 1200; this.mode = 'follow'; this.distanceX = 0; this.distanceY = 0; this.distanceTotal = 0; this.moveDistanceX = 0; this.moveDistanceY = 0; this.moveX = 0; this.moveY = 0; this.totalmove = 0; this.radius = this.main_ship._width / 2; this.mass = 0.5; } } movieClip 450 { } movieClip 451 { frame 30 { if (random(_root.sship_random) == 0) { } else { gotoAndPlay(1); } } frame 101 { if (random(_root.sship_random) < 3) { } else { gotoAndPlay(85); } } } movieClip 453 { frame 1 { if (_global.music == 0) { gotoAndStop(1); } } frame 2 { if (_global.music == 0) { gotoAndStop(1); } } } instance cursor of movieClip 432 { onClipEvent (enterFrame) { this._x = _root._xmouse; this._y = _root._ymouse; } } frame 20 { var i = 0; while (i < enemiesArray.length) { var tempEnemy = enemiesArray[i]; _root.delete_mc(tempEnemy); ++i; } _root.gotoAndStop(29); } frame 21 { function createEnemies(enemyAmount, enemyBehavior, enemyLibraryClip) { var v4 = 0; while (v4 < enemyAmount) { var v2 = _root.attachMovie(enemyLibraryClip, 'enemy' + _root.enemycount, _root.getNextHighestDepth()); ++_root.enemycount; v2._x = random(Stage.width); v2._y = random(Stage.height); v2._rotation = random(360); if (enemyBehavior == 'typeA') { v2.speed = 1; v2.turnRate = 0.05; v2.agroRange = 500; v2.mode = 'follow'; v2.units = 20; v2.shiptype = 1; } else { if (enemyBehavior == 'typeB') { v2.speed = 10; v2.turnRate = 1; v2.agroRange = 800; v2.mode = 'follow'; v2.units = 10; v2.shiptype = 2; } else { if (enemyBehavior == 'typeC') { v2.speed = 1; v2.turnRate = 0.2; v2.agroRange = 100; v2.mode = 'run'; v2.units = 30; v2.shiptype = 3; } else { if (enemyBehavior == 'typeD') { v2.speed = 10; v2.turnRate = 1; v2.agroRange = 1500; v2.mode = 'follow'; v2.units = 10; v2.shiptype = 4; } } } } v2.distanceX = 0; v2.distanceY = 0; v2.distanceTotal = 0; v2.moveDistanceX = 0; v2.moveDistanceY = 0; v2.moveX = 0; v2.moveY = 0; v2.totalmove = 0; v2.mass = 0.7; v2.radius = v2._width / 2; enemiesArray.push(v2); ++v4; } } function updateEnemies() { var v2 = 0; while (v2 < enemiesArray.length) { var v3 = enemiesArray[v2]; updatePosition(v3, _root.main_ship); capture_base(v3, _root.main_sphere); ++v2; } } function deleteEnemies() { var v2 = 0; while (v2 < enemiesArray.length) { var v3 = enemiesArray[v2]; _root.delete_mc(v3); ++v2; } } function shootEnemyLasers() { var v2 = 0; while (v2 < enemiesArray.length) { var v3 = enemiesArray[v2]; _root.shoot_enemy_laser(v3); ++v2; } if (_root.boss_ship != undefined) { _root.shoot_enemy_laser(_root.boss_ship); } } function updatePosition(follower, target) { follower.distanceX = target._x - follower._x; follower.distanceY = target._y - follower._y; follower.distanceTotal = Math.sqrt(follower.distanceX * follower.distanceX + follower.distanceY * follower.distanceY); if (follower.distanceTotal <= follower.agroRange) { follower.moveDistanceX = follower.turnRate * follower.distanceX / follower.distanceTotal; follower.moveDistanceY = follower.turnRate * follower.distanceY / follower.distanceTotal; follower.moveX += follower.moveDistanceX; follower.moveY += follower.moveDistanceY; follower.totalmove = Math.sqrt(follower.moveX * follower.moveX + follower.moveY * follower.moveY); follower.moveX = follower.speed * follower.moveX / follower.totalmove; follower.moveY = follower.speed * follower.moveY / follower.totalmove; if (follower.mode == 'follow') { follower._x += follower.moveX; follower._y += follower.moveY; follower._rotation = Math.atan2(follower.moveY, follower.moveX) * radians; } else { if (follower.mode == 'run') { follower._x -= follower.moveX; follower._y -= follower.moveY; follower._rotation = Math.atan2(follower.moveY, follower.moveX) * radians + 180; } } } if (follower.shiptype == 1 && follower.hitTest(_root.main_ship.main_ship) == true) { _global.ship_hull -= 1; } } function capture_base(follower, target) { if (follower.hitTest(target.sphere_control) && target.sphere_control._currentframe == 1 && target.shield_amount <= 0 && follower.shiptype == 4) { target.units -= 50; if (target.units <= 0) { target.units = 1; target.sphere_control.gotoAndStop(2); } _root.delete_mc(follower); } if (follower.hitTest(target.sphere_control) && target.sphere_control._currentframe == 1 && target.shield_amount > 0 && follower.shiptype == 4) { target.shield_amount -= 1; if (target.shield_amount <= 0) { target.shield.gotoAndStop(1); } } } function collide(follower, target) { if (follower.hitTest(target.main_ship) == true) { xdist = target._x - follower._x; ydist = target._y - follower._y; distance = Math.sqrt(ydist * ydist + xdist * xdist); overlap = target.radius + follower.radius - distance; follower.moveX += target.moveX * follower.mass * 0.5; follower.moveY += target.moveY * follower.mass * 0.5; if (target.moveX > 0) { target.moveX += Math.abs(target.moveX - overlap); target._x -= overlap; } else { if (target.moveX < 0) { target.moveX -= Math.abs(target.moveX + overlap); target._x += overlap; } } if (target.moveY > 0) { target.moveY += Math.abs(target.moveY - overlap); target._y -= overlap; } else { if (target.moveY < 0) { target.moveY -= Math.abs(target.moveY + overlap); target._y += overlap; } } target.moveX = target.moveX * target.mass * 0.5; target.moveY = target.moveY * target.mass * 0.5; } } var i = 0; while (i < enemiesArray.length) { var tempEnemy = enemiesArray[i]; _root.delete_mc(tempEnemy); ++i; } stop(); var radiance = 57.29577951308232; var ship_speed = _global.ship_speed; var ship_turn = _global.ship_turn_rate; _root.your_lasers_in_play = 0; _root.enemy_lasers_in_play = 0; _root.weaken = 0; _root.enemy_laser_power = 1; _root.enemy_laser_speed = 5; _global.ship_hull = _global.ship_hull_max; _root.sship_random = 10; _root.fram_spawned_on = _root._currentframe; _root.enemycount = 1; _root.delete_mc = function (mc) { mc.removeMovieClip(); false; }; _global.updateMainShipPosition = function () { _root.main_ship.distanceX = _xmouse - _root.main_ship._x; _root.main_ship.distanceY = _ymouse - _root.main_ship._y; _root.main_ship.distanceTotal = Math.sqrt(_root.main_ship.distanceX * _root.main_ship.distanceX + _root.main_ship.distanceY * _root.main_ship.distanceY); if (_root.main_ship.distanceTotal <= _root.main_ship.agroRange) { _root.main_ship.moveDistanceX = _root.main_ship.turnRate * _root.main_ship.distanceX / _root.main_ship.distanceTotal; _root.main_ship.moveDistanceY = _root.main_ship.turnRate * _root.main_ship.distanceY / _root.main_ship.distanceTotal; _root.main_ship.moveX += _root.main_ship.moveDistanceX; _root.main_ship.moveY += _root.main_ship.moveDistanceY; _root.main_ship.totalmove = Math.sqrt(_root.main_ship.moveX * _root.main_ship.moveX + _root.main_ship.moveY * _root.main_ship.moveY); _root.main_ship.moveX = _root.main_ship.speed * _root.main_ship.moveX / _root.main_ship.totalmove; _root.main_ship.moveY = _root.main_ship.speed * _root.main_ship.moveY / _root.main_ship.totalmove; _root.main_ship._x += _root.main_ship.moveX; _root.main_ship._y += _root.main_ship.moveY; _root.main_ship._rotation = Math.atan2(_root.main_ship.moveY, _root.main_ship.moveX) * radiance; } }; _root.shoot_your_laser = function () { ++_root.your_lasers_in_play; _root.attachMovie('aria_laser', 'aria_laser_' + _root.your_lasers_in_play, _root.getNextHighestDepth()); _root['aria_laser_' + _root.your_lasers_in_play]._x = _root.main_ship._x; _root['aria_laser_' + _root.your_lasers_in_play]._y = _root.main_ship._y; var v9 = _root.main_ship._rotation; _root['aria_laser_' + _root.your_lasers_in_play].lifeTimer = 150; var v5 = _xmouse - _root.main_ship._x; var v6 = _ymouse - _root.main_ship._y; var v8 = Math.sqrt(v5 * v5 + v6 * v6); var v7 = v8 / _global.ship_laser_speed; _root['aria_laser_' + _root.your_lasers_in_play].xSpeed = v5 / v7; _root['aria_laser_' + _root.your_lasers_in_play].ySpeed = v6 / v7; radAngle = Math.atan2(v6, v5); _root['aria_laser_' + _root.your_lasers_in_play]._rotation = int(radAngle * 360 / 6.283185307179586 + 180); _root['aria_laser_' + _root.your_lasers_in_play].onLoad = function () { this.gotoAndStop(_global.aria_girl); }; _root['aria_laser_' + _root.your_lasers_in_play].onEnterFrame = function () { this._x += this.xSpeed; this._y += this.ySpeed; if (this._x == 0 && this._y == 0) { _root.delete_mc(this); } if (_root._currentframe != _root.fram_spawned_on) { _root.delete_mc(this); } --this.lifeTimer; if (this.lifeTimer <= 0) { _root.delete_mc(this); } if (this.hitTest(_root.ls)) { _root.delete_mc(this); } if (this.hitTest(_root.main_sphere.sphere_control) && _root.main_sphere.sphere_control._currentframe == 1 && _root.main_sphere.shield_amount <= 0) { _root.main_sphere.units -= _global.ship_laser_damage; if (_root.main_sphere.units <= 0) { _root.main_sphere.units = 1; _root.main_sphere.sphere_control.gotoAndStop(2); } _root.delete_mc(this); } if (this.hitTest(_root.main_sphere.sphere_control) && _root.main_sphere.sphere_control._currentframe == 1 && _root.main_sphere.shield_amount > 0) { _root.main_sphere.shield_amount -= 1; if (_root.main_sphere.shield_amount <= 0) { _root.main_sphere.shield.gotoAndStop(1); } _root.delete_mc(this); } var v4 = 0; while (v4 < 200) { if (this.hitTest(_root['enemy' + v4]) == true && _root['enemy' + v4].shiptype != 4) { _root['enemy' + v4].units -= _global.ship_laser_damage; if (_root['enemy' + v4].units <= 0) { _root.delete_mc(_root['enemy' + v4]); } _root.delete_mc(this); } ++v4; } }; }; _root.shoot_enemy_laser = function (fromShip) { if (fromShip && fromShip.shiptype == 1 || fromShip == _root.boss_ship) { ++_root.enemy_lasers_in_play; _root.attachMovie('aria_laser', 'enemy_laser_' + _root.enemy_lasers_in_play, _root.getNextHighestDepth()); _root['enemy_laser_' + _root.enemy_lasers_in_play].previous_selection = fromShip; _root['enemy_laser_' + _root.enemy_lasers_in_play].current_selection = _root.main_ship; if (_root.main_sphere.sphere_control._currentframe == 2) { _root['enemy_laser_' + _root.enemy_lasers_in_play].current_selection = _root.main_sphere; } _root['enemy_laser_' + _root.enemy_lasers_in_play]._x = _root['enemy_laser_' + _root.enemy_lasers_in_play].previous_selection._x; _root['enemy_laser_' + _root.enemy_lasers_in_play]._y = _root['enemy_laser_' + _root.enemy_lasers_in_play].previous_selection._y; var v4 = _root['enemy_laser_' + _root.enemy_lasers_in_play].current_selection._x - _root['enemy_laser_' + _root.enemy_lasers_in_play].previous_selection._x; var v5 = _root['enemy_laser_' + _root.enemy_lasers_in_play].current_selection._y - _root['enemy_laser_' + _root.enemy_lasers_in_play].previous_selection._y; var v8 = Math.sqrt(v4 * v4 + v5 * v5); if (_root.weaken <= 0) { var v6 = v8 / _root.enemy_laser_speed; } else { var v6 = v8; } _root['enemy_laser_' + _root.enemy_lasers_in_play].xSpeed = v4 / v6; _root['enemy_laser_' + _root.enemy_lasers_in_play].ySpeed = v5 / v6; _root['enemy_laser_' + _root.enemy_lasers_in_play].lifeTimer = 150; if (_root.weaken <= 0) { _root['enemy_laser_' + _root.enemy_lasers_in_play].laserdamage = _root.enemy_laser_power; } else { _root['enemy_laser_' + _root.enemy_lasers_in_play].laserdamage = 1; } radAngle = Math.atan2(v5, v4); _root['enemy_laser_' + _root.enemy_lasers_in_play]._rotation = int(radAngle * 360 / 6.283185307179586 + 180); _root['enemy_laser_' + _root.enemy_lasers_in_play].onLoad = function () { this.gotoAndStop(5); }; _root['enemy_laser_' + _root.enemy_lasers_in_play].onEnterFrame = function () { if (this.hitTest(_root.main_ship.laser)) { _root.delete_mc(this); } if (this.hitTest(_root.support_ship.laser)) { _root.delete_mc(this); } if (_root.disaster == 1) { _root.delete_mc(this); } if (this.previous_selection == undefined) { _root.delete_mc(this); } if (_root._currentframe != _root.fram_spawned_on) { _root.delete_mc(this); } --this.lifeTimer; if (this.lifeTimer <= 0) { _root.delete_mc(this); } this._x += this.xSpeed; this._y += this.ySpeed; if (this._x == 0 && this._y == 0) { _root.delete_mc(this); } if (this._x == this.previous_selection._x && this._y == this.previous_selection._y) { } if (this.hitTest(this.current_selection.main_ship) == true) { _global.ship_hull -= this.laserdamage; _root.delete_mc(this); } if (this.hitTest(_root.main_ship.main_ship) == true) { _global.ship_hull -= this.laserdamage; _root.delete_mc(this); } if (this.hitTest(_root.main_sphere.sphere_control) == true && _root.main_sphere.sphere_control._currentframe == 2) { _root.main_sphere.units -= this.laserdamage; if (_root.main_sphere.units <= 0) { _root.main_sphere.units = Math.abs(_root.main_sphere.units); _root.main_sphere.sphere_control.gotoAndStop(1); } _root.delete_mc(this); } }; } }; var enemiesArray = new Array(); var radians = 57.29577951308232; createEnemies(5, 'typeD', 'e4'); } instance main_sphere of movieClip 380 { onClipEvent (load) { this.fleet_number = 0; this.shield_amount = 0; this.units = _global.node_units + 100; } } instance of movieClip 382 { onClipEvent (load) { _global.delay = _global.ship_laser_delay; } onClipEvent (enterFrame) { _global.updateMainShipPosition(); if (_global.delay > 0) { --_global.delay; } if (_global.delay < 0) { _global.delay = 0; } _root.updateEnemies(); if (Key.isDown(1) == true && _global.delay == 0) { _global.delay = _global.ship_laser_delay; _root.shoot_your_laser(); } _root.lb.gotoAndStop(_global.ship_hull); if (_global.ship_hull <= 0) { _root.deleteEnemies(); _root.gotoAndStop(20); } } } instance main_ship of movieClip 422 { onClipEvent (load) { this.main_ship.gotoAndStop(_global.aria_girl); this.speed = 4; this.turnRate = 0.5; this.agroRange = 1200; this.mode = 'follow'; this.distanceX = 0; this.distanceY = 0; this.distanceTotal = 0; this.moveDistanceX = 0; this.moveDistanceY = 0; this.moveX = 0; this.moveY = 0; this.totalmove = 0; this.radius = this.main_ship._width / 2; this.mass = 0.5; } } movieClip 458 { frame 1 { if (_global.music == 0) { gotoAndStop(1); } } } instance cursor of movieClip 432 { onClipEvent (enterFrame) { this._x = _root._xmouse; this._y = _root._ymouse; } } frame 22 { function createEnemies(enemyAmount, enemyBehavior, enemyLibraryClip) { var v4 = 0; while (v4 < enemyAmount) { var v2 = _root.attachMovie(enemyLibraryClip, 'enemy' + _root.enemycount, _root.getNextHighestDepth()); ++_root.enemycount; v2._x = random(Stage.width); v2._y = random(Stage.height); v2._rotation = random(360); if (enemyBehavior == 'typeA') { v2.speed = 1; v2.turnRate = 0.05; v2.agroRange = 500; v2.mode = 'follow'; v2.units = 20; v2.shiptype = 1; } else { if (enemyBehavior == 'typeB') { v2.speed = 10; v2.turnRate = 1; v2.agroRange = 800; v2.mode = 'follow'; v2.units = 10; v2.shiptype = 2; } else { if (enemyBehavior == 'typeC') { v2.speed = 1; v2.turnRate = 0.2; v2.agroRange = 100; v2.mode = 'run'; v2.units = 30; v2.shiptype = 3; } else { if (enemyBehavior == 'typeD') { v2.speed = 10; v2.turnRate = 1; v2.agroRange = 1500; v2.mode = 'follow'; v2.units = 10; v2.shiptype = 4; } } } } v2.distanceX = 0; v2.distanceY = 0; v2.distanceTotal = 0; v2.moveDistanceX = 0; v2.moveDistanceY = 0; v2.moveX = 0; v2.moveY = 0; v2.totalmove = 0; v2.mass = 0.7; v2.radius = v2._width / 2; enemiesArray.push(v2); ++v4; } } function updateEnemies() { var v2 = 0; while (v2 < enemiesArray.length) { var v3 = enemiesArray[v2]; updatePosition(v3, _root.main_ship); capture_base(v3, _root.main_sphere); ++v2; } } function deleteEnemies() { var v2 = 0; while (v2 < enemiesArray.length) { var v3 = enemiesArray[v2]; _root.delete_mc(v3); ++v2; } } function crashIntoEnemies() { var v5 = 0; while (v5 < enemiesArray.length) { var v3 = 0; while (v3 < enemiesArray.length) { var v2 = enemiesArray[v5]; var v4 = enemiesArray[v3]; if (v2.hitTest(v4) == true && v2.shiptype == 2 && v4.shiptype == 4) { _root.delete_mc(v2); _root.delete_mc(v4); _root.total_ally_attack_ships -= 1; } ++v3; } ++v5; } } function shootEnemyLasers() { var v2 = 0; while (v2 < enemiesArray.length) { var v3 = enemiesArray[v2]; _root.shoot_enemy_laser(v3); ++v2; } if (_root.boss_ship != undefined) { _root.shoot_enemy_laser(_root.boss_ship); } } function updatePosition(follower, target) { follower.distanceX = target._x - follower._x; follower.distanceY = target._y - follower._y; follower.distanceTotal = Math.sqrt(follower.distanceX * follower.distanceX + follower.distanceY * follower.distanceY); if (follower.distanceTotal <= follower.agroRange) { follower.moveDistanceX = follower.turnRate * follower.distanceX / follower.distanceTotal; follower.moveDistanceY = follower.turnRate * follower.distanceY / follower.distanceTotal; follower.moveX += follower.moveDistanceX; follower.moveY += follower.moveDistanceY; follower.totalmove = Math.sqrt(follower.moveX * follower.moveX + follower.moveY * follower.moveY); follower.moveX = follower.speed * follower.moveX / follower.totalmove; follower.moveY = follower.speed * follower.moveY / follower.totalmove; if (follower.mode == 'follow') { follower._x += follower.moveX; follower._y += follower.moveY; follower._rotation = Math.atan2(follower.moveY, follower.moveX) * radians; } else { if (follower.mode == 'run') { follower._x -= follower.moveX; follower._y -= follower.moveY; follower._rotation = Math.atan2(follower.moveY, follower.moveX) * radians + 180; } } } if (follower.shiptype == 1 && follower.hitTest(_root.main_ship.main_ship) == true) { _global.ship_hull -= 1; } } function capture_base(follower, target) { if (follower.hitTest(target.sphere_control) && target.sphere_control._currentframe == 1 && target.shield_amount <= 0 && follower.shiptype == 4) { target.units -= 50; if (target.units <= 0) { target.units = 1; target.sphere_control.gotoAndStop(2); } _root.total_ally_attack_ships -= 1; _root.delete_mc(follower); } if (follower.hitTest(target.sphere_control) && target.sphere_control._currentframe == 1 && target.shield_amount > 0 && follower.shiptype == 4) { target.shield_amount -= 1; if (target.shield_amount <= 0) { target.shield.gotoAndStop(1); _root.total_ally_attack_ships -= 1; _root.delete_mc(follower); } } } function collide(follower, target) { if (follower.hitTest(target.main_ship) == true) { xdist = target._x - follower._x; ydist = target._y - follower._y; distance = Math.sqrt(ydist * ydist + xdist * xdist); overlap = target.radius + follower.radius - distance; follower.moveX += target.moveX * follower.mass * 0.5; follower.moveY += target.moveY * follower.mass * 0.5; if (target.moveX > 0) { target.moveX += Math.abs(target.moveX - overlap); target._x -= overlap; } else { if (target.moveX < 0) { target.moveX -= Math.abs(target.moveX + overlap); target._x += overlap; } } if (target.moveY > 0) { target.moveY += Math.abs(target.moveY - overlap); target._y -= overlap; } else { if (target.moveY < 0) { target.moveY -= Math.abs(target.moveY + overlap); target._y += overlap; } } target.moveX = target.moveX * target.mass * 0.5; target.moveY = target.moveY * target.mass * 0.5; } } var i = 0; while (i < enemiesArray.length) { var tempEnemy = enemiesArray[i]; _root.delete_mc(tempEnemy); ++i; } stop(); var radiance = 57.29577951308232; var ship_speed = _global.ship_speed; var ship_turn = _global.ship_turn_rate; _root.your_lasers_in_play = 0; _root.enemy_lasers_in_play = 0; _root.weaken = 0; _root.enemy_laser_power = 1; _root.enemy_laser_speed = 5; _global.ship_hull = _global.ship_hull_max; _root.sship_random = 10; _root.fram_spawned_on = _root._currentframe; _root.total_ally_attack_ships = 5; _root.enemycount = 1; _root.delete_mc = function (mc) { mc.removeMovieClip(); false; }; _global.updateMainShipPosition = function () { _root.main_ship.distanceX = _xmouse - _root.main_ship._x; _root.main_ship.distanceY = _ymouse - _root.main_ship._y; _root.main_ship.distanceTotal = Math.sqrt(_root.main_ship.distanceX * _root.main_ship.distanceX + _root.main_ship.distanceY * _root.main_ship.distanceY); if (_root.main_ship.distanceTotal <= _root.main_ship.agroRange) { _root.main_ship.moveDistanceX = _root.main_ship.turnRate * _root.main_ship.distanceX / _root.main_ship.distanceTotal; _root.main_ship.moveDistanceY = _root.main_ship.turnRate * _root.main_ship.distanceY / _root.main_ship.distanceTotal; _root.main_ship.moveX += _root.main_ship.moveDistanceX; _root.main_ship.moveY += _root.main_ship.moveDistanceY; _root.main_ship.totalmove = Math.sqrt(_root.main_ship.moveX * _root.main_ship.moveX + _root.main_ship.moveY * _root.main_ship.moveY); _root.main_ship.moveX = _root.main_ship.speed * _root.main_ship.moveX / _root.main_ship.totalmove; _root.main_ship.moveY = _root.main_ship.speed * _root.main_ship.moveY / _root.main_ship.totalmove; _root.main_ship._x += _root.main_ship.moveX; _root.main_ship._y += _root.main_ship.moveY; _root.main_ship._rotation = Math.atan2(_root.main_ship.moveY, _root.main_ship.moveX) * radiance; } }; _root.shoot_your_laser = function () { ++_root.your_lasers_in_play; _root.attachMovie('aria_laser', 'aria_laser_' + _root.your_lasers_in_play, _root.getNextHighestDepth()); _root['aria_laser_' + _root.your_lasers_in_play]._x = _root.main_ship._x; _root['aria_laser_' + _root.your_lasers_in_play]._y = _root.main_ship._y; var v9 = _root.main_ship._rotation; _root['aria_laser_' + _root.your_lasers_in_play].lifeTimer = 150; var v5 = _xmouse - _root.main_ship._x; var v6 = _ymouse - _root.main_ship._y; var v8 = Math.sqrt(v5 * v5 + v6 * v6); var v7 = v8 / _global.ship_laser_speed; _root['aria_laser_' + _root.your_lasers_in_play].xSpeed = v5 / v7; _root['aria_laser_' + _root.your_lasers_in_play].ySpeed = v6 / v7; radAngle = Math.atan2(v6, v5); _root['aria_laser_' + _root.your_lasers_in_play]._rotation = int(radAngle * 360 / 6.283185307179586 + 180); _root['aria_laser_' + _root.your_lasers_in_play].onLoad = function () { this.gotoAndStop(_global.aria_girl); }; _root['aria_laser_' + _root.your_lasers_in_play].onEnterFrame = function () { this._x += this.xSpeed; this._y += this.ySpeed; if (this._x == 0 && this._y == 0) { _root.delete_mc(this); } if (_root._currentframe != _root.fram_spawned_on) { _root.delete_mc(this); } --this.lifeTimer; if (this.lifeTimer <= 0) { _root.delete_mc(this); } if (this.hitTest(_root.ls)) { _root.delete_mc(this); } if (this.hitTest(_root.main_sphere.sphere_control) && _root.main_sphere.sphere_control._currentframe == 1 && _root.main_sphere.shield_amount <= 0) { _root.main_sphere.units -= _global.ship_laser_damage; if (_root.main_sphere.units <= 0) { _root.main_sphere.units = 1; _root.main_sphere.sphere_control.gotoAndStop(2); } _root.delete_mc(this); } if (this.hitTest(_root.main_sphere.sphere_control) && _root.main_sphere.sphere_control._currentframe == 1 && _root.main_sphere.shield_amount > 0) { _root.main_sphere.shield_amount -= 1; if (_root.main_sphere.shield_amount <= 0) { _root.main_sphere.shield.gotoAndStop(1); } _root.delete_mc(this); } var v4 = 0; while (v4 < 200) { if (this.hitTest(_root['enemy' + v4]) == true && _root['enemy' + v4].shiptype != 4) { _root['enemy' + v4].units -= _global.ship_laser_damage; if (_root['enemy' + v4].units <= 0) { _root.delete_mc(_root['enemy' + v4]); } _root.delete_mc(this); } ++v4; } }; }; _root.shoot_enemy_laser = function (fromShip) { if (fromShip && fromShip.shiptype == 1 || fromShip == _root.boss_ship) { ++_root.enemy_lasers_in_play; _root.attachMovie('aria_laser', 'enemy_laser_' + _root.enemy_lasers_in_play, _root.getNextHighestDepth()); _root['enemy_laser_' + _root.enemy_lasers_in_play].previous_selection = fromShip; _root['enemy_laser_' + _root.enemy_lasers_in_play].current_selection = _root.main_ship; if (_root.main_sphere.sphere_control._currentframe == 2) { _root['enemy_laser_' + _root.enemy_lasers_in_play].current_selection = _root.main_sphere; } _root['enemy_laser_' + _root.enemy_lasers_in_play]._x = _root['enemy_laser_' + _root.enemy_lasers_in_play].previous_selection._x; _root['enemy_laser_' + _root.enemy_lasers_in_play]._y = _root['enemy_laser_' + _root.enemy_lasers_in_play].previous_selection._y; var v4 = _root['enemy_laser_' + _root.enemy_lasers_in_play].current_selection._x - _root['enemy_laser_' + _root.enemy_lasers_in_play].previous_selection._x; var v5 = _root['enemy_laser_' + _root.enemy_lasers_in_play].current_selection._y - _root['enemy_laser_' + _root.enemy_lasers_in_play].previous_selection._y; var v8 = Math.sqrt(v4 * v4 + v5 * v5); if (_root.weaken <= 0) { var v6 = v8 / _root.enemy_laser_speed; } else { var v6 = v8; } _root['enemy_laser_' + _root.enemy_lasers_in_play].xSpeed = v4 / v6; _root['enemy_laser_' + _root.enemy_lasers_in_play].ySpeed = v5 / v6; _root['enemy_laser_' + _root.enemy_lasers_in_play].lifeTimer = 150; if (_root.weaken <= 0) { _root['enemy_laser_' + _root.enemy_lasers_in_play].laserdamage = _root.enemy_laser_power; } else { _root['enemy_laser_' + _root.enemy_lasers_in_play].laserdamage = 1; } radAngle = Math.atan2(v5, v4); _root['enemy_laser_' + _root.enemy_lasers_in_play]._rotation = int(radAngle * 360 / 6.283185307179586 + 180); _root['enemy_laser_' + _root.enemy_lasers_in_play].onLoad = function () { this.gotoAndStop(5); }; _root['enemy_laser_' + _root.enemy_lasers_in_play].onEnterFrame = function () { if (this.hitTest(_root.main_ship.laser)) { _root.delete_mc(this); } if (this.hitTest(_root.support_ship.laser)) { _root.delete_mc(this); } if (_root.disaster == 1) { _root.delete_mc(this); } if (this.previous_selection == undefined) { _root.delete_mc(this); } if (_root._currentframe != _root.fram_spawned_on) { _root.delete_mc(this); } --this.lifeTimer; if (this.lifeTimer <= 0) { _root.delete_mc(this); } this._x += this.xSpeed; this._y += this.ySpeed; if (this._x == 0 && this._y == 0) { _root.delete_mc(this); } if (this._x == this.previous_selection._x && this._y == this.previous_selection._y) { } if (this.hitTest(this.current_selection.main_ship) == true) { _global.ship_hull -= this.laserdamage; _root.delete_mc(this); } if (this.hitTest(_root.main_ship.main_ship) == true) { _global.ship_hull -= this.laserdamage; _root.delete_mc(this); } if (this.hitTest(_root.main_sphere.sphere_control) == true && _root.main_sphere.sphere_control._currentframe == 2) { _root.main_sphere.units -= this.laserdamage; if (_root.main_sphere.units <= 0) { _root.main_sphere.units = Math.abs(_root.main_sphere.units); _root.main_sphere.sphere_control.gotoAndStop(1); } _root.delete_mc(this); } }; } }; var enemiesArray = new Array(); var radians = 57.29577951308232; createEnemies(5, 'typeD', 'e4'); createEnemies(4, 'typeA', 'e1'); createEnemies(10, 'typeB', 'e2'); } instance main_sphere of movieClip 380 { onClipEvent (load) { this.fleet_number = 0; this.shield_amount = 0; this.units = _global.node_units + 200; } } instance t of movieClip 382 { onClipEvent (load) { _global.delay = _global.ship_laser_delay; } onClipEvent (enterFrame) { _global.updateMainShipPosition(); if (_global.delay > 0) { --_global.delay; } if (_global.delay < 0) { _global.delay = 0; } _root.updateEnemies(); _root.crashIntoEnemies(); if (Key.isDown(1) == true && _global.delay == 0) { _global.delay = _global.ship_laser_delay; _root.shoot_your_laser(); } if (Key.isDown(49) == true) { if (_root.total_ally_attack_ships < 5) { ++_root.total_ally_attack_ships; _root.createEnemies(1, 'typeD', 'e4'); } } _root.lb.gotoAndStop(_global.ship_hull); if (_global.ship_hull <= 0) { _root.deleteEnemies(); _root.gotoAndStop(20); } } } frame 23 { var i = 0; while (i < enemiesArray.length) { var tempEnemy = enemiesArray[i]; _root.delete_mc(tempEnemy); ++i; } _root.gotoAndStop(30); } frame 24 { function createEnemies(enemyAmount, enemyBehavior, enemyLibraryClip) { var v4 = 0; while (v4 < enemyAmount) { var v2 = _root.attachMovie(enemyLibraryClip, 'enemy' + _root.enemycount, _root.getNextHighestDepth()); ++_root.enemycount; v2._x = random(Stage.width); v2._y = random(Stage.height); v2._rotation = random(360); if (enemyBehavior == 'typeA') { v2.speed = 1; v2.turnRate = 0.05; v2.agroRange = 500; v2.mode = 'follow'; v2.units = 20; v2.shiptype = 1; } else { if (enemyBehavior == 'typeB') { v2.speed = 10; v2.turnRate = 1; v2.agroRange = 800; v2.mode = 'follow'; v2.units = 10; v2.shiptype = 2; } else { if (enemyBehavior == 'typeC') { v2.speed = 1; v2.turnRate = 0.2; v2.agroRange = 100; v2.mode = 'run'; v2.units = 30; v2.shiptype = 3; } else { if (enemyBehavior == 'typeD') { v2.speed = 10; v2.turnRate = 1; v2.agroRange = 1500; v2.mode = 'follow'; v2.units = 10; v2.shiptype = 4; } } } } v2.distanceX = 0; v2.distanceY = 0; v2.distanceTotal = 0; v2.moveDistanceX = 0; v2.moveDistanceY = 0; v2.moveX = 0; v2.moveY = 0; v2.totalmove = 0; v2.mass = 0.7; v2.radius = v2._width / 2; enemiesArray.push(v2); ++v4; } } function updateEnemies() { var v2 = 0; while (v2 < enemiesArray.length) { var v3 = enemiesArray[v2]; updatePosition(v3, _root.main_ship); capture_base(v3, _root.main_sphere); ++v2; } } function deleteEnemies() { var v2 = 0; while (v2 < enemiesArray.length) { var v3 = enemiesArray[v2]; _root.delete_mc(v3); ++v2; } } function crashIntoEnemies() { var v5 = 0; while (v5 < enemiesArray.length) { var v3 = 0; while (v3 < enemiesArray.length) { var v2 = enemiesArray[v5]; var v4 = enemiesArray[v3]; if (v2.hitTest(v4) == true && v2.shiptype == 2 && v4.shiptype == 4) { _root.delete_mc(v2); _root.delete_mc(v4); _root.total_ally_attack_ships -= 1; } ++v3; } ++v5; } } function shootEnemyLasers() { var v2 = 0; while (v2 < enemiesArray.length) { var v3 = enemiesArray[v2]; _root.shoot_enemy_laser(v3); ++v2; } if (_root.boss_ship != undefined) { _root.shoot_enemy_laser(_root.boss_ship); } } function updatePosition(follower, target) { follower.distanceX = target._x - follower._x; follower.distanceY = target._y - follower._y; follower.distanceTotal = Math.sqrt(follower.distanceX * follower.distanceX + follower.distanceY * follower.distanceY); if (follower.distanceTotal <= follower.agroRange) { follower.moveDistanceX = follower.turnRate * follower.distanceX / follower.distanceTotal; follower.moveDistanceY = follower.turnRate * follower.distanceY / follower.distanceTotal; follower.moveX += follower.moveDistanceX; follower.moveY += follower.moveDistanceY; follower.totalmove = Math.sqrt(follower.moveX * follower.moveX + follower.moveY * follower.moveY); follower.moveX = follower.speed * follower.moveX / follower.totalmove; follower.moveY = follower.speed * follower.moveY / follower.totalmove; if (follower.mode == 'follow') { follower._x += follower.moveX; follower._y += follower.moveY; follower._rotation = Math.atan2(follower.moveY, follower.moveX) * radians; } else { if (follower.mode == 'run') { follower._x -= follower.moveX; follower._y -= follower.moveY; follower._rotation = Math.atan2(follower.moveY, follower.moveX) * radians + 180; } } } if (follower.shiptype == 1 && follower.hitTest(_root.main_ship.main_ship) == true) { _global.ship_hull -= 1; } } function capture_base(follower, target) { if (follower.hitTest(target.sphere_control) && target.sphere_control._currentframe == 1 && target.shield_amount <= 0 && follower.shiptype == 4) { target.units -= 50; if (target.units <= 0) { target.units = 1; target.sphere_control.gotoAndStop(2); } _root.total_ally_attack_ships -= 1; _root.delete_mc(follower); } if (follower.hitTest(target.sphere_control) && target.sphere_control._currentframe == 1 && target.shield_amount > 0 && follower.shiptype == 4) { target.shield_amount -= 1; if (target.shield_amount <= 0) { target.shield.gotoAndStop(1); _root.total_ally_attack_ships -= 1; _root.delete_mc(follower); } } } function collide(follower, target) { if (follower.hitTest(target.main_ship) == true) { xdist = target._x - follower._x; ydist = target._y - follower._y; distance = Math.sqrt(ydist * ydist + xdist * xdist); overlap = target.radius + follower.radius - distance; follower.moveX += target.moveX * follower.mass * 0.5; follower.moveY += target.moveY * follower.mass * 0.5; if (target.moveX > 0) { target.moveX += Math.abs(target.moveX - overlap); target._x -= overlap; } else { if (target.moveX < 0) { target.moveX -= Math.abs(target.moveX + overlap); target._x += overlap; } } if (target.moveY > 0) { target.moveY += Math.abs(target.moveY - overlap); target._y -= overlap; } else { if (target.moveY < 0) { target.moveY -= Math.abs(target.moveY + overlap); target._y += overlap; } } target.moveX = target.moveX * target.mass * 0.5; target.moveY = target.moveY * target.mass * 0.5; } } var i = 0; while (i < enemiesArray.length) { var tempEnemy = enemiesArray[i]; _root.delete_mc(tempEnemy); ++i; } stop(); _global.ship_speed = 15; _global.ship_laser_speed = 15; _global.ship_turn_rate = 1; _global.ship_laser_delay = 5; var radiance = 57.29577951308232; var ship_speed = _global.ship_speed; var ship_turn = _global.ship_turn_rate; _root.your_lasers_in_play = 0; _root.enemy_lasers_in_play = 0; _root.weaken = 0; _root.enemy_laser_power = 1; _root.enemy_laser_speed = 5; _global.ship_hull = _global.ship_hull_max; _root.sship_random = 10; _root.fram_spawned_on = _root._currentframe; _root.total_ally_attack_ships = 5; _root.mlaws_shots = 3; _root.enemycount = 1; _root.delete_mc = function (mc) { mc.removeMovieClip(); false; }; _global.updateMainShipPosition = function () { _root.main_ship.distanceX = _xmouse - _root.main_ship._x; _root.main_ship.distanceY = _ymouse - _root.main_ship._y; _root.main_ship.distanceTotal = Math.sqrt(_root.main_ship.distanceX * _root.main_ship.distanceX + _root.main_ship.distanceY * _root.main_ship.distanceY); if (_root.main_ship.distanceTotal <= _root.main_ship.agroRange) { _root.main_ship.moveDistanceX = _root.main_ship.turnRate * _root.main_ship.distanceX / _root.main_ship.distanceTotal; _root.main_ship.moveDistanceY = _root.main_ship.turnRate * _root.main_ship.distanceY / _root.main_ship.distanceTotal; _root.main_ship.moveX += _root.main_ship.moveDistanceX; _root.main_ship.moveY += _root.main_ship.moveDistanceY; _root.main_ship.totalmove = Math.sqrt(_root.main_ship.moveX * _root.main_ship.moveX + _root.main_ship.moveY * _root.main_ship.moveY); _root.main_ship.moveX = _root.main_ship.speed * _root.main_ship.moveX / _root.main_ship.totalmove; _root.main_ship.moveY = _root.main_ship.speed * _root.main_ship.moveY / _root.main_ship.totalmove; _root.main_ship._x += _root.main_ship.moveX; _root.main_ship._y += _root.main_ship.moveY; _root.main_ship._rotation = Math.atan2(_root.main_ship.moveY, _root.main_ship.moveX) * radiance; } }; _root.shoot_your_laser = function () { ++_root.your_lasers_in_play; _root.attachMovie('aria_laser', 'aria_laser_' + _root.your_lasers_in_play, _root.getNextHighestDepth()); _root['aria_laser_' + _root.your_lasers_in_play]._x = _root.main_ship._x; _root['aria_laser_' + _root.your_lasers_in_play]._y = _root.main_ship._y; var v9 = _root.main_ship._rotation; _root['aria_laser_' + _root.your_lasers_in_play].lifeTimer = 150; var v5 = _xmouse - _root.main_ship._x; var v6 = _ymouse - _root.main_ship._y; var v8 = Math.sqrt(v5 * v5 + v6 * v6); var v7 = v8 / _global.ship_laser_speed; _root['aria_laser_' + _root.your_lasers_in_play].xSpeed = v5 / v7; _root['aria_laser_' + _root.your_lasers_in_play].ySpeed = v6 / v7; radAngle = Math.atan2(v6, v5); _root['aria_laser_' + _root.your_lasers_in_play]._rotation = int(radAngle * 360 / 6.283185307179586 + 180); _root['aria_laser_' + _root.your_lasers_in_play].onLoad = function () { this.gotoAndStop(_global.aria_girl); }; _root['aria_laser_' + _root.your_lasers_in_play].onEnterFrame = function () { this._x += this.xSpeed; this._y += this.ySpeed; if (this._x == 0 && this._y == 0) { _root.delete_mc(this); } if (_root._currentframe != _root.fram_spawned_on) { _root.delete_mc(this); } --this.lifeTimer; if (this.lifeTimer <= 0) { _root.delete_mc(this); } if (this.hitTest(_root.ls)) { _root.delete_mc(this); } if (this.hitTest(_root.main_sphere.sphere_control) && _root.main_sphere.sphere_control._currentframe == 1 && _root.main_sphere.shield_amount <= 0) { _root.main_sphere.units -= _global.ship_laser_damage; if (_root.main_sphere.units <= 0) { _root.main_sphere.units = 1; _root.main_sphere.sphere_control.gotoAndStop(2); } _root.delete_mc(this); } if (this.hitTest(_root.main_sphere.sphere_control) && _root.main_sphere.sphere_control._currentframe == 1 && _root.main_sphere.shield_amount > 0) { _root.main_sphere.shield_amount -= 1; if (_root.main_sphere.shield_amount <= 0) { _root.main_sphere.shield.gotoAndStop(1); } _root.delete_mc(this); } var v4 = 0; while (v4 < 200) { if (this.hitTest(_root['enemy' + v4]) == true && _root['enemy' + v4].shiptype != 4) { _root['enemy' + v4].units -= _global.ship_laser_damage; if (_root['enemy' + v4].units <= 0) { _root.delete_mc(_root['enemy' + v4]); } _root.delete_mc(this); } ++v4; } }; }; _root.shoot_enemy_laser = function (fromShip) { if (fromShip && fromShip.shiptype == 1 || fromShip == _root.boss_ship) { ++_root.enemy_lasers_in_play; _root.attachMovie('aria_laser', 'enemy_laser_' + _root.enemy_lasers_in_play, _root.getNextHighestDepth()); _root['enemy_laser_' + _root.enemy_lasers_in_play].previous_selection = fromShip; _root['enemy_laser_' + _root.enemy_lasers_in_play].current_selection = _root.main_ship; if (_root.main_sphere.sphere_control._currentframe == 2) { _root['enemy_laser_' + _root.enemy_lasers_in_play].current_selection = _root.main_sphere; } _root['enemy_laser_' + _root.enemy_lasers_in_play]._x = _root['enemy_laser_' + _root.enemy_lasers_in_play].previous_selection._x; _root['enemy_laser_' + _root.enemy_lasers_in_play]._y = _root['enemy_laser_' + _root.enemy_lasers_in_play].previous_selection._y; var v4 = _root['enemy_laser_' + _root.enemy_lasers_in_play].current_selection._x - _root['enemy_laser_' + _root.enemy_lasers_in_play].previous_selection._x; var v5 = _root['enemy_laser_' + _root.enemy_lasers_in_play].current_selection._y - _root['enemy_laser_' + _root.enemy_lasers_in_play].previous_selection._y; var v8 = Math.sqrt(v4 * v4 + v5 * v5); if (_root.weaken <= 0) { var v6 = v8 / _root.enemy_laser_speed; } else { var v6 = v8; } _root['enemy_laser_' + _root.enemy_lasers_in_play].xSpeed = v4 / v6; _root['enemy_laser_' + _root.enemy_lasers_in_play].ySpeed = v5 / v6; _root['enemy_laser_' + _root.enemy_lasers_in_play].lifeTimer = 150; if (_root.weaken <= 0) { _root['enemy_laser_' + _root.enemy_lasers_in_play].laserdamage = _root.enemy_laser_power; } else { _root['enemy_laser_' + _root.enemy_lasers_in_play].laserdamage = 1; } radAngle = Math.atan2(v5, v4); _root['enemy_laser_' + _root.enemy_lasers_in_play]._rotation = int(radAngle * 360 / 6.283185307179586 + 180); _root['enemy_laser_' + _root.enemy_lasers_in_play].onLoad = function () { this.gotoAndStop(5); }; _root['enemy_laser_' + _root.enemy_lasers_in_play].onEnterFrame = function () { if (this.hitTest(_root.main_ship.laser)) { _root.delete_mc(this); } if (this.hitTest(_root.support_ship.laser)) { _root.delete_mc(this); } if (_root.disaster == 1) { _root.delete_mc(this); } if (this.previous_selection == undefined) { _root.delete_mc(this); } if (_root._currentframe != _root.fram_spawned_on) { _root.delete_mc(this); } --this.lifeTimer; if (this.lifeTimer <= 0) { _root.delete_mc(this); } this._x += this.xSpeed; this._y += this.ySpeed; if (this._x == 0 && this._y == 0) { _root.delete_mc(this); } if (this._x == this.previous_selection._x && this._y == this.previous_selection._y) { } if (this.hitTest(this.current_selection.main_ship) == true) { _global.ship_hull -= this.laserdamage; _root.delete_mc(this); } if (this.hitTest(_root.main_ship.main_ship) == true) { _global.ship_hull -= this.laserdamage; _root.delete_mc(this); } if (this.hitTest(_root.main_sphere.sphere_control) == true && _root.main_sphere.sphere_control._currentframe == 2) { _root.main_sphere.units -= this.laserdamage; if (_root.main_sphere.units <= 0) { _root.main_sphere.units = Math.abs(_root.main_sphere.units); _root.main_sphere.sphere_control.gotoAndStop(1); } _root.delete_mc(this); } }; } }; var enemiesArray = new Array(); var radians = 57.29577951308232; createEnemies(5, 'typeD', 'e4'); createEnemies(8, 'typeA', 'e1'); createEnemies(10, 'typeB', 'e2'); } instance main_sphere of movieClip 380 { onClipEvent (load) { this.fleet_number = 0; this.shield_amount = 0; this.units = _global.node_units + 400; } } instance t of movieClip 382 { onClipEvent (load) { _global.delay = _global.ship_laser_delay; } onClipEvent (enterFrame) { _global.updateMainShipPosition(); if (_global.delay > 0) { --_global.delay; } if (_global.delay < 0) { _global.delay = 0; } _root.updateEnemies(); _root.crashIntoEnemies(); if (Key.isDown(1) == true && _global.delay == 0) { _global.delay = _global.ship_laser_delay; _root.shoot_your_laser(); } if (Key.isDown(49) == true) { if (_root.total_ally_attack_ships < 5) { ++_root.total_ally_attack_ships; _root.createEnemies(1, 'typeD', 'e4'); } } if (Key.isDown(50) == true) { if (_root.main_ship.laser._currentframe == 1 && _root.mlaws_shots > 0) { --_root.mlaws_shots; _root.main_ship.laser.gotoAndPlay(2); } } _root.lb.gotoAndStop(_global.ship_hull); if (_global.ship_hull <= 0) { _root.deleteEnemies(); _root.gotoAndStop(23); } } } instance main_ship of movieClip 422 { onClipEvent (load) { this.main_ship.gotoAndStop(_global.aria_girl); this.speed = 8; this.turnRate = 5; this.agroRange = 1200; this.mode = 'follow'; this.distanceX = 0; this.distanceY = 0; this.distanceTotal = 0; this.moveDistanceX = 0; this.moveDistanceY = 0; this.moveX = 0; this.moveY = 0; this.totalmove = 0; this.radius = this.main_ship._width / 2; this.mass = 0.5; } } instance cursor of movieClip 432 { onClipEvent (enterFrame) { this._x = _root._xmouse; this._y = _root._ymouse; } } frame 25 { function createEnemies(enemyAmount, enemyBehavior, enemyLibraryClip) { var v4 = 0; while (v4 < enemyAmount) { var v2 = _root.attachMovie(enemyLibraryClip, 'enemy' + _root.enemycount, _root.getNextHighestDepth()); ++_root.enemycount; v2._x = random(Stage.width); v2._y = random(Stage.height); v2._rotation = random(360); if (enemyBehavior == 'typeA') { v2.speed = 1; v2.turnRate = 0.05; v2.agroRange = 500; v2.mode = 'follow'; v2.units = 20; v2.shiptype = 1; } else { if (enemyBehavior == 'typeB') { v2.speed = 10; v2.turnRate = 1; v2.agroRange = 800; v2.mode = 'follow'; v2.units = 10; v2.shiptype = 2; } else { if (enemyBehavior == 'typeC') { v2.speed = 1; v2.turnRate = 0.2; v2.agroRange = 100; v2.mode = 'run'; v2.units = 30; v2.shiptype = 3; } else { if (enemyBehavior == 'typeD') { v2.speed = 10; v2.turnRate = 1; v2.agroRange = 1500; v2.mode = 'follow'; v2.units = 10; v2.shiptype = 4; } } } } v2.distanceX = 0; v2.distanceY = 0; v2.distanceTotal = 0; v2.moveDistanceX = 0; v2.moveDistanceY = 0; v2.moveX = 0; v2.moveY = 0; v2.totalmove = 0; v2.mass = 0.7; v2.radius = v2._width / 2; enemiesArray.push(v2); ++v4; } } function updateEnemies() { var v2 = 0; while (v2 < enemiesArray.length) { var v3 = enemiesArray[v2]; updatePosition(v3, _root.main_ship); capture_base(v3, _root.main_sphere); ++v2; } } function deleteEnemies() { var v2 = 0; while (v2 < enemiesArray.length) { var v3 = enemiesArray[v2]; _root.delete_mc(v3); ++v2; } } function crashIntoEnemies() { var v5 = 0; while (v5 < enemiesArray.length) { var v3 = 0; while (v3 < enemiesArray.length) { var v2 = enemiesArray[v5]; var v4 = enemiesArray[v3]; if (v2.hitTest(v4) == true && v2.shiptype == 2 && v4.shiptype == 4) { _root.delete_mc(v2); _root.delete_mc(v4); _root.total_ally_attack_ships -= 1; } ++v3; } ++v5; } } function shootEnemyLasers() { var v2 = 0; while (v2 < enemiesArray.length) { var v3 = enemiesArray[v2]; _root.shoot_enemy_laser(v3); ++v2; } if (_root.boss_ship != undefined) { _root.shoot_enemy_laser(_root.boss_ship); } } function updatePosition(follower, target) { follower.distanceX = target._x - follower._x; follower.distanceY = target._y - follower._y; follower.distanceTotal = Math.sqrt(follower.distanceX * follower.distanceX + follower.distanceY * follower.distanceY); if (follower.distanceTotal <= follower.agroRange) { follower.moveDistanceX = follower.turnRate * follower.distanceX / follower.distanceTotal; follower.moveDistanceY = follower.turnRate * follower.distanceY / follower.distanceTotal; follower.moveX += follower.moveDistanceX; follower.moveY += follower.moveDistanceY; follower.totalmove = Math.sqrt(follower.moveX * follower.moveX + follower.moveY * follower.moveY); follower.moveX = follower.speed * follower.moveX / follower.totalmove; follower.moveY = follower.speed * follower.moveY / follower.totalmove; if (follower.mode == 'follow') { follower._x += follower.moveX; follower._y += follower.moveY; follower._rotation = Math.atan2(follower.moveY, follower.moveX) * radians; } else { if (follower.mode == 'run') { follower._x -= follower.moveX; follower._y -= follower.moveY; follower._rotation = Math.atan2(follower.moveY, follower.moveX) * radians + 180; } } } if (follower.shiptype == 1 && follower.hitTest(_root.main_ship.main_ship) == true) { _global.ship_hull -= 1; } } function capture_base(follower, target) { if (follower.hitTest(target.sphere_control) && target.sphere_control._currentframe == 1 && target.shield_amount <= 0 && follower.shiptype == 4) { target.units -= 50; if (target.units <= 0) { target.units = 1; target.sphere_control.gotoAndStop(2); } _root.total_ally_attack_ships -= 1; _root.delete_mc(follower); } if (follower.hitTest(target.sphere_control) && target.sphere_control._currentframe == 1 && target.shield_amount > 0 && follower.shiptype == 4) { target.shield_amount -= 1; if (target.shield_amount <= 0) { target.shield.gotoAndStop(1); _root.total_ally_attack_ships -= 1; _root.delete_mc(follower); } } } function collide(follower, target) { if (follower.hitTest(target.main_ship) == true) { xdist = target._x - follower._x; ydist = target._y - follower._y; distance = Math.sqrt(ydist * ydist + xdist * xdist); overlap = target.radius + follower.radius - distance; follower.moveX += target.moveX * follower.mass * 0.5; follower.moveY += target.moveY * follower.mass * 0.5; if (target.moveX > 0) { target.moveX += Math.abs(target.moveX - overlap); target._x -= overlap; } else { if (target.moveX < 0) { target.moveX -= Math.abs(target.moveX + overlap); target._x += overlap; } } if (target.moveY > 0) { target.moveY += Math.abs(target.moveY - overlap); target._y -= overlap; } else { if (target.moveY < 0) { target.moveY -= Math.abs(target.moveY + overlap); target._y += overlap; } } target.moveX = target.moveX * target.mass * 0.5; target.moveY = target.moveY * target.mass * 0.5; } } var i = 0; while (i < enemiesArray.length) { var tempEnemy = enemiesArray[i]; _root.delete_mc(tempEnemy); ++i; } stop(); _global.ship_speed = 15; _global.ship_laser_speed = 15; _global.ship_turn_rate = 1; _global.ship_laser_delay = 5; var radiance = 57.29577951308232; var ship_speed = _global.ship_speed; var ship_turn = _global.ship_turn_rate; _root.your_lasers_in_play = 0; _root.enemy_lasers_in_play = 0; _root.weaken = 0; _root.enemy_laser_power = 1; _root.enemy_laser_speed = 5; _global.ship_hull = _global.ship_hull_max; _root.sship_random = 10; _root.fram_spawned_on = _root._currentframe; _root.total_ally_attack_ships = 5; _root.mlaws_shots = 3; _root.enemycount = 1; _root.delete_mc = function (mc) { mc.removeMovieClip(); false; }; _global.updateMainShipPosition = function () { _root.main_ship.distanceX = _xmouse - _root.main_ship._x; _root.main_ship.distanceY = _ymouse - _root.main_ship._y; _root.main_ship.distanceTotal = Math.sqrt(_root.main_ship.distanceX * _root.main_ship.distanceX + _root.main_ship.distanceY * _root.main_ship.distanceY); if (_root.main_ship.distanceTotal <= _root.main_ship.agroRange) { _root.main_ship.moveDistanceX = _root.main_ship.turnRate * _root.main_ship.distanceX / _root.main_ship.distanceTotal; _root.main_ship.moveDistanceY = _root.main_ship.turnRate * _root.main_ship.distanceY / _root.main_ship.distanceTotal; _root.main_ship.moveX += _root.main_ship.moveDistanceX; _root.main_ship.moveY += _root.main_ship.moveDistanceY; _root.main_ship.totalmove = Math.sqrt(_root.main_ship.moveX * _root.main_ship.moveX + _root.main_ship.moveY * _root.main_ship.moveY); _root.main_ship.moveX = _root.main_ship.speed * _root.main_ship.moveX / _root.main_ship.totalmove; _root.main_ship.moveY = _root.main_ship.speed * _root.main_ship.moveY / _root.main_ship.totalmove; _root.main_ship._x += _root.main_ship.moveX; _root.main_ship._y += _root.main_ship.moveY; _root.main_ship._rotation = Math.atan2(_root.main_ship.moveY, _root.main_ship.moveX) * radiance; } }; _root.shoot_your_laser = function () { ++_root.your_lasers_in_play; _root.attachMovie('aria_laser', 'aria_laser_' + _root.your_lasers_in_play, _root.getNextHighestDepth()); _root['aria_laser_' + _root.your_lasers_in_play]._x = _root.main_ship._x; _root['aria_laser_' + _root.your_lasers_in_play]._y = _root.main_ship._y; var v9 = _root.main_ship._rotation; _root['aria_laser_' + _root.your_lasers_in_play].lifeTimer = 150; var v5 = _xmouse - _root.main_ship._x; var v6 = _ymouse - _root.main_ship._y; var v8 = Math.sqrt(v5 * v5 + v6 * v6); var v7 = v8 / _global.ship_laser_speed; _root['aria_laser_' + _root.your_lasers_in_play].xSpeed = v5 / v7; _root['aria_laser_' + _root.your_lasers_in_play].ySpeed = v6 / v7; radAngle = Math.atan2(v6, v5); _root['aria_laser_' + _root.your_lasers_in_play]._rotation = int(radAngle * 360 / 6.283185307179586 + 180); _root['aria_laser_' + _root.your_lasers_in_play].onLoad = function () { this.gotoAndStop(_global.aria_girl); }; _root['aria_laser_' + _root.your_lasers_in_play].onEnterFrame = function () { this._x += this.xSpeed; this._y += this.ySpeed; if (this._x == 0 && this._y == 0) { _root.delete_mc(this); } if (_root._currentframe != _root.fram_spawned_on) { _root.delete_mc(this); } --this.lifeTimer; if (this.lifeTimer <= 0) { _root.delete_mc(this); } if (this.hitTest(_root.ls)) { _root.delete_mc(this); } if (this.hitTest(_root.main_sphere.sphere_control) && _root.main_sphere.sphere_control._currentframe == 1 && _root.main_sphere.shield_amount <= 0) { _root.main_sphere.units -= _global.ship_laser_damage; if (_root.main_sphere.units <= 0) { _root.main_sphere.units = 1; _root.main_sphere.sphere_control.gotoAndStop(2); } _root.delete_mc(this); } if (this.hitTest(_root.main_sphere.sphere_control) && _root.main_sphere.sphere_control._currentframe == 1 && _root.main_sphere.shield_amount > 0) { _root.main_sphere.shield_amount -= 1; if (_root.main_sphere.shield_amount <= 0) { _root.main_sphere.shield.gotoAndStop(1); } _root.delete_mc(this); } var v4 = 0; while (v4 < 250) { if (this.hitTest(_root['enemy' + v4]) == true && _root['enemy' + v4].shiptype != 4) { _root['enemy' + v4].units -= _global.ship_laser_damage; if (_root['enemy' + v4].units <= 0) { _root.delete_mc(_root['enemy' + v4]); } _root.delete_mc(this); } ++v4; } }; }; _root.shoot_enemy_laser = function (fromShip) { if (fromShip && fromShip.shiptype == 1 || fromShip == _root.boss_ship) { ++_root.enemy_lasers_in_play; _root.attachMovie('aria_laser', 'enemy_laser_' + _root.enemy_lasers_in_play, _root.getNextHighestDepth()); _root['enemy_laser_' + _root.enemy_lasers_in_play].previous_selection = fromShip; _root['enemy_laser_' + _root.enemy_lasers_in_play].current_selection = _root.main_ship; if (_root.main_sphere.sphere_control._currentframe == 2) { _root['enemy_laser_' + _root.enemy_lasers_in_play].current_selection = _root.main_sphere; } _root['enemy_laser_' + _root.enemy_lasers_in_play]._x = _root['enemy_laser_' + _root.enemy_lasers_in_play].previous_selection._x; _root['enemy_laser_' + _root.enemy_lasers_in_play]._y = _root['enemy_laser_' + _root.enemy_lasers_in_play].previous_selection._y; var v4 = _root['enemy_laser_' + _root.enemy_lasers_in_play].current_selection._x - _root['enemy_laser_' + _root.enemy_lasers_in_play].previous_selection._x; var v5 = _root['enemy_laser_' + _root.enemy_lasers_in_play].current_selection._y - _root['enemy_laser_' + _root.enemy_lasers_in_play].previous_selection._y; var v8 = Math.sqrt(v4 * v4 + v5 * v5); if (_root.weaken <= 0) { var v6 = v8 / _root.enemy_laser_speed; } else { var v6 = v8; } _root['enemy_laser_' + _root.enemy_lasers_in_play].xSpeed = v4 / v6; _root['enemy_laser_' + _root.enemy_lasers_in_play].ySpeed = v5 / v6; _root['enemy_laser_' + _root.enemy_lasers_in_play].lifeTimer = 150; if (_root.weaken <= 0) { _root['enemy_laser_' + _root.enemy_lasers_in_play].laserdamage = _root.enemy_laser_power; } else { _root['enemy_laser_' + _root.enemy_lasers_in_play].laserdamage = 1; } radAngle = Math.atan2(v5, v4); _root['enemy_laser_' + _root.enemy_lasers_in_play]._rotation = int(radAngle * 360 / 6.283185307179586 + 180); _root['enemy_laser_' + _root.enemy_lasers_in_play].onLoad = function () { this.gotoAndStop(5); }; _root['enemy_laser_' + _root.enemy_lasers_in_play].onEnterFrame = function () { if (this.hitTest(_root.main_ship.laser)) { _root.delete_mc(this); } if (this.hitTest(_root.support_ship.laser)) { _root.delete_mc(this); } if (_root.disaster == 1) { _root.delete_mc(this); } if (this.previous_selection == undefined) { _root.delete_mc(this); } if (_root._currentframe != _root.fram_spawned_on) { _root.delete_mc(this); } --this.lifeTimer; if (this.lifeTimer <= 0) { _root.delete_mc(this); } this._x += this.xSpeed; this._y += this.ySpeed; if (this._x == 0 && this._y == 0) { _root.delete_mc(this); } if (this._x == this.previous_selection._x && this._y == this.previous_selection._y) { } if (this.hitTest(this.current_selection.main_ship) == true) { _global.ship_hull -= this.laserdamage; _root.delete_mc(this); } if (this.hitTest(_root.main_ship.main_ship) == true) { _global.ship_hull -= this.laserdamage; _root.delete_mc(this); } if (this.hitTest(_root.main_sphere.sphere_control) == true && _root.main_sphere.sphere_control._currentframe == 2) { _root.main_sphere.units -= this.laserdamage; if (_root.main_sphere.units <= 0) { _root.main_sphere.units = Math.abs(_root.main_sphere.units); _root.main_sphere.sphere_control.gotoAndStop(1); } _root.delete_mc(this); } }; } }; var enemiesArray = new Array(); var radians = 57.29577951308232; createEnemies(5, 'typeD', 'e4'); createEnemies(18, 'typeA', 'e1'); createEnemies(12, 'typeB', 'e2'); } instance main_sphere of movieClip 380 { onClipEvent (load) { this.fleet_number = 0; this.shield_amount = 0; this.units = _global.node_units + 100; } } frame 26 { var i = 0; while (i < enemiesArray.length) { var tempEnemy = enemiesArray[i]; _root.delete_mc(tempEnemy); ++i; } _root.gotoAndStop(9); } frame 27 { function createEnemies(enemyAmount, enemyBehavior, enemyLibraryClip) { var v4 = 0; while (v4 < enemyAmount) { var v2 = _root.attachMovie(enemyLibraryClip, 'enemy' + _root.enemycount, _root.getNextHighestDepth()); ++_root.enemycount; v2._x = random(Stage.width); v2._y = random(Stage.height); v2._rotation = random(360); if (enemyBehavior == 'typeA') { v2.speed = 1; v2.turnRate = 0.05; v2.agroRange = 500; v2.mode = 'follow'; v2.units = 20; v2.shiptype = 1; } else { if (enemyBehavior == 'typeB') { v2.speed = 10; v2.turnRate = 1; v2.agroRange = 800; v2.mode = 'follow'; v2.units = 10; v2.shiptype = 2; } else { if (enemyBehavior == 'typeC') { v2.speed = 1; v2.turnRate = 0.2; v2.agroRange = 100; v2.mode = 'run'; v2.units = 30; v2.shiptype = 3; } else { if (enemyBehavior == 'typeD') { v2.speed = 10; v2.turnRate = 1; v2.agroRange = 1500; v2.mode = 'follow'; v2.units = 10; v2.shiptype = 4; } } } } v2.distanceX = 0; v2.distanceY = 0; v2.distanceTotal = 0; v2.moveDistanceX = 0; v2.moveDistanceY = 0; v2.moveX = 0; v2.moveY = 0; v2.totalmove = 0; v2.mass = 0.7; v2.radius = v2._width / 2; enemiesArray.push(v2); ++v4; } } function updateEnemies() { var v2 = 0; while (v2 < enemiesArray.length) { var v3 = enemiesArray[v2]; updatePosition(v3, _root.main_ship); capture_base(v3, _root.main_sphere); ++v2; } } function deleteEnemies() { var v2 = 0; while (v2 < enemiesArray.length) { var v3 = enemiesArray[v2]; _root.delete_mc(v3); ++v2; } } function crashIntoEnemies() { var v5 = 0; while (v5 < enemiesArray.length) { var v3 = 0; while (v3 < enemiesArray.length) { var v2 = enemiesArray[v5]; var v4 = enemiesArray[v3]; if (v2.hitTest(v4) == true && v2.shiptype == 2 && v4.shiptype == 4) { _root.delete_mc(v2); _root.delete_mc(v4); _root.total_ally_attack_ships -= 1; } ++v3; } ++v5; } } function shootEnemyLasers() { var v2 = 0; while (v2 < enemiesArray.length) { var v3 = enemiesArray[v2]; _root.shoot_enemy_laser(v3); ++v2; } if (_root.boss_ship != undefined) { _root.shoot_enemy_laser(_root.boss_ship); } } function updatePosition(follower, target) { follower.distanceX = target._x - follower._x; follower.distanceY = target._y - follower._y; follower.distanceTotal = Math.sqrt(follower.distanceX * follower.distanceX + follower.distanceY * follower.distanceY); if (follower.distanceTotal <= follower.agroRange) { follower.moveDistanceX = follower.turnRate * follower.distanceX / follower.distanceTotal; follower.moveDistanceY = follower.turnRate * follower.distanceY / follower.distanceTotal; follower.moveX += follower.moveDistanceX; follower.moveY += follower.moveDistanceY; follower.totalmove = Math.sqrt(follower.moveX * follower.moveX + follower.moveY * follower.moveY); follower.moveX = follower.speed * follower.moveX / follower.totalmove; follower.moveY = follower.speed * follower.moveY / follower.totalmove; if (follower.mode == 'follow') { follower._x += follower.moveX; follower._y += follower.moveY; follower._rotation = Math.atan2(follower.moveY, follower.moveX) * radians; } else { if (follower.mode == 'run') { follower._x -= follower.moveX; follower._y -= follower.moveY; follower._rotation = Math.atan2(follower.moveY, follower.moveX) * radians + 180; } } } if (follower.shiptype == 1 && follower.hitTest(_root.main_ship.main_ship) == true) { _global.ship_hull -= 1; } } function capture_base(follower, target) { if (follower.hitTest(target.sphere_control) && target.sphere_control._currentframe == 1 && target.shield_amount <= 0 && follower.shiptype == 4) { target.units -= 50; if (target.units <= 0) { target.units = 1; target.sphere_control.gotoAndStop(2); } _root.total_ally_attack_ships -= 1; _root.delete_mc(follower); } if (follower.hitTest(target.sphere_control) && target.sphere_control._currentframe == 1 && target.shield_amount > 0 && follower.shiptype == 4) { target.shield_amount -= 1; if (target.shield_amount <= 0) { target.shield.gotoAndStop(1); _root.total_ally_attack_ships -= 1; _root.delete_mc(follower); } } } function collide(follower, target) { if (follower.hitTest(target.main_ship) == true) { xdist = target._x - follower._x; ydist = target._y - follower._y; distance = Math.sqrt(ydist * ydist + xdist * xdist); overlap = target.radius + follower.radius - distance; follower.moveX += target.moveX * follower.mass * 0.5; follower.moveY += target.moveY * follower.mass * 0.5; if (target.moveX > 0) { target.moveX += Math.abs(target.moveX - overlap); target._x -= overlap; } else { if (target.moveX < 0) { target.moveX -= Math.abs(target.moveX + overlap); target._x += overlap; } } if (target.moveY > 0) { target.moveY += Math.abs(target.moveY - overlap); target._y -= overlap; } else { if (target.moveY < 0) { target.moveY -= Math.abs(target.moveY + overlap); target._y += overlap; } } target.moveX = target.moveX * target.mass * 0.5; target.moveY = target.moveY * target.mass * 0.5; } } var i = 0; while (i < enemiesArray.length) { var tempEnemy = enemiesArray[i]; _root.delete_mc(tempEnemy); ++i; } stop(); _global.ship_speed = 15; _global.ship_laser_speed = 15; _global.ship_turn_rate = 1; _global.ship_laser_delay = 5; var radiance = 57.29577951308232; var ship_speed = _global.ship_speed; var ship_turn = _global.ship_turn_rate; _root.your_lasers_in_play = 0; _root.enemy_lasers_in_play = 0; _root.weaken = 0; _root.enemy_laser_power = 1; _root.enemy_laser_speed = 5; _global.ship_hull = _global.ship_hull_max; _root.sship_random = 10; _root.fram_spawned_on = _root._currentframe; _root.total_ally_attack_ships = 5; _root.mlaws_shots = 3; _root.enemycount = 1; _root.delete_mc = function (mc) { mc.removeMovieClip(); false; }; _global.updateMainShipPosition = function () { _root.main_ship.distanceX = _xmouse - _root.main_ship._x; _root.main_ship.distanceY = _ymouse - _root.main_ship._y; _root.main_ship.distanceTotal = Math.sqrt(_root.main_ship.distanceX * _root.main_ship.distanceX + _root.main_ship.distanceY * _root.main_ship.distanceY); if (_root.main_ship.distanceTotal <= _root.main_ship.agroRange) { _root.main_ship.moveDistanceX = _root.main_ship.turnRate * _root.main_ship.distanceX / _root.main_ship.distanceTotal; _root.main_ship.moveDistanceY = _root.main_ship.turnRate * _root.main_ship.distanceY / _root.main_ship.distanceTotal; _root.main_ship.moveX += _root.main_ship.moveDistanceX; _root.main_ship.moveY += _root.main_ship.moveDistanceY; _root.main_ship.totalmove = Math.sqrt(_root.main_ship.moveX * _root.main_ship.moveX + _root.main_ship.moveY * _root.main_ship.moveY); _root.main_ship.moveX = _root.main_ship.speed * _root.main_ship.moveX / _root.main_ship.totalmove; _root.main_ship.moveY = _root.main_ship.speed * _root.main_ship.moveY / _root.main_ship.totalmove; _root.main_ship._x += _root.main_ship.moveX; _root.main_ship._y += _root.main_ship.moveY; _root.main_ship._rotation = Math.atan2(_root.main_ship.moveY, _root.main_ship.moveX) * radiance; } }; _root.target_ret.turnRate = 1; _root.target_ret.moveX = 0; _root.target_ret.moveY = 0; _root.target_ret.speed = 10; _global.updateTargetPosition = function () { _root.target_ret.distanceX = _root.main_ship._x - _root.target_ret._x; _root.target_ret.distanceY = _root.main_ship._y - _root.target_ret._y; _root.target_ret.distanceTotal = Math.sqrt(_root.target_ret.distanceX * _root.target_ret.distanceX + _root.target_ret.distanceY * _root.target_ret.distanceY); if (_root.target_ret.distanceTotal <= 50000) { _root.target_ret.moveDistanceX = _root.target_ret.turnRate * _root.target_ret.distanceX / _root.target_ret.distanceTotal; _root.target_ret.moveDistanceY = _root.target_ret.turnRate * _root.target_ret.distanceY / _root.target_ret.distanceTotal; _root.target_ret.moveX += _root.target_ret.moveDistanceX; _root.target_ret.moveY += _root.target_ret.moveDistanceY; _root.target_ret.totalmove = Math.sqrt(_root.target_ret.moveX * _root.target_ret.moveX + _root.target_ret.moveY * _root.target_ret.moveY); _root.target_ret.moveX = _root.target_ret.speed * _root.target_ret.moveX / _root.target_ret.totalmove; _root.target_ret.moveY = _root.target_ret.speed * _root.target_ret.moveY / _root.target_ret.totalmove; _root.target_ret._x += _root.target_ret.moveX; _root.target_ret._y += _root.target_ret.moveY; } }; _root.shoot_your_laser = function () { ++_root.your_lasers_in_play; _root.attachMovie('aria_laser', 'aria_laser_' + _root.your_lasers_in_play, _root.getNextHighestDepth()); _root['aria_laser_' + _root.your_lasers_in_play]._x = _root.main_ship._x; _root['aria_laser_' + _root.your_lasers_in_play]._y = _root.main_ship._y; var v9 = _root.main_ship._rotation; _root['aria_laser_' + _root.your_lasers_in_play].lifeTimer = 150; var v5 = _xmouse - _root.main_ship._x; var v6 = _ymouse - _root.main_ship._y; var v8 = Math.sqrt(v5 * v5 + v6 * v6); var v7 = v8 / _global.ship_laser_speed; _root['aria_laser_' + _root.your_lasers_in_play].xSpeed = v5 / v7; _root['aria_laser_' + _root.your_lasers_in_play].ySpeed = v6 / v7; radAngle = Math.atan2(v6, v5); _root['aria_laser_' + _root.your_lasers_in_play]._rotation = int(radAngle * 360 / 6.283185307179586 + 180); _root['aria_laser_' + _root.your_lasers_in_play].onLoad = function () { this.gotoAndStop(_global.aria_girl); }; _root['aria_laser_' + _root.your_lasers_in_play].onEnterFrame = function () { this._x += this.xSpeed; this._y += this.ySpeed; if (this._x == 0 && this._y == 0) { _root.delete_mc(this); } if (_root._currentframe != _root.fram_spawned_on) { _root.delete_mc(this); } --this.lifeTimer; if (this.lifeTimer <= 0) { _root.delete_mc(this); } if (this.hitTest(_root.ls)) { _root.delete_mc(this); } if (this.hitTest(_root.main_sphere.sphere_control) && _root.main_sphere.sphere_control._currentframe == 1 && _root.main_sphere.shield_amount <= 0) { _root.main_sphere.units -= _global.ship_laser_damage; if (_root.main_sphere.units <= 0) { _root.main_sphere.units = 1; _root.main_sphere.sphere_control.gotoAndStop(2); } _root.delete_mc(this); } if (this.hitTest(_root.main_sphere.sphere_control) && _root.main_sphere.sphere_control._currentframe == 1 && _root.main_sphere.shield_amount > 0) { _root.main_sphere.shield_amount -= 1; if (_root.main_sphere.shield_amount <= 0) { _root.main_sphere.shield.gotoAndStop(1); } _root.delete_mc(this); } var v4 = 0; while (v4 < 200) { if (this.hitTest(_root['enemy' + v4]) == true && _root['enemy' + v4].shiptype != 4) { _root['enemy' + v4].units -= _global.ship_laser_damage; if (_root['enemy' + v4].units <= 0) { _root.delete_mc(_root['enemy' + v4]); } _root.delete_mc(this); } ++v4; } }; }; _root.shoot_enemy_laser = function (fromShip) { if (fromShip && fromShip.shiptype == 1 || fromShip == _root.boss_ship) { ++_root.enemy_lasers_in_play; _root.attachMovie('aria_laser', 'enemy_laser_' + _root.enemy_lasers_in_play, _root.getNextHighestDepth()); _root['enemy_laser_' + _root.enemy_lasers_in_play].previous_selection = fromShip; _root['enemy_laser_' + _root.enemy_lasers_in_play].current_selection = _root.main_ship; if (_root.main_sphere.sphere_control._currentframe == 2) { _root['enemy_laser_' + _root.enemy_lasers_in_play].current_selection = _root.main_sphere; } _root['enemy_laser_' + _root.enemy_lasers_in_play]._x = _root['enemy_laser_' + _root.enemy_lasers_in_play].previous_selection._x; _root['enemy_laser_' + _root.enemy_lasers_in_play]._y = _root['enemy_laser_' + _root.enemy_lasers_in_play].previous_selection._y; var v4 = _root['enemy_laser_' + _root.enemy_lasers_in_play].current_selection._x - _root['enemy_laser_' + _root.enemy_lasers_in_play].previous_selection._x; var v5 = _root['enemy_laser_' + _root.enemy_lasers_in_play].current_selection._y - _root['enemy_laser_' + _root.enemy_lasers_in_play].previous_selection._y; var v8 = Math.sqrt(v4 * v4 + v5 * v5); if (_root.weaken <= 0) { var v6 = v8 / _root.enemy_laser_speed; } else { var v6 = v8; } _root['enemy_laser_' + _root.enemy_lasers_in_play].xSpeed = v4 / v6; _root['enemy_laser_' + _root.enemy_lasers_in_play].ySpeed = v5 / v6; _root['enemy_laser_' + _root.enemy_lasers_in_play].lifeTimer = 150; if (_root.weaken <= 0) { _root['enemy_laser_' + _root.enemy_lasers_in_play].laserdamage = _root.enemy_laser_power; } else { _root['enemy_laser_' + _root.enemy_lasers_in_play].laserdamage = 1; } radAngle = Math.atan2(v5, v4); _root['enemy_laser_' + _root.enemy_lasers_in_play]._rotation = int(radAngle * 360 / 6.283185307179586 + 180); _root['enemy_laser_' + _root.enemy_lasers_in_play].onLoad = function () { this.gotoAndStop(5); }; _root['enemy_laser_' + _root.enemy_lasers_in_play].onEnterFrame = function () { if (this.hitTest(_root.main_ship.laser)) { _root.delete_mc(this); } if (this.hitTest(_root.support_ship.laser)) { _root.delete_mc(this); } if (_root.disaster == 1) { _root.delete_mc(this); } if (this.previous_selection == undefined) { _root.delete_mc(this); } if (_root._currentframe != _root.fram_spawned_on) { _root.delete_mc(this); } --this.lifeTimer; if (this.lifeTimer <= 0) { _root.delete_mc(this); } this._x += this.xSpeed; this._y += this.ySpeed; if (this._x == 0 && this._y == 0) { _root.delete_mc(this); } if (this._x == this.previous_selection._x && this._y == this.previous_selection._y) { } if (this.hitTest(this.current_selection.main_ship) == true) { _global.ship_hull -= this.laserdamage; _root.delete_mc(this); } if (this.hitTest(_root.main_ship.main_ship) == true) { _global.ship_hull -= this.laserdamage; _root.delete_mc(this); } if (this.hitTest(_root.main_sphere.sphere_control) == true && _root.main_sphere.sphere_control._currentframe == 2) { _root.main_sphere.units -= this.laserdamage; if (_root.main_sphere.units <= 0) { _root.main_sphere.units = Math.abs(_root.main_sphere.units); _root.main_sphere.sphere_control.gotoAndStop(1); } _root.delete_mc(this); } }; } }; var enemiesArray = new Array(); var radians = 57.29577951308232; createEnemies(5, 'typeD', 'e4'); createEnemies(15, 'typeA', 'e1'); createEnemies(10, 'typeB', 'e2'); } movieClip 471 { } movieClip 472 { } instance main_sphere of movieClip 380 { onClipEvent (load) { this.fleet_number = 0; this.shield_amount = 0; this.units = _global.node_units + 100; } } instance t of movieClip 382 { onClipEvent (load) { _global.delay = _global.ship_laser_delay; } onClipEvent (enterFrame) { _global.updateMainShipPosition(); _global.updateTargetPosition(); if (_global.delay > 0) { --_global.delay; } if (_global.delay < 0) { _global.delay = 0; } _root.updateEnemies(); _root.crashIntoEnemies(); if (Key.isDown(1) == true && _global.delay == 0) { _global.delay = _global.ship_laser_delay; _root.shoot_your_laser(); } if (Key.isDown(49) == true) { if (_root.total_ally_attack_ships < 5) { ++_root.total_ally_attack_ships; _root.createEnemies(1, 'typeD', 'e4'); } } if (Key.isDown(50) == true) { if (_root.main_ship.laser._currentframe == 1 && _root.mlaws_shots > 0) { --_root.mlaws_shots; _root.main_ship.laser.gotoAndPlay(2); } } _root.lb.gotoAndStop(_global.ship_hull); if (_global.ship_hull <= 0) { _root.deleteEnemies(); _root.gotoAndStop(26); } } } instance main_ship of movieClip 422 { onClipEvent (load) { this.main_ship.gotoAndStop(_global.aria_girl); this.speed = 8; this.turnRate = 5; this.agroRange = 1200; this.mode = 'follow'; this.distanceX = 0; this.distanceY = 0; this.distanceTotal = 0; this.moveDistanceX = 0; this.moveDistanceY = 0; this.moveX = 0; this.moveY = 0; this.totalmove = 0; this.radius = this.main_ship._width / 2; this.mass = 0.5; } } movieClip 475 { } movieClip 487 { } movieClip 490 { } movieClip 493 { } movieClip 496 { } movieClip 497 { frame 1 { play(); } frame 2 { play(); } frame 3 { _global.enemy_target_blast_amount = random(100) + 50; } frame 40 { bamount = _global.enemy_target_blast_amount; } frame 279 { if (_root.target_ret.circle.hitTest(_root.main_ship.main_ship) == true) { _global.ship_hull -= _global.enemy_target_blast_amount; } } frame 293 { gotoAndPlay(1); } } instance cursor of movieClip 432 { onClipEvent (enterFrame) { this._x = _root._xmouse; this._y = _root._ymouse; } } frame 28 { var i = 0; while (i < enemiesArray.length) { var tempEnemy = enemiesArray[i]; _root.delete_mc(tempEnemy); ++i; } _root.gotoAndStop(10); } movieClip 499 { } movieClip 500 { frame 1 { play(); } instance main_ship of movieClip 422 { onClipEvent (load) { this.main_ship.gotoAndStop(_global.aria_girl); this.speed = 8; this.turnRate = 5; this.agroRange = 1200; this.mode = 'follow'; this.distanceX = 0; this.distanceY = 0; this.distanceTotal = 0; this.moveDistanceX = 0; this.moveDistanceY = 0; this.moveX = 0; this.moveY = 0; this.totalmove = 0; this.radius = this.main_ship._width / 2; this.mass = 0.5; } } frame 90 { _root.gotoAndStop(7); } } movieClip 501 { frame 1 { play(); } instance main_ship of movieClip 422 { onClipEvent (load) { this.main_ship.gotoAndStop(_global.aria_girl); this.speed = 8; this.turnRate = 5; this.agroRange = 1200; this.mode = 'follow'; this.distanceX = 0; this.distanceY = 0; this.distanceTotal = 0; this.moveDistanceX = 0; this.moveDistanceY = 0; this.moveX = 0; this.moveY = 0; this.totalmove = 0; this.radius = this.main_ship._width / 2; this.mass = 0.5; } } frame 90 { _root.gotoAndStop(8); } } movieClip 506 { } movieClip 509 { } movieClip 510 { frame 1 { play(); } instance main_ship of movieClip 422 { onClipEvent (load) { this.main_ship.gotoAndStop(_global.aria_girl); this.speed = 8; this.turnRate = 5; this.agroRange = 1200; this.mode = 'follow'; this.distanceX = 0; this.distanceY = 0; this.distanceTotal = 0; this.moveDistanceX = 0; this.moveDistanceY = 0; this.moveX = 0; this.moveY = 0; this.totalmove = 0; this.radius = this.main_ship._width / 2; this.mass = 0.5; } } frame 90 { _root.gotoAndStop(32); } } button 512 { on (release) { _root.gotoAndStop(33); } } movieClip 515 { frame 1 { if (_global.music == 0) { gotoAndStop(1); } } } frame 33 { _global.aria_girl = 1; _global.ship_speed = 5; _global.ship_laser_speed = 12; _global.ship_turn_rate = 0.5; _global.ship_laser_delay = 15; _global.ship_laser_damage = 10; _global.ship_hull_max = 100; _global.ship_hull = _global.ship_hull_max; _global.node_units = 150; } button 516 { on (release) { _root.gotoAndStop(2); } } movieClip 527 { frame 1 { stop(); } } instance bg of movieClip 527 { onClipEvent (load) { this.gotoAndStop(_global.current_area); } }




http://swfchan.com/44/217524/info.shtml
Created: 16/3 -2019 00:13:41 Last modified: 16/3 -2019 00:13:41 Server time: 21/05 -2019 08:58:04