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

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

Patty Penguin Walrus war.swf

This is the info page for
Flash #46576

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


Text
B

Bl

Music thanks to
nal1200, NemesisTheory,
BazookaZombie

Blu

Blue

Blue K

Blue Ko

Blue Koa

Blue Koal

Blue Koala

Blue Koala P

Blue Koala Pr

Blue Koala Pro

Blue Koala Prod

Blue Koala Produ

Blue Koala Produc

Blue Koala Product

Blue Koala Producti

Blue Koala Productio

Blue Koala Production

Blue Koala Productions

Play

Level Code:

Play intro

Choose Character:

tutorial

Penguin

Bird

Bear

Options

Drop ice cubes
on this button

Remember, ice
cubes can stack

Drop ice cubes on
this walrus-bot,
but dont touch it

Touch this
flag
to win

Press space
when sitting on
top to pick up

Start

Menu

You dont need to kill all the
bad guys, so its ok to just
fly over.

Watch out for the
towers. Dont get
hit by the cogs.

Drop ice cubes on
this walrus-bot,
but dont touch it

Drop ice cubes on
this walrus-bot,
but dont touch it

Drop ice cubes on
this walrus-bot,
but dont touch it

Drop ice cubes on
this walrus-bot,
but dont touch it

Oh yes, they fly

Drop ice cubes on
this walrus-bot,
but dont touch it

Drop ice cubes on
this walrus-bot,
but dont touch it

Drop ice cubes on
this walrus-bot,
but dont touch it

Drop ice cubes on
this walrus-bot,
but dont touch it

Drop ice cubes on
this walrus-bot,
but dont touch it

Drop ice cubes on
this walrus-bot,
but dont touch it

Whoa! What devious
contrapiton is this?

Drop ice cubes on
this walrus-bot,
but dont touch it

Drop ice cubes on
this walrus-bot,
but dont touch it

Drop ice cubes on
this walrus-bot,
but dont touch it

Drop ice cubes on
this walrus-bot,
but dont touch it

Drop ice cubes on
this walrus-bot,
but dont touch it

Dont get your
timing off!

Drop ice cubes on
this walrus-bot,
but dont touch it

Drop ice cubes on
this walrus-bot,
but dont touch it

Drop ice cubes on
this walrus-bot,
but dont touch it

Drop ice cubes on
this walrus-bot,
but dont touch it

Drop ice cubes on
this walrus-bot,
but dont touch it

Hurry up before
the glacier kills you!

Drop ice cubes on
this walrus-bot,
but dont touch it

Drop ice cubes on
this walrus-bot,
but dont touch it

Drop ice cubes on
this walrus-bot,
but dont touch it

Drop ice cubes on
this walrus-bot,
but dont touch it

Hurry up!
More glaciers.

Too little, too late

Drop ice cubes on
this walrus-bot,
but dont touch it

Run Run Run!

Drop ice cubes on
this walrus-bot,
but dont touch it

Drop ice cubes on
this walrus-bot,
but dont touch it

Drop ice cubes on
this walrus-bot,
but dont touch it

Doc.
Walrus

Drop ice cubes on
this walrus-bot,
but dont touch it

Here comes Bossman!
Tip:
Get above him, and
use the platforms
to your advantage.

Doc. Walrus's
Health:

Drop ice cubes on
this walrus-bot,
but dont touch it

Drop ice cubes on
this walrus-bot,
but dont touch it

Drop ice cubes on
this walrus-bot,
but dont touch it

You Lose

Menu

Menu

Level:

1

Level Code:

tutorial

Press Space to
Continue

Menu

Loading

You Win!

Congratz. You saved
penguinkind from Doc.
Walrus. Thank you Patty!

Options

Sound FX

Crying Soul

Rose At Dawn

Select Background Song:

Fall into the Blazing Cold

On

Menu

None

Walrus Colony

Skip

Somewhere on the
coast of Antarctica...

An Evil
Walrus
Proffessor...

Built an
army...

... of Electric
Walruses!

Penguin
Colony

And attacked an
innocent penguin
colony!

The penguins
are
desperate...

"Calling Patty
Penguin!"

ActionScript [AS1/AS2]

Frame 1
MochiAd.showPreGameAd({id:"2894a867d85d188f", res:"550x400"});
Frame 2
cryingSoul = new Sound(_root); cryingSoul.attachSound("BGKICK"); roseAtDawn = new Sound(_root); roseAtDawn.attachSound("rose"); fallIntoTheBlazingCold = new Sound(_root); fallIntoTheBlazingCold.attachSound("fallIntoTheBlazingCold"); cryingSoul.start(0, 9999); explosionS = new Sound(_root); explosionS.attachSound("explosion"); bossexplosion = new Sound(_root); bossexplosion.attachSound("bossexplosion"); hitS = new Sound(_root); hitS.attachSound("hit"); thruster = new Sound(_root); thruster.attachSound("thruster"); pickup = new Sound(_root); pickup.attachSound("pickup"); winS = new Sound(_root); winS.attachSound("pickup");
Frame 3
mute.onRelease = function () { thruster.setVolume(0); }; unMute.onRelease = function () { thruster.setVolume(10); }; medVolume.onRelease = function () { thruster.setVolume(5); };
Frame 81
Frame 84
level = 1; playsounds = true; playhit = false; topHealth = 25; topFlightJuice = 550; regenerateRate = 0.75; gravity = 0.1; thrust = 0.5; topspeed = 6; done = false; options = false; faderbox.gotoAndStop("blue"); speed = 6; type = "penguin"; guy = eval (type); stop(); play.onRelease = function () { if (codeinput == "hogwash") { level = 2; } if (codeinput == "diesel") { level = 3; } if (codeinput == "dwarfer") { level = 4; } if (codeinput == "penguins") { level = 5; } if (codeinput == "partridge") { level = 6; } if (codeinput == "bearmeat") { level = 7; } if (codeinput == "blondie") { level = 8; } if (codeinput == "deathcab") { level = 9; } if (codeinput == "stillalive") { level = 10; } if (codeinput == "suicide") { level = 11; } if (codeinput == "bonkers") { level = 12; } if (codeinput == "lucky13") { level = 13; } if (codeinput == "theboss") { level = 14; } done = true; options = false; }; intro.onRelease = function () { gotoAndPlay ("intro"); }; currentAlpha = 0; play._alpha = currentAlpha; bearB._alpha = currentAlpha; penB._alpha = currentAlpha; birdB._alpha = currentAlpha; optionsB._alpha = currentAlpha; intro._alpha = currentAlpha; fadeIn = function () { currentAlpha = currentAlpha + speed; if (currentAlpha >= 100) { currentAlpha = 100; } play._alpha = currentAlpha; bearB._alpha = currentAlpha; penB._alpha = currentAlpha; birdB._alpha = currentAlpha; optionsB._alpha = currentAlpha; intro._alpha = currentAlpha; }; fadeOut = function () { currentAlpha = currentAlpha - speed; if (currentAlpha <= 0) { currentAlpha = 0; if (options == true) { gotoAndStop ("options"); } else { gotoAndStop ("loading"); } } play._alpha = currentAlpha; bearB._alpha = currentAlpha; penB._alpha = currentAlpha; birdB._alpha = currentAlpha; optionsB._alpha = currentAlpha; intro._alpha = currentAlpha; }; guy.onEnterFrame = function () { if (done == false) { fadeIn(); } else { fadeOut(); } guy = eval (type); guy.gotoX = _root._xmouse; guy.gotoY = _root._ymouse; char = penguin; dx = char._x - char.gotoX; dy = char._y - char.gotoY; char._x = char._x - (dx / 5); char._y = char._y - (dy / 5); char = bird; dx = char._x - char.gotoX; dy = char._y - char.gotoY; char._x = char._x - (dx / 5); char._y = char._y - (dy / 5); char = bear; dx = char._x - char.gotoX; dy = char._y - char.gotoY; char._x = char._x - (dx / 5); char._y = char._y - (dy / 5); }; penB.onRelease = function () { guy = eval (type); guy.gotoX = Stage.width / 2; guy.gotoY = Stage.height + 100; type = "penguin"; guy = eval (type); }; birdB.onRelease = function () { guy = eval (type); guy.gotoX = Stage.width / 2; guy.gotoY = Stage.height + 100; type = "bird"; guy = eval (type); }; bearB.onRelease = function () { guy = eval (type); guy.gotoX = Stage.width / 2; guy.gotoY = Stage.height + 100; type = "bear"; guy = eval (type); }; optionsB.onRelease = function () { done = true; options = true; };
Frame 90
lands = 12; total = 0; rocks = 6; objects = 5; buttons = 3; enemies = 8; notputdown = -1; health = topHealth; healthMultiplier = 100 / health; flightJuice = topFlightJuice; flightMultiplier = 100 / flightJuice; mouse.maxWidth = 62.1; landWidth = 188; onLandNum = 0; globalX = 0; globalY = 0; win = false; mousehitsbuttons = false; topsmoke = 5; smoke = 0; thrustsoundpauser = 0; totalforthruster = 4; fadein = true; loading = true; stop(); mouse = eval (type); mouse._x = startX._x; mouse._y = startX._y; startX._x = -100; startX._y = -100; mouse.dy = 0; mouse.dx = 0; mouse.oX = mouse._x; mouse.oY = mouse._y; explosion.oX = -10000; explosion.oY = -10000; leftbarrier.oX = leftbarrier._x; leftbarrier.oY = leftbarrier._y; rightbarrier.oX = rightbarrier._x; rightbarrier.oY = rightbarrier._y; topbarrier.oX = topbarrier._x; topbarrier.oY = topbarrier._y; bottombarrier.oX = bottombarrier._x; bottombarrier.oY = bottombarrier._y; end.oX = end._x; end.oY = end._y; enemy1.tower = false; enemy2.tower = false; enemy3.tower = false; enemy4.tower = false; enemy5.tower = true; enemy6.tower = true; enemy7.tower = true; enemy8.tower = true; i = 0; while (i <= objects) { currentObject = eval ("object" + i); currentObject.oX = currentObject._x; currentObject.oY = currentObject._y; i++; } enemy1.gotoLeft = true; i = 1; while (i <= enemies) { currentEnemy = eval ("enemy" + i); currentEnemy.health = 8; currentEnemy.speed = 2; firstFlag = eval ("firstPatrolMarker" + i); secondFlag = eval ("secondPatrolMarker" + i); currentEnemy.patrolLength = secondFlag._x - firstFlag._x; currentEnemy.patrolPoint = currentEnemy._x - firstFlag._x; firstFlag._x = -100; secondFlag._x = -100; currentEnemy.damage = 1; currentEnemy.oX = currentEnemy._x; currentEnemy.oY = currentEnemy._y; currentEnemy.dead = false; currentEnemy.gotoLeft = true; i++; } i = 0; while (i <= enemies) { currentEnemy = eval ("enemy" + i); if (currentEnemy.tower == true) { currentEnemy.counter = 0; currentEnemy.counterLimit = 60; currentEnemy.launchSpeed = 2; currentEnemy.health = 20; } i++; } i = 0; while (i <= buttons) { currentButton = eval ("button" + i); currentButton.pressed = false; currentButton.oX = currentButton._x; currentButton.oY = currentButton._y; currentResponder = eval ("responder" + i); currentResponder.oX = currentResponder._x; currentResponder.oY = currentResponder._y; currentResponder.fadeOut = false; currentResponder.alpha = 100; currentResponder.speed = 6; i++; } i = 0; while (i <= rocks) { currentRock = eval ("rock" + i); currentRock.oX = currentRock._x; currentRock.oY = currentRock._y; currentRock.dx = 0; currentRock.dy = 0; currentRock.originX = currentRock._x; currentRock.originY = currentRock._y; i++; } i = 0; while (i <= lands) { currentLand = eval ("land" + i); currentLand.oX = currentLand._x; currentLand.oY = currentLand._y; i++; } mouse.onEnterFrame = function () { if (fadein == true) { fadeIn(); } else { fadeOut(); } mouse.dy = mouse.dy + gravity; mouse._y = mouse._y + mouse.dy; mouse._x = mouse._x + mouse.dx; healthbar._xscale = health * healthMultiplier; if (flightJuice > 0) { flightbar._xscale = flightJuice * flightMultiplier; } if (health <= 0) { fadein = false; loading = false; } if (health < topHealth) { health = health + (regenerateRate / 5); } if (flightJuice < topFlightJuice) { flightJuice = flightJuice + regenerateRate; } dx = (Stage.width / 2) - mouse._x; dy = (Stage.width / 2) - mouse._y; dx = dx / 4; dy = dy / 4; if (mouse.dx > topspeed) { mouse.dx = topspeed; } if (mouse.dx < (-topspeed)) { mouse.dx = -topspeed; } if (mouse.dy > topspeed) { mouse.dy = topspeed; } if (mouse.dy < (-topspeed)) { mouse.dy = -topspeed; } globalX = globalX + dx; globalY = globalY + dy; i = 1; while (i <= lands) { currentLand = eval ("land" + i); currentLand._x = currentLand.oX + globalX; currentLand._y = currentLand.oY + globalY; i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); currentRock._x = currentRock.oX + globalX; currentRock._y = currentRock.oY + globalY; i++; } i = 1; while (i <= enemies) { currentEnemy = eval ("enemy" + i); currentEnemy._x = currentEnemy.oX + globalX; currentEnemy._y = currentEnemy.oY + globalY; if (currentEnemy.tower) { currentBullet = eval ("bullet" + i); currentBullet._x = currentBullet.oX + globalX; currentBullet._y = currentBullet.oY + globalY; } i++; } explosion._x = explosion.oX + globalX; explosion._y = explosion.oY + globalY; i = 0; while (i <= buttons) { currentButton = eval ("button" + i); currentResponder = eval ("responder" + i); currentButton._x = currentButton.oX + globalX; currentButton._y = currentButton.oY + globalY; currentResponder._x = currentResponder.oX + globalX; currentResponder._y = currentResponder.oY + globalY; i++; } i = 0; while (i <= objects) { currentObject = eval ("object" + i); currentObject._x = currentObject.oX + globalX; currentObject._y = currentObject.oY + globalY; i++; } leftbarrier._x = leftbarrier.oX + globalX; leftbarrier._y = leftbarrier.oY + globalY; rightbarrier._x = rightbarrier.oX + globalX; rightbarrier._y = rightbarrier.oY + globalY; topbarrier._x = topbarrier.oX + globalX; topbarrier._y = topbarrier.oY + globalY; bottombarrier._x = bottombarrier.oX + globalX; bottombarrier._y = bottombarrier.oY + globalY; end._x = end.oX + globalX; end._y = end.oY + globalY; mouse.oX = mouse.oX + dx; mouse.oY = mouse.oY + dy; mouse._y = mouse._y + dy; mouse._x = mouse._x + dx; bg._x = bg._x + (dx / 3); bg._y = bg._y + (dy / 3); if (notputdown != -1) { currentRock = eval ("rock" + notputdown); currentRock._x = mouse._x; currentRock._y = mouse._y + 25; currentRock.dx = mouse.dx; currentRock.dy = mouse.dy; } onLand = false; i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (mouse._y < (currentLand._y + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = currentLand._y; onLand = true; onLandNum = i; } else if (mouse._y > (((currentLand._y + 35.5) + 25.4) + (mouse.dy * 1.2))) { mouse.dy = mouse.dy * -1; mouse._y = mouse._y + (mouse.dy * 1.5); } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } i++; } if (notputdown != -1) { currentRock = eval ("rock" + notputdown); i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (currentRock.hitTest(currentLand)) { if (currentRock._y < (currentLand._y + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = currentLand._y - 25; onLand = true; onLandNum = i; } else if (currentRock._y > (((currentLand._y + 35) + 27) + (mouse.dy * 1.2))) { mouse.dy = mouse.dy * -1; mouse._y = mouse._y + (mouse.dy * 1.5); } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } i++; } notDropRock = eval ("rock" + notputdown); i = 1; while (i <= rocks) { if (i != notputdown) { currentRock = eval ("rock" + i); if (notDropRock.hitTest(currentRock)) { if (notDropRock._y < ((currentRock._y - 25) + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = currentRock._y - 54; onLand = true; } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } } i++; } } if (mouse.hitTest(leftbarrier)) { mouse.dx = mouse.dx * -1; mouse.oX = mouse.oX + (mouse.dx * 6); } if (mouse.hitTest(rightbarrier)) { mouse.dx = mouse.dx * -1; mouse.oX = mouse.oX + (mouse.dx * 6); } if (mouse.hitTest(topbarrier)) { mouse.dy = mouse.dy * -1; mouse.oY = mouse.oY + (mouse.dy * 6); } if (mouse.hitTest(bottombarrier)) { mouse.dy = mouse.dy * -1; mouse.oY = mouse.oY + (mouse.dy * 6); } i = 0; while (i <= rocks) { currentRock = eval ("rock" + i); if (currentRock.hitTest(leftbarrier)) { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 6); } if (currentRock.hitTest(rightbarrier)) { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 6); } if (currentRock.hitTest(topbarrier)) { currentRock.dy = currentRock.dy * -1; currentRock.oY = currentRock.oY + (currentRock.dy * 6); } if (currentRock.hitTest(bottombarrier)) { currentRock.dy = currentRock.dy * -1; currentRock.oX = currentRock.oX + (currentRock.dy * 6); } i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); e = 1; while (e <= enemies) { currentEnemy = eval ("enemy" + e); if (currentRock.hitTest(currentEnemy)) { if (currentRock._y < currentEnemy._y) { if (currentRock.dy > 0) { if (playsounds) { } currentEnemy.health = currentEnemy.health - currentRock.dy; if (currentEnemy.tower == false) { currentEnemy._yscale = currentEnemy.health * 10; } else { currentEnemy._yscale = currentEnemy.health * 5; } currentEnemy.speed = 0; currentRock.dy = 0; currentRock.dx = 0; if (notputdown == i) { mouse._y = mouse._y - 5; mouse.dy = mouse.dy - 1; currentX = currentRock.oX + globalX; currentY = currentRock.oY + globalY; dx = mouse._x - currentX; dy = mouse._y - currentY; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); notputdown = -1; } if (currentEnemy.health <= 1) { if (i != notputdown) { if (playsounds) { explosionS.start(0, 1); } explosion.oX = currentEnemy.oX; explosion.oY = currentEnemy.oY; if (currentEnemy.tower == true) { explosion._yscale = 200; explosion._xscale = 100; } else { explosion._yscale = 65; explosion._xscale = 65; } explosion.gotoAndPlay(1); currentEnemy.oX = -1000; currentEnemy.oY = -1000; } else { if (playsounds) { explosionS.start(0, 1); } if (currentEnemy.tower == true) { explosion._yscale = 200; explosion._xscale = 100; } else { explosion._yscale = 65; explosion._xscale = 65; } explosion.gotoAndPlay(1); currentEnemy.oX = -1000; currentEnemy.oY = -1000; mouse._y = mouse._y - 5; mouse.dy = mouse.dy - 1; currentX = currentRock.oX + globalX; currentY = currentRock.oY + globalY; dx = mouse._x - currentX; dy = mouse._y - currentY; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); notputdown = -1; } currentEnemy.dead = true; } } } } e++; } i++; } i = 1; while (i <= rocks) { if (i != notputdown) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (mouse._y < ((currentRock._y - 25) + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = (currentRock.oY + globalY) - 26; onLand = true; } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } } i++; } i = 0; while (i <= buttons) { currentResponder = eval ("responder" + i); if (mouse.hitTest(currentResponder)) { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } i++; } pressed = false; if (Key.isDown(38)) { if (onLand) { mouse.dy = -2; mouse._y = mouse._y + mouse.dy; } else if (flightJuice > 0) { pressed = true; mouse.gotoAndStop("up"); mouse.dy = mouse.dy - thrust; flightJuice = flightJuice - 1; } } if (Key.isDown(40)) { if (onLand) { } else if (flightJuice > 0) { pressed = true; mouse.gotoAndStop("down"); mouse.dy = mouse.dy + thrust; flightJuice = flightJuice - 1; } if (mouse.hitTest(topbarrier)) { mouse._y = mouse._y + 7; } i = 0; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (currentLand._y < (mouse._y - 5)) { mouse._y = mouse._y + 7; } } i++; } } if (Key.isDown(37)) { pressed = true; if (onLand) { mouse.dx = mouse.dx - thrust; mouse.gotoAndStop("left"); } else if (flightJuice > 0) { pressed = true; mouse.dx = mouse.dx - thrust; mouse.gotoAndStop("left"); flightJuice = flightJuice - 1; } i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (i != onLandNum) { if (mouse._y > currentLand._y) { mouse._x = mouse._x - 7; } } } i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (mouse._y > (currentRock._y - 26)) { if (i != notputdown) { mouse._x = mouse._x - 7; } } } i++; } i = 0; while (i <= buttons) { currentResponder = eval ("responder" + i); if (mouse.hitTest(currentResponder)) { mouse._x = mouse._x - 7; } i++; } if (mouse.hitTest(rightbarrier)) { mouse._x = mouse._x - 7; } } else if (Key.isDown(39)) { pressed = true; if (onLand) { mouse.dx = mouse.dx + thrust; mouse.gotoAndStop("left"); } else if (flightJuice > 0) { pressed = true; mouse.dx = mouse.dx + thrust; mouse.gotoAndStop("left"); flightJuice = flightJuice - 1; } mouse.gotoAndStop("right"); i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (i != onLandNum) { if (mouse._y > currentLand._y) { mouse._x = mouse._x + 7; } } } i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (mouse._y > (currentRock._y - 26)) { if (i != notputdown) { mouse._x = mouse._x + 7; } } } i++; } i = 0; while (i <= buttons) { currentResponder = eval ("responder" + i); if (mouse.hitTest(currentResponder)) { mouse._x = mouse._x + 7; } i++; } if (mouse.hitTest(leftbarrier)) { mouse._x = mouse._x + 7; } } else if (mouse.dx < 0) { mouse.dx = mouse.dx + thrust; } else if (mouse.dx > 0) { mouse.dx = mouse.dx - thrust; } if (mouse.dx < 0.1) { if (mouse.dx > 0) { mouse.dx = 0; } } if (mouse.dx > -0.1) { if (mouse.dx < 0) { mouse.dx = 0; } } if (pressed == false) { mouse.gotoAndStop("center"); } if (pressed == true) { if (playsounds) { thrustsoundpauser++; if (thrustsoundpauser == totalforthruster) { thruster.start(0, 1); thrustsoundpauser = 0; } } } if (Key.isDown(32)) { if (donePressSpace) { donePressSpace = false; if (notputdown == -1) { i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (playsounds) { pickup.start(0, 1); } notputdown = i; dx = mouse._x - currentRock._x; dy = mouse._y - currentRock._y; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); } i++; } } else { mouse._y = mouse._y - 5; mouse.dy = mouse.dy - 1; if (playsounds) { pickup.start(0, 1); } currentRock = eval ("rock" + notputdown); currentX = currentRock.oX + globalX; currentY = currentRock.oY + globalY; dx = mouse._x - currentX; dy = mouse._y - currentY; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); notputdown = -1; } } } else { donePressSpace = true; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (i != notputdown) { currentRock.dy = currentRock.dy + gravity; currentRock.oX = currentRock.oX + currentRock.dx; currentRock.oY = currentRock.oY + currentRock.dy; } l = 1; while (l <= lands) { currentLand = eval ("land" + l); if (currentRock.hitTest(currentLand)) { if (currentRock._y < ((currentLand._y + currentRock.dy) + 0.5)) { currentRock.oY = currentLand.oY; currentRock.dy = 0; currentRock.dx = 0; } else if (currentRock._y > (currentLand._y + 25.5)) { currentRock.dy = currentRock.dy * -1; currentRock.oY = currentRock.oY + (currentRock.dy * 2); } else { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 4); } } l++; } b = 1; while (b <= rocks) { otherRock = eval ("rock" + b); if (b != i) { if (currentRock.hitTest(otherRock)) { if (currentRock.oY < otherRock.oY) { currentRock.oY = otherRock.oY - 29; currentRock.dy = 0; currentRock.dx = 0; } } } b++; } b = 0; while (b <= buttons) { currentResponder = eval ("responder" + b); if (currentRock.hitTest(currentResponder)) { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 6); } b++; } i++; } i = 1; while (i <= enemies) { currentEnemy = eval ("enemy" + i); if (currentEnemy.tower == false) { if (currentEnemy.gotoLeft == true) { if (currentEnemy.patrolPoint < currentEnemy.patrolLength) { currentEnemy.oX = currentEnemy.oX + currentEnemy.speed; currentEnemy.patrolPoint = currentEnemy.patrolPoint + currentEnemy.speed; } else { currentEnemy.gotoLeft = false; currentEnemy.gotoAndPlay("turn"); } } else if (currentEnemy.patrolPoint > 0) { currentEnemy.oX = currentEnemy.oX - currentEnemy.speed; currentEnemy.patrolPoint = currentEnemy.patrolPoint - currentEnemy.speed; } else { currentEnemy.gotoLeft = true; currentEnemy.gotoAndPlay("turn"); } } i++; } i = 0; while (i <= enemies) { currentEnemy = eval ("enemy" + i); if (mouse.hitTest(currentEnemy)) { if (currentEnemy.tower == false) { health = health - currentEnemy.damage; } } if (currentEnemy.tower == true) { currentBullet = eval ("bullet" + i); if (mouse.hitTest(currentBullet)) { health = health - currentEnemy.damage; } } i++; } i = 0; while (i <= buttons) { currentButton = eval ("button" + i); currentResponder = eval ("responder" + i); hit = false; r = 0; while (r <= rocks) { currentRock = eval ("rock" + r); if (currentButton.hitTest(currentRock)) { hit = true; if (currentButton.pressed == false) { currentButton.pressed = true; currentResponder.oX = currentResponder.oX + 10000; } } r++; } if (mousehitsbuttons == true) { if (mouse.hitTest(currentButton)) { hit = true; if (currentButton.pressed == false) { currentButton.pressed = true; currentResponder.oX = currentResponder.oX + 10000; } } } if (hit == false) { if (currentButton.pressed == true) { currentButton.pressed = false; currentResponder.oX = currentResponder.oX - 10000; currentResponder.alpha = 0; } } i++; } currentResponder.fadeOut = false; currentResponder.alpha = 100; currentResponder.speed = 6; if (mouse.hitTest(end)) { if (win == false) { level++; winS.start(0, 1); end.gotoAndPlay("win"); win = true; } } i = 0; while (i <= enemies) { currentTower = eval ("enemy" + i); if (currentTower.tower == true) { currentTop = eval ("towertop" + i); currentBullet = eval ("bullet" + i); currentTop._x = currentTower._x; currentTop._y = currentTower._y - (95 * (currentTower._yscale / 100)); currentTop._yscale = currentTower._yscale; dx = currentTop._x - mouse._x; dy = currentTop._y - mouse._y; radians = Math.atan(dy / dx); degrees = (radians * 180) / Math.PI; if (dx > 0) { degrees = degrees + 180; } radians = (degrees / 180) * Math.PI; degrees = degrees + 90; currentTop._rotation = degrees; distance = Math.sqrt((dx * dx) + (dy * dy)); currentTower.counter++; if (currentTower.counter >= currentTower.counterLimit) { currentTower.counter = 0; currentBullet.oX = currentTower.oX; currentBullet.oY = currentTower.oY - (95 * (currentTower._yscale / 100)); currentBullet.dx = Math.cos(radians) * currentTower.launchSpeed; currentBullet.dy = Math.sin(radians) * currentTower.launchSpeed; } currentBullet.oX = currentBullet.oX + currentBullet.dx; currentBullet.oY = currentBullet.oY + currentBullet.dy; } i++; } }; menu.onRelease = function () { gotoAndStop ("menu"); }; currentAlpha = 100; faderbox._alpha = currentAlpha; fadeOut = function () { if (loading == true) { faderbox.gotoAndStop("blue"); } if (loading == false) { faderbox.gotoAndStop("red"); } currentAlpha = currentAlpha + speed; if (currentAlpha >= 100) { currentAlpha = 100; if (loading == true) { gotoAndStop ("loading"); } if (loading == false) { gotoAndStop ("lose"); } } faderbox._x = 0; faderbox._y = 0; faderbox._alpha = currentAlpha; }; fadeIn = function () { faderbox.gotoAndStop("blue"); currentAlpha = currentAlpha - speed; if (currentAlpha <= 0) { currentAlpha = 0; faderbox._x = -10000; faderbox._y = -10000; } faderbox._alpha = currentAlpha; if (health < topHealth) { faderbox.gotoAndStop("red"); faderbox._x = 0; faderbox._y = 0; faderbox._alpha = (100 - (health * healthMultiplier)) - 20; if (faderbox._alpha < 0) { faderbox._alpha = 0; } currentAlpha = faderbox._alpha; } };
Frame 91
lands = 12; total = 0; rocks = 6; objects = 5; buttons = 3; enemies = 8; notputdown = -1; health = topHealth; healthMultiplier = 100 / health; flightJuice = topFlightJuice; flightMultiplier = 100 / flightJuice; mouse.maxWidth = 62.1; landWidth = 188; onLandNum = 0; globalX = 0; globalY = 0; win = false; mousehitsbuttons = false; topsmoke = 5; smoke = 0; thrustsoundpauser = 0; totalforthruster = 4; fadein = true; loading = true; stop(); mouse = eval (type); mouse._x = startX._x; mouse._y = startX._y; startX._x = -100; startX._y = -100; mouse.dy = 0; mouse.dx = 0; mouse.oX = mouse._x; mouse.oY = mouse._y; explosion.oX = -10000; explosion.oY = -10000; leftbarrier.oX = leftbarrier._x; leftbarrier.oY = leftbarrier._y; rightbarrier.oX = rightbarrier._x; rightbarrier.oY = rightbarrier._y; topbarrier.oX = topbarrier._x; topbarrier.oY = topbarrier._y; bottombarrier.oX = bottombarrier._x; bottombarrier.oY = bottombarrier._y; end.oX = end._x; end.oY = end._y; enemy1.tower = false; enemy2.tower = false; enemy3.tower = false; enemy4.tower = false; enemy5.tower = true; enemy6.tower = true; enemy7.tower = true; enemy8.tower = true; i = 0; while (i <= objects) { currentObject = eval ("object" + i); currentObject.oX = currentObject._x; currentObject.oY = currentObject._y; i++; } enemy1.gotoLeft = true; i = 1; while (i <= enemies) { currentEnemy = eval ("enemy" + i); currentEnemy.health = 8; currentEnemy.speed = 2; firstFlag = eval ("firstPatrolMarker" + i); secondFlag = eval ("secondPatrolMarker" + i); currentEnemy.patrolLength = secondFlag._x - firstFlag._x; currentEnemy.patrolPoint = currentEnemy._x - firstFlag._x; firstFlag._x = -100; secondFlag._x = -100; currentEnemy.damage = 1; currentEnemy.oX = currentEnemy._x; currentEnemy.oY = currentEnemy._y; currentEnemy.dead = false; currentEnemy.gotoLeft = true; i++; } i = 0; while (i <= enemies) { currentEnemy = eval ("enemy" + i); if (currentEnemy.tower == true) { currentEnemy.counter = 0; currentEnemy.counterLimit = 60; currentEnemy.launchSpeed = 2; currentEnemy.health = 20; } i++; } i = 0; while (i <= buttons) { currentButton = eval ("button" + i); currentButton.pressed = false; currentButton.oX = currentButton._x; currentButton.oY = currentButton._y; currentResponder = eval ("responder" + i); currentResponder.oX = currentResponder._x; currentResponder.oY = currentResponder._y; currentResponder.fadeOut = false; currentResponder.alpha = 100; currentResponder.speed = 6; i++; } i = 0; while (i <= rocks) { currentRock = eval ("rock" + i); currentRock.oX = currentRock._x; currentRock.oY = currentRock._y; currentRock.dx = 0; currentRock.dy = 0; currentRock.originX = currentRock._x; currentRock.originY = currentRock._y; i++; } i = 0; while (i <= lands) { currentLand = eval ("land" + i); currentLand.oX = currentLand._x; currentLand.oY = currentLand._y; i++; } mouse.onEnterFrame = function () { if (fadein == true) { fadeIn(); } else { fadeOut(); } mouse.dy = mouse.dy + gravity; mouse._y = mouse._y + mouse.dy; mouse._x = mouse._x + mouse.dx; healthbar._xscale = health * healthMultiplier; if (flightJuice > 0) { flightbar._xscale = flightJuice * flightMultiplier; } if (health <= 0) { fadein = false; loading = false; } if (health < topHealth) { health = health + (regenerateRate / 5); } if (flightJuice < topFlightJuice) { flightJuice = flightJuice + regenerateRate; } dx = (Stage.width / 2) - mouse._x; dy = (Stage.width / 2) - mouse._y; dx = dx / 4; dy = dy / 4; if (mouse.dx > topspeed) { mouse.dx = topspeed; } if (mouse.dx < (-topspeed)) { mouse.dx = -topspeed; } if (mouse.dy > topspeed) { mouse.dy = topspeed; } if (mouse.dy < (-topspeed)) { mouse.dy = -topspeed; } globalX = globalX + dx; globalY = globalY + dy; i = 1; while (i <= lands) { currentLand = eval ("land" + i); currentLand._x = currentLand.oX + globalX; currentLand._y = currentLand.oY + globalY; i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); currentRock._x = currentRock.oX + globalX; currentRock._y = currentRock.oY + globalY; i++; } i = 1; while (i <= enemies) { currentEnemy = eval ("enemy" + i); currentEnemy._x = currentEnemy.oX + globalX; currentEnemy._y = currentEnemy.oY + globalY; if (currentEnemy.tower) { currentBullet = eval ("bullet" + i); currentBullet._x = currentBullet.oX + globalX; currentBullet._y = currentBullet.oY + globalY; } i++; } explosion._x = explosion.oX + globalX; explosion._y = explosion.oY + globalY; i = 0; while (i <= buttons) { currentButton = eval ("button" + i); currentResponder = eval ("responder" + i); currentButton._x = currentButton.oX + globalX; currentButton._y = currentButton.oY + globalY; currentResponder._x = currentResponder.oX + globalX; currentResponder._y = currentResponder.oY + globalY; i++; } i = 0; while (i <= objects) { currentObject = eval ("object" + i); currentObject._x = currentObject.oX + globalX; currentObject._y = currentObject.oY + globalY; i++; } leftbarrier._x = leftbarrier.oX + globalX; leftbarrier._y = leftbarrier.oY + globalY; rightbarrier._x = rightbarrier.oX + globalX; rightbarrier._y = rightbarrier.oY + globalY; topbarrier._x = topbarrier.oX + globalX; topbarrier._y = topbarrier.oY + globalY; bottombarrier._x = bottombarrier.oX + globalX; bottombarrier._y = bottombarrier.oY + globalY; end._x = end.oX + globalX; end._y = end.oY + globalY; mouse.oX = mouse.oX + dx; mouse.oY = mouse.oY + dy; mouse._y = mouse._y + dy; mouse._x = mouse._x + dx; bg._x = bg._x + (dx / 3); bg._y = bg._y + (dy / 3); if (notputdown != -1) { currentRock = eval ("rock" + notputdown); currentRock._x = mouse._x; currentRock._y = mouse._y + 25; currentRock.dx = mouse.dx; currentRock.dy = mouse.dy; } onLand = false; i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (mouse._y < (currentLand._y + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = currentLand._y; onLand = true; onLandNum = i; } else if (mouse._y > (((currentLand._y + 35.5) + 25.4) + (mouse.dy * 1.2))) { mouse.dy = mouse.dy * -1; mouse._y = mouse._y + (mouse.dy * 1.5); } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } i++; } if (notputdown != -1) { currentRock = eval ("rock" + notputdown); i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (currentRock.hitTest(currentLand)) { if (currentRock._y < (currentLand._y + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = currentLand._y - 25; onLand = true; onLandNum = i; } else if (currentRock._y > (((currentLand._y + 35) + 27) + (mouse.dy * 1.2))) { mouse.dy = mouse.dy * -1; mouse._y = mouse._y + (mouse.dy * 1.5); } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } i++; } notDropRock = eval ("rock" + notputdown); i = 1; while (i <= rocks) { if (i != notputdown) { currentRock = eval ("rock" + i); if (notDropRock.hitTest(currentRock)) { if (notDropRock._y < ((currentRock._y - 25) + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = currentRock._y - 54; onLand = true; } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } } i++; } } if (mouse.hitTest(leftbarrier)) { mouse.dx = mouse.dx * -1; mouse.oX = mouse.oX + (mouse.dx * 6); } if (mouse.hitTest(rightbarrier)) { mouse.dx = mouse.dx * -1; mouse.oX = mouse.oX + (mouse.dx * 6); } if (mouse.hitTest(topbarrier)) { mouse.dy = mouse.dy * -1; mouse.oY = mouse.oY + (mouse.dy * 6); } if (mouse.hitTest(bottombarrier)) { mouse.dy = mouse.dy * -1; mouse.oY = mouse.oY + (mouse.dy * 6); } i = 0; while (i <= rocks) { currentRock = eval ("rock" + i); if (currentRock.hitTest(leftbarrier)) { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 6); } if (currentRock.hitTest(rightbarrier)) { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 6); } if (currentRock.hitTest(topbarrier)) { currentRock.dy = currentRock.dy * -1; currentRock.oY = currentRock.oY + (currentRock.dy * 6); } if (currentRock.hitTest(bottombarrier)) { currentRock.dy = currentRock.dy * -1; currentRock.oX = currentRock.oX + (currentRock.dy * 6); } i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); e = 1; while (e <= enemies) { currentEnemy = eval ("enemy" + e); if (currentRock.hitTest(currentEnemy)) { if (currentRock._y < currentEnemy._y) { if (currentRock.dy > 0) { if (playsounds) { } currentEnemy.health = currentEnemy.health - currentRock.dy; if (currentEnemy.tower == false) { currentEnemy._yscale = currentEnemy.health * 10; } else { currentEnemy._yscale = currentEnemy.health * 5; } currentEnemy.speed = 0; currentRock.dy = 0; currentRock.dx = 0; if (notputdown == i) { mouse._y = mouse._y - 5; mouse.dy = mouse.dy - 1; currentX = currentRock.oX + globalX; currentY = currentRock.oY + globalY; dx = mouse._x - currentX; dy = mouse._y - currentY; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); notputdown = -1; } if (currentEnemy.health <= 1) { if (i != notputdown) { if (playsounds) { explosionS.start(0, 1); } explosion.oX = currentEnemy.oX; explosion.oY = currentEnemy.oY; if (currentEnemy.tower == true) { explosion._yscale = 200; explosion._xscale = 100; } else { explosion._yscale = 65; explosion._xscale = 65; } explosion.gotoAndPlay(1); currentEnemy.oX = -1000; currentEnemy.oY = -1000; } else { if (playsounds) { explosionS.start(0, 1); } if (currentEnemy.tower == true) { explosion._yscale = 200; explosion._xscale = 100; } else { explosion._yscale = 65; explosion._xscale = 65; } explosion.gotoAndPlay(1); currentEnemy.oX = -1000; currentEnemy.oY = -1000; mouse._y = mouse._y - 5; mouse.dy = mouse.dy - 1; currentX = currentRock.oX + globalX; currentY = currentRock.oY + globalY; dx = mouse._x - currentX; dy = mouse._y - currentY; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); notputdown = -1; } currentEnemy.dead = true; } } } } e++; } i++; } i = 1; while (i <= rocks) { if (i != notputdown) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (mouse._y < ((currentRock._y - 25) + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = (currentRock.oY + globalY) - 26; onLand = true; } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } } i++; } i = 0; while (i <= buttons) { currentResponder = eval ("responder" + i); if (mouse.hitTest(currentResponder)) { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } i++; } pressed = false; if (Key.isDown(38)) { if (onLand) { mouse.dy = -2; mouse._y = mouse._y + mouse.dy; } else if (flightJuice > 0) { pressed = true; mouse.gotoAndStop("up"); mouse.dy = mouse.dy - thrust; flightJuice = flightJuice - 1; } } if (Key.isDown(40)) { if (onLand) { } else if (flightJuice > 0) { pressed = true; mouse.gotoAndStop("down"); mouse.dy = mouse.dy + thrust; flightJuice = flightJuice - 1; } if (mouse.hitTest(topbarrier)) { mouse._y = mouse._y + 7; } i = 0; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (currentLand._y < (mouse._y - 5)) { mouse._y = mouse._y + 7; } } i++; } } if (Key.isDown(37)) { pressed = true; if (onLand) { mouse.dx = mouse.dx - thrust; mouse.gotoAndStop("left"); } else if (flightJuice > 0) { pressed = true; mouse.dx = mouse.dx - thrust; mouse.gotoAndStop("left"); flightJuice = flightJuice - 1; } i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (i != onLandNum) { if (mouse._y > currentLand._y) { mouse._x = mouse._x - 7; } } } i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (mouse._y > (currentRock._y - 26)) { if (i != notputdown) { mouse._x = mouse._x - 7; } } } i++; } i = 0; while (i <= buttons) { currentResponder = eval ("responder" + i); if (mouse.hitTest(currentResponder)) { mouse._x = mouse._x - 7; } i++; } if (mouse.hitTest(rightbarrier)) { mouse._x = mouse._x - 7; } } else if (Key.isDown(39)) { pressed = true; if (onLand) { mouse.dx = mouse.dx + thrust; mouse.gotoAndStop("left"); } else if (flightJuice > 0) { pressed = true; mouse.dx = mouse.dx + thrust; mouse.gotoAndStop("left"); flightJuice = flightJuice - 1; } mouse.gotoAndStop("right"); i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (i != onLandNum) { if (mouse._y > currentLand._y) { mouse._x = mouse._x + 7; } } } i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (mouse._y > (currentRock._y - 26)) { if (i != notputdown) { mouse._x = mouse._x + 7; } } } i++; } i = 0; while (i <= buttons) { currentResponder = eval ("responder" + i); if (mouse.hitTest(currentResponder)) { mouse._x = mouse._x + 7; } i++; } if (mouse.hitTest(leftbarrier)) { mouse._x = mouse._x + 7; } } else if (mouse.dx < 0) { mouse.dx = mouse.dx + thrust; } else if (mouse.dx > 0) { mouse.dx = mouse.dx - thrust; } if (mouse.dx < 0.1) { if (mouse.dx > 0) { mouse.dx = 0; } } if (mouse.dx > -0.1) { if (mouse.dx < 0) { mouse.dx = 0; } } if (pressed == false) { mouse.gotoAndStop("center"); } if (pressed == true) { if (playsounds) { thrustsoundpauser++; if (thrustsoundpauser == totalforthruster) { thruster.start(0, 1); thrustsoundpauser = 0; } } } if (Key.isDown(32)) { if (donePressSpace) { donePressSpace = false; if (notputdown == -1) { i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (playsounds) { pickup.start(0, 1); } notputdown = i; dx = mouse._x - currentRock._x; dy = mouse._y - currentRock._y; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); } i++; } } else { mouse._y = mouse._y - 5; mouse.dy = mouse.dy - 1; if (playsounds) { pickup.start(0, 1); } currentRock = eval ("rock" + notputdown); currentX = currentRock.oX + globalX; currentY = currentRock.oY + globalY; dx = mouse._x - currentX; dy = mouse._y - currentY; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); notputdown = -1; } } } else { donePressSpace = true; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (i != notputdown) { currentRock.dy = currentRock.dy + gravity; currentRock.oX = currentRock.oX + currentRock.dx; currentRock.oY = currentRock.oY + currentRock.dy; } l = 1; while (l <= lands) { currentLand = eval ("land" + l); if (currentRock.hitTest(currentLand)) { if (currentRock._y < ((currentLand._y + currentRock.dy) + 0.5)) { currentRock.oY = currentLand.oY; currentRock.dy = 0; currentRock.dx = 0; } else if (currentRock._y > (currentLand._y + 25.5)) { currentRock.dy = currentRock.dy * -1; currentRock.oY = currentRock.oY + (currentRock.dy * 2); } else { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 4); } } l++; } b = 1; while (b <= rocks) { otherRock = eval ("rock" + b); if (b != i) { if (currentRock.hitTest(otherRock)) { if (currentRock.oY < otherRock.oY) { currentRock.oY = otherRock.oY - 29; currentRock.dy = 0; currentRock.dx = 0; } } } b++; } b = 0; while (b <= buttons) { currentResponder = eval ("responder" + b); if (currentRock.hitTest(currentResponder)) { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 6); } b++; } i++; } i = 1; while (i <= enemies) { currentEnemy = eval ("enemy" + i); if (currentEnemy.tower == false) { if (currentEnemy.gotoLeft == true) { if (currentEnemy.patrolPoint < currentEnemy.patrolLength) { currentEnemy.oX = currentEnemy.oX + currentEnemy.speed; currentEnemy.patrolPoint = currentEnemy.patrolPoint + currentEnemy.speed; } else { currentEnemy.gotoLeft = false; currentEnemy.gotoAndPlay("turn"); } } else if (currentEnemy.patrolPoint > 0) { currentEnemy.oX = currentEnemy.oX - currentEnemy.speed; currentEnemy.patrolPoint = currentEnemy.patrolPoint - currentEnemy.speed; } else { currentEnemy.gotoLeft = true; currentEnemy.gotoAndPlay("turn"); } } i++; } i = 0; while (i <= enemies) { currentEnemy = eval ("enemy" + i); if (mouse.hitTest(currentEnemy)) { if (currentEnemy.tower == false) { health = health - currentEnemy.damage; } } if (currentEnemy.tower == true) { currentBullet = eval ("bullet" + i); if (mouse.hitTest(currentBullet)) { health = health - currentEnemy.damage; } } i++; } i = 0; while (i <= buttons) { currentButton = eval ("button" + i); currentResponder = eval ("responder" + i); hit = false; r = 0; while (r <= rocks) { currentRock = eval ("rock" + r); if (currentButton.hitTest(currentRock)) { hit = true; if (currentButton.pressed == false) { currentButton.pressed = true; currentResponder.oX = currentResponder.oX + 10000; } } r++; } if (mousehitsbuttons == true) { if (mouse.hitTest(currentButton)) { hit = true; if (currentButton.pressed == false) { currentButton.pressed = true; currentResponder.oX = currentResponder.oX + 10000; } } } if (hit == false) { if (currentButton.pressed == true) { currentButton.pressed = false; currentResponder.oX = currentResponder.oX - 10000; currentResponder.alpha = 0; } } i++; } currentResponder.fadeOut = false; currentResponder.alpha = 100; currentResponder.speed = 6; if (mouse.hitTest(end)) { if (win == false) { level++; winS.start(0, 1); end.gotoAndPlay("win"); win = true; } } i = 0; while (i <= enemies) { currentTower = eval ("enemy" + i); if (currentTower.tower == true) { currentTop = eval ("towertop" + i); currentBullet = eval ("bullet" + i); currentTop._x = currentTower._x; currentTop._y = currentTower._y - (95 * (currentTower._yscale / 100)); currentTop._yscale = currentTower._yscale; dx = currentTop._x - mouse._x; dy = currentTop._y - mouse._y; radians = Math.atan(dy / dx); degrees = (radians * 180) / Math.PI; if (dx > 0) { degrees = degrees + 180; } radians = (degrees / 180) * Math.PI; degrees = degrees + 90; currentTop._rotation = degrees; distance = Math.sqrt((dx * dx) + (dy * dy)); currentTower.counter++; if (currentTower.counter >= currentTower.counterLimit) { currentTower.counter = 0; currentBullet.oX = currentTower.oX; currentBullet.oY = currentTower.oY - (95 * (currentTower._yscale / 100)); currentBullet.dx = Math.cos(radians) * currentTower.launchSpeed; currentBullet.dy = Math.sin(radians) * currentTower.launchSpeed; } currentBullet.oX = currentBullet.oX + currentBullet.dx; currentBullet.oY = currentBullet.oY + currentBullet.dy; } i++; } }; menu.onRelease = function () { gotoAndStop ("menu"); }; currentAlpha = 100; faderbox._alpha = currentAlpha; fadeOut = function () { if (loading == true) { faderbox.gotoAndStop("blue"); } if (loading == false) { faderbox.gotoAndStop("red"); } currentAlpha = currentAlpha + speed; if (currentAlpha >= 100) { currentAlpha = 100; if (loading == true) { gotoAndStop ("loading"); } if (loading == false) { gotoAndStop ("lose"); } } faderbox._x = 0; faderbox._y = 0; faderbox._alpha = currentAlpha; }; fadeIn = function () { faderbox.gotoAndStop("blue"); currentAlpha = currentAlpha - speed; if (currentAlpha <= 0) { currentAlpha = 0; faderbox._x = -10000; faderbox._y = -10000; } faderbox._alpha = currentAlpha; if (health < topHealth) { faderbox.gotoAndStop("red"); faderbox._x = 0; faderbox._y = 0; faderbox._alpha = (100 - (health * healthMultiplier)) - 20; if (faderbox._alpha < 0) { faderbox._alpha = 0; } currentAlpha = faderbox._alpha; } };
Frame 92
lands = 12; total = 0; rocks = 6; objects = 5; buttons = 3; enemies = 8; notputdown = -1; health = topHealth; healthMultiplier = 100 / health; flightJuice = topFlightJuice; flightMultiplier = 100 / flightJuice; mouse.maxWidth = 62.1; landWidth = 188; onLandNum = 0; globalX = 0; globalY = 0; win = false; mousehitsbuttons = false; topsmoke = 5; smoke = 0; thrustsoundpauser = 0; totalforthruster = 4; fadein = true; loading = true; stop(); mouse = eval (type); mouse._x = startX._x; mouse._y = startX._y; startX._x = -100; startX._y = -100; mouse.dy = 0; mouse.dx = 0; mouse.oX = mouse._x; mouse.oY = mouse._y; explosion.oX = -10000; explosion.oY = -10000; leftbarrier.oX = leftbarrier._x; leftbarrier.oY = leftbarrier._y; rightbarrier.oX = rightbarrier._x; rightbarrier.oY = rightbarrier._y; topbarrier.oX = topbarrier._x; topbarrier.oY = topbarrier._y; bottombarrier.oX = bottombarrier._x; bottombarrier.oY = bottombarrier._y; end.oX = end._x; end.oY = end._y; enemy1.tower = false; enemy2.tower = false; enemy3.tower = false; enemy4.tower = false; enemy5.tower = true; enemy6.tower = true; enemy7.tower = true; enemy8.tower = true; i = 0; while (i <= objects) { currentObject = eval ("object" + i); currentObject.oX = currentObject._x; currentObject.oY = currentObject._y; i++; } enemy1.gotoLeft = true; i = 1; while (i <= enemies) { currentEnemy = eval ("enemy" + i); currentEnemy.health = 8; currentEnemy.speed = 2; firstFlag = eval ("firstPatrolMarker" + i); secondFlag = eval ("secondPatrolMarker" + i); currentEnemy.patrolLength = secondFlag._x - firstFlag._x; currentEnemy.patrolPoint = currentEnemy._x - firstFlag._x; firstFlag._x = -100; secondFlag._x = -100; currentEnemy.damage = 1; currentEnemy.oX = currentEnemy._x; currentEnemy.oY = currentEnemy._y; currentEnemy.dead = false; currentEnemy.gotoLeft = true; i++; } i = 0; while (i <= enemies) { currentEnemy = eval ("enemy" + i); if (currentEnemy.tower == true) { currentEnemy.counter = 0; currentEnemy.counterLimit = 60; currentEnemy.launchSpeed = 2; currentEnemy.health = 20; } i++; } i = 0; while (i <= buttons) { currentButton = eval ("button" + i); currentButton.pressed = false; currentButton.oX = currentButton._x; currentButton.oY = currentButton._y; currentResponder = eval ("responder" + i); currentResponder.oX = currentResponder._x; currentResponder.oY = currentResponder._y; currentResponder.fadeOut = false; currentResponder.alpha = 100; currentResponder.speed = 6; i++; } i = 0; while (i <= rocks) { currentRock = eval ("rock" + i); currentRock.oX = currentRock._x; currentRock.oY = currentRock._y; currentRock.dx = 0; currentRock.dy = 0; currentRock.originX = currentRock._x; currentRock.originY = currentRock._y; i++; } i = 0; while (i <= lands) { currentLand = eval ("land" + i); currentLand.oX = currentLand._x; currentLand.oY = currentLand._y; i++; } mouse.onEnterFrame = function () { if (fadein == true) { fadeIn(); } else { fadeOut(); } mouse.dy = mouse.dy + gravity; mouse._y = mouse._y + mouse.dy; mouse._x = mouse._x + mouse.dx; healthbar._xscale = health * healthMultiplier; if (flightJuice > 0) { flightbar._xscale = flightJuice * flightMultiplier; } if (health <= 0) { fadein = false; loading = false; } if (health < topHealth) { health = health + (regenerateRate / 5); } if (flightJuice < topFlightJuice) { flightJuice = flightJuice + regenerateRate; } dx = (Stage.width / 2) - mouse._x; dy = (Stage.width / 2) - mouse._y; dx = dx / 4; dy = dy / 4; if (mouse.dx > topspeed) { mouse.dx = topspeed; } if (mouse.dx < (-topspeed)) { mouse.dx = -topspeed; } if (mouse.dy > topspeed) { mouse.dy = topspeed; } if (mouse.dy < (-topspeed)) { mouse.dy = -topspeed; } globalX = globalX + dx; globalY = globalY + dy; i = 1; while (i <= lands) { currentLand = eval ("land" + i); currentLand._x = currentLand.oX + globalX; currentLand._y = currentLand.oY + globalY; i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); currentRock._x = currentRock.oX + globalX; currentRock._y = currentRock.oY + globalY; i++; } i = 1; while (i <= enemies) { currentEnemy = eval ("enemy" + i); currentEnemy._x = currentEnemy.oX + globalX; currentEnemy._y = currentEnemy.oY + globalY; if (currentEnemy.tower) { currentBullet = eval ("bullet" + i); currentBullet._x = currentBullet.oX + globalX; currentBullet._y = currentBullet.oY + globalY; } i++; } explosion._x = explosion.oX + globalX; explosion._y = explosion.oY + globalY; i = 0; while (i <= buttons) { currentButton = eval ("button" + i); currentResponder = eval ("responder" + i); currentButton._x = currentButton.oX + globalX; currentButton._y = currentButton.oY + globalY; currentResponder._x = currentResponder.oX + globalX; currentResponder._y = currentResponder.oY + globalY; i++; } i = 0; while (i <= objects) { currentObject = eval ("object" + i); currentObject._x = currentObject.oX + globalX; currentObject._y = currentObject.oY + globalY; i++; } leftbarrier._x = leftbarrier.oX + globalX; leftbarrier._y = leftbarrier.oY + globalY; rightbarrier._x = rightbarrier.oX + globalX; rightbarrier._y = rightbarrier.oY + globalY; topbarrier._x = topbarrier.oX + globalX; topbarrier._y = topbarrier.oY + globalY; bottombarrier._x = bottombarrier.oX + globalX; bottombarrier._y = bottombarrier.oY + globalY; end._x = end.oX + globalX; end._y = end.oY + globalY; mouse.oX = mouse.oX + dx; mouse.oY = mouse.oY + dy; mouse._y = mouse._y + dy; mouse._x = mouse._x + dx; bg._x = bg._x + (dx / 3); bg._y = bg._y + (dy / 3); if (notputdown != -1) { currentRock = eval ("rock" + notputdown); currentRock._x = mouse._x; currentRock._y = mouse._y + 25; currentRock.dx = mouse.dx; currentRock.dy = mouse.dy; } onLand = false; i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (mouse._y < (currentLand._y + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = currentLand._y; onLand = true; onLandNum = i; } else if (mouse._y > (((currentLand._y + 35.5) + 25.4) + (mouse.dy * 1.2))) { mouse.dy = mouse.dy * -1; mouse._y = mouse._y + (mouse.dy * 1.5); } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } i++; } if (notputdown != -1) { currentRock = eval ("rock" + notputdown); i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (currentRock.hitTest(currentLand)) { if (currentRock._y < (currentLand._y + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = currentLand._y - 25; onLand = true; onLandNum = i; } else if (currentRock._y > (((currentLand._y + 35) + 27) + (mouse.dy * 1.2))) { mouse.dy = mouse.dy * -1; mouse._y = mouse._y + (mouse.dy * 1.5); } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } i++; } notDropRock = eval ("rock" + notputdown); i = 1; while (i <= rocks) { if (i != notputdown) { currentRock = eval ("rock" + i); if (notDropRock.hitTest(currentRock)) { if (notDropRock._y < ((currentRock._y - 25) + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = currentRock._y - 54; onLand = true; } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } } i++; } } if (mouse.hitTest(leftbarrier)) { mouse.dx = mouse.dx * -1; mouse.oX = mouse.oX + (mouse.dx * 6); } if (mouse.hitTest(rightbarrier)) { mouse.dx = mouse.dx * -1; mouse.oX = mouse.oX + (mouse.dx * 6); } if (mouse.hitTest(topbarrier)) { mouse.dy = mouse.dy * -1; mouse.oY = mouse.oY + (mouse.dy * 6); } if (mouse.hitTest(bottombarrier)) { mouse.dy = mouse.dy * -1; mouse.oY = mouse.oY + (mouse.dy * 6); } i = 0; while (i <= rocks) { currentRock = eval ("rock" + i); if (currentRock.hitTest(leftbarrier)) { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 6); } if (currentRock.hitTest(rightbarrier)) { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 6); } if (currentRock.hitTest(topbarrier)) { currentRock.dy = currentRock.dy * -1; currentRock.oY = currentRock.oY + (currentRock.dy * 6); } if (currentRock.hitTest(bottombarrier)) { currentRock.dy = currentRock.dy * -1; currentRock.oX = currentRock.oX + (currentRock.dy * 6); } i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); e = 1; while (e <= enemies) { currentEnemy = eval ("enemy" + e); if (currentRock.hitTest(currentEnemy)) { if (currentRock._y < currentEnemy._y) { if (currentRock.dy > 0) { if (playsounds) { } currentEnemy.health = currentEnemy.health - currentRock.dy; if (currentEnemy.tower == false) { currentEnemy._yscale = currentEnemy.health * 10; } else { currentEnemy._yscale = currentEnemy.health * 5; } currentEnemy.speed = 0; currentRock.dy = 0; currentRock.dx = 0; if (notputdown == i) { mouse._y = mouse._y - 5; mouse.dy = mouse.dy - 1; currentX = currentRock.oX + globalX; currentY = currentRock.oY + globalY; dx = mouse._x - currentX; dy = mouse._y - currentY; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); notputdown = -1; } if (currentEnemy.health <= 1) { if (i != notputdown) { if (playsounds) { explosionS.start(0, 1); } explosion.oX = currentEnemy.oX; explosion.oY = currentEnemy.oY; if (currentEnemy.tower == true) { explosion._yscale = 200; explosion._xscale = 100; } else { explosion._yscale = 65; explosion._xscale = 65; } explosion.gotoAndPlay(1); currentEnemy.oX = -1000; currentEnemy.oY = -1000; } else { if (playsounds) { explosionS.start(0, 1); } if (currentEnemy.tower == true) { explosion._yscale = 200; explosion._xscale = 100; } else { explosion._yscale = 65; explosion._xscale = 65; } explosion.gotoAndPlay(1); currentEnemy.oX = -1000; currentEnemy.oY = -1000; mouse._y = mouse._y - 5; mouse.dy = mouse.dy - 1; currentX = currentRock.oX + globalX; currentY = currentRock.oY + globalY; dx = mouse._x - currentX; dy = mouse._y - currentY; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); notputdown = -1; } currentEnemy.dead = true; } } } } e++; } i++; } i = 1; while (i <= rocks) { if (i != notputdown) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (mouse._y < ((currentRock._y - 25) + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = (currentRock.oY + globalY) - 26; onLand = true; } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } } i++; } i = 0; while (i <= buttons) { currentResponder = eval ("responder" + i); if (mouse.hitTest(currentResponder)) { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } i++; } pressed = false; if (Key.isDown(38)) { if (onLand) { mouse.dy = -2; mouse._y = mouse._y + mouse.dy; } else if (flightJuice > 0) { pressed = true; mouse.gotoAndStop("up"); mouse.dy = mouse.dy - thrust; flightJuice = flightJuice - 1; } } if (Key.isDown(40)) { if (onLand) { } else if (flightJuice > 0) { pressed = true; mouse.gotoAndStop("down"); mouse.dy = mouse.dy + thrust; flightJuice = flightJuice - 1; } if (mouse.hitTest(topbarrier)) { mouse._y = mouse._y + 7; } i = 0; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (currentLand._y < (mouse._y - 5)) { mouse._y = mouse._y + 7; } } i++; } } if (Key.isDown(37)) { pressed = true; if (onLand) { mouse.dx = mouse.dx - thrust; mouse.gotoAndStop("left"); } else if (flightJuice > 0) { pressed = true; mouse.dx = mouse.dx - thrust; mouse.gotoAndStop("left"); flightJuice = flightJuice - 1; } i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (i != onLandNum) { if (mouse._y > currentLand._y) { mouse._x = mouse._x - 7; } } } i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (mouse._y > (currentRock._y - 26)) { if (i != notputdown) { mouse._x = mouse._x - 7; } } } i++; } i = 0; while (i <= buttons) { currentResponder = eval ("responder" + i); if (mouse.hitTest(currentResponder)) { mouse._x = mouse._x - 7; } i++; } if (mouse.hitTest(rightbarrier)) { mouse._x = mouse._x - 7; } } else if (Key.isDown(39)) { pressed = true; if (onLand) { mouse.dx = mouse.dx + thrust; mouse.gotoAndStop("left"); } else if (flightJuice > 0) { pressed = true; mouse.dx = mouse.dx + thrust; mouse.gotoAndStop("left"); flightJuice = flightJuice - 1; } mouse.gotoAndStop("right"); i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (i != onLandNum) { if (mouse._y > currentLand._y) { mouse._x = mouse._x + 7; } } } i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (mouse._y > (currentRock._y - 26)) { if (i != notputdown) { mouse._x = mouse._x + 7; } } } i++; } i = 0; while (i <= buttons) { currentResponder = eval ("responder" + i); if (mouse.hitTest(currentResponder)) { mouse._x = mouse._x + 7; } i++; } if (mouse.hitTest(leftbarrier)) { mouse._x = mouse._x + 7; } } else if (mouse.dx < 0) { mouse.dx = mouse.dx + thrust; } else if (mouse.dx > 0) { mouse.dx = mouse.dx - thrust; } if (mouse.dx < 0.1) { if (mouse.dx > 0) { mouse.dx = 0; } } if (mouse.dx > -0.1) { if (mouse.dx < 0) { mouse.dx = 0; } } if (pressed == false) { mouse.gotoAndStop("center"); } if (pressed == true) { if (playsounds) { thrustsoundpauser++; if (thrustsoundpauser == totalforthruster) { thruster.start(0, 1); thrustsoundpauser = 0; } } } if (Key.isDown(32)) { if (donePressSpace) { donePressSpace = false; if (notputdown == -1) { i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (playsounds) { pickup.start(0, 1); } notputdown = i; dx = mouse._x - currentRock._x; dy = mouse._y - currentRock._y; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); } i++; } } else { mouse._y = mouse._y - 5; mouse.dy = mouse.dy - 1; if (playsounds) { pickup.start(0, 1); } currentRock = eval ("rock" + notputdown); currentX = currentRock.oX + globalX; currentY = currentRock.oY + globalY; dx = mouse._x - currentX; dy = mouse._y - currentY; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); notputdown = -1; } } } else { donePressSpace = true; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (i != notputdown) { currentRock.dy = currentRock.dy + gravity; currentRock.oX = currentRock.oX + currentRock.dx; currentRock.oY = currentRock.oY + currentRock.dy; } l = 1; while (l <= lands) { currentLand = eval ("land" + l); if (currentRock.hitTest(currentLand)) { if (currentRock._y < ((currentLand._y + currentRock.dy) + 0.5)) { currentRock.oY = currentLand.oY; currentRock.dy = 0; currentRock.dx = 0; } else if (currentRock._y > (currentLand._y + 25.5)) { currentRock.dy = currentRock.dy * -1; currentRock.oY = currentRock.oY + (currentRock.dy * 2); } else { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 4); } } l++; } b = 1; while (b <= rocks) { otherRock = eval ("rock" + b); if (b != i) { if (currentRock.hitTest(otherRock)) { if (currentRock.oY < otherRock.oY) { currentRock.oY = otherRock.oY - 29; currentRock.dy = 0; currentRock.dx = 0; } } } b++; } b = 0; while (b <= buttons) { currentResponder = eval ("responder" + b); if (currentRock.hitTest(currentResponder)) { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 6); } b++; } i++; } i = 1; while (i <= enemies) { currentEnemy = eval ("enemy" + i); if (currentEnemy.tower == false) { if (currentEnemy.gotoLeft == true) { if (currentEnemy.patrolPoint < currentEnemy.patrolLength) { currentEnemy.oX = currentEnemy.oX + currentEnemy.speed; currentEnemy.patrolPoint = currentEnemy.patrolPoint + currentEnemy.speed; } else { currentEnemy.gotoLeft = false; currentEnemy.gotoAndPlay("turn"); } } else if (currentEnemy.patrolPoint > 0) { currentEnemy.oX = currentEnemy.oX - currentEnemy.speed; currentEnemy.patrolPoint = currentEnemy.patrolPoint - currentEnemy.speed; } else { currentEnemy.gotoLeft = true; currentEnemy.gotoAndPlay("turn"); } } i++; } i = 0; while (i <= enemies) { currentEnemy = eval ("enemy" + i); if (mouse.hitTest(currentEnemy)) { if (currentEnemy.tower == false) { health = health - currentEnemy.damage; } } if (currentEnemy.tower == true) { currentBullet = eval ("bullet" + i); if (mouse.hitTest(currentBullet)) { health = health - currentEnemy.damage; } } i++; } i = 0; while (i <= buttons) { currentButton = eval ("button" + i); currentResponder = eval ("responder" + i); hit = false; r = 0; while (r <= rocks) { currentRock = eval ("rock" + r); if (currentButton.hitTest(currentRock)) { hit = true; if (currentButton.pressed == false) { currentButton.pressed = true; currentResponder.oX = currentResponder.oX + 10000; } } r++; } if (mousehitsbuttons == true) { if (mouse.hitTest(currentButton)) { hit = true; if (currentButton.pressed == false) { currentButton.pressed = true; currentResponder.oX = currentResponder.oX + 10000; } } } if (hit == false) { if (currentButton.pressed == true) { currentButton.pressed = false; currentResponder.oX = currentResponder.oX - 10000; currentResponder.alpha = 0; } } i++; } currentResponder.fadeOut = false; currentResponder.alpha = 100; currentResponder.speed = 6; if (mouse.hitTest(end)) { if (win == false) { level++; winS.start(0, 1); end.gotoAndPlay("win"); win = true; } } i = 0; while (i <= enemies) { currentTower = eval ("enemy" + i); if (currentTower.tower == true) { currentTop = eval ("towertop" + i); currentBullet = eval ("bullet" + i); currentTop._x = currentTower._x; currentTop._y = currentTower._y - (95 * (currentTower._yscale / 100)); currentTop._yscale = currentTower._yscale; dx = currentTop._x - mouse._x; dy = currentTop._y - mouse._y; radians = Math.atan(dy / dx); degrees = (radians * 180) / Math.PI; if (dx > 0) { degrees = degrees + 180; } radians = (degrees / 180) * Math.PI; degrees = degrees + 90; currentTop._rotation = degrees; distance = Math.sqrt((dx * dx) + (dy * dy)); currentTower.counter++; if (currentTower.counter >= currentTower.counterLimit) { currentTower.counter = 0; currentBullet.oX = currentTower.oX; currentBullet.oY = currentTower.oY - (95 * (currentTower._yscale / 100)); currentBullet.dx = Math.cos(radians) * currentTower.launchSpeed; currentBullet.dy = Math.sin(radians) * currentTower.launchSpeed; } currentBullet.oX = currentBullet.oX + currentBullet.dx; currentBullet.oY = currentBullet.oY + currentBullet.dy; } i++; } }; menu.onRelease = function () { gotoAndStop ("menu"); }; currentAlpha = 100; faderbox._alpha = currentAlpha; fadeOut = function () { if (loading == true) { faderbox.gotoAndStop("blue"); } if (loading == false) { faderbox.gotoAndStop("red"); } currentAlpha = currentAlpha + speed; if (currentAlpha >= 100) { currentAlpha = 100; if (loading == true) { gotoAndStop ("loading"); } if (loading == false) { gotoAndStop ("lose"); } } faderbox._x = 0; faderbox._y = 0; faderbox._alpha = currentAlpha; }; fadeIn = function () { faderbox.gotoAndStop("blue"); currentAlpha = currentAlpha - speed; if (currentAlpha <= 0) { currentAlpha = 0; faderbox._x = -10000; faderbox._y = -10000; } faderbox._alpha = currentAlpha; if (health < topHealth) { faderbox.gotoAndStop("red"); faderbox._x = 0; faderbox._y = 0; faderbox._alpha = (100 - (health * healthMultiplier)) - 20; if (faderbox._alpha < 0) { faderbox._alpha = 0; } currentAlpha = faderbox._alpha; } };
Frame 93
lands = 12; total = 0; rocks = 6; objects = 5; buttons = 3; enemies = 8; notputdown = -1; health = topHealth; healthMultiplier = 100 / health; flightJuice = topFlightJuice; flightMultiplier = 100 / flightJuice; mouse.maxWidth = 62.1; landWidth = 188; onLandNum = 0; globalX = 0; globalY = 0; win = false; mousehitsbuttons = false; topsmoke = 5; smoke = 0; thrustsoundpauser = 0; totalforthruster = 4; fadein = true; loading = true; stop(); mouse = eval (type); mouse._x = startX._x; mouse._y = startX._y; startX._x = -100; startX._y = -100; mouse.dy = 0; mouse.dx = 0; mouse.oX = mouse._x; mouse.oY = mouse._y; explosion.oX = -10000; explosion.oY = -10000; leftbarrier.oX = leftbarrier._x; leftbarrier.oY = leftbarrier._y; rightbarrier.oX = rightbarrier._x; rightbarrier.oY = rightbarrier._y; topbarrier.oX = topbarrier._x; topbarrier.oY = topbarrier._y; bottombarrier.oX = bottombarrier._x; bottombarrier.oY = bottombarrier._y; end.oX = end._x; end.oY = end._y; enemy1.tower = false; enemy2.tower = false; enemy3.tower = false; enemy4.tower = false; enemy5.tower = true; enemy6.tower = true; enemy7.tower = true; enemy8.tower = true; i = 0; while (i <= objects) { currentObject = eval ("object" + i); currentObject.oX = currentObject._x; currentObject.oY = currentObject._y; i++; } enemy1.gotoLeft = true; i = 1; while (i <= enemies) { currentEnemy = eval ("enemy" + i); currentEnemy.health = 8; currentEnemy.speed = 2; firstFlag = eval ("firstPatrolMarker" + i); secondFlag = eval ("secondPatrolMarker" + i); currentEnemy.patrolLength = secondFlag._x - firstFlag._x; currentEnemy.patrolPoint = currentEnemy._x - firstFlag._x; firstFlag._x = -100; secondFlag._x = -100; currentEnemy.damage = 1; currentEnemy.oX = currentEnemy._x; currentEnemy.oY = currentEnemy._y; currentEnemy.dead = false; currentEnemy.gotoLeft = true; i++; } i = 0; while (i <= enemies) { currentEnemy = eval ("enemy" + i); if (currentEnemy.tower == true) { currentEnemy.counter = 0; currentEnemy.counterLimit = 60; currentEnemy.launchSpeed = 2; currentEnemy.health = 20; } i++; } i = 0; while (i <= buttons) { currentButton = eval ("button" + i); currentButton.pressed = false; currentButton.oX = currentButton._x; currentButton.oY = currentButton._y; currentResponder = eval ("responder" + i); currentResponder.oX = currentResponder._x; currentResponder.oY = currentResponder._y; currentResponder.fadeOut = false; currentResponder.alpha = 100; currentResponder.speed = 6; i++; } i = 0; while (i <= rocks) { currentRock = eval ("rock" + i); currentRock.oX = currentRock._x; currentRock.oY = currentRock._y; currentRock.dx = 0; currentRock.dy = 0; currentRock.originX = currentRock._x; currentRock.originY = currentRock._y; i++; } i = 0; while (i <= lands) { currentLand = eval ("land" + i); currentLand.oX = currentLand._x; currentLand.oY = currentLand._y; i++; } mouse.onEnterFrame = function () { if (fadein == true) { fadeIn(); } else { fadeOut(); } mouse.dy = mouse.dy + gravity; mouse._y = mouse._y + mouse.dy; mouse._x = mouse._x + mouse.dx; healthbar._xscale = health * healthMultiplier; if (flightJuice > 0) { flightbar._xscale = flightJuice * flightMultiplier; } if (health <= 0) { fadein = false; loading = false; } if (health < topHealth) { health = health + (regenerateRate / 5); } if (flightJuice < topFlightJuice) { flightJuice = flightJuice + regenerateRate; } dx = (Stage.width / 2) - mouse._x; dy = (Stage.width / 2) - mouse._y; dx = dx / 4; dy = dy / 4; if (mouse.dx > topspeed) { mouse.dx = topspeed; } if (mouse.dx < (-topspeed)) { mouse.dx = -topspeed; } if (mouse.dy > topspeed) { mouse.dy = topspeed; } if (mouse.dy < (-topspeed)) { mouse.dy = -topspeed; } globalX = globalX + dx; globalY = globalY + dy; i = 1; while (i <= lands) { currentLand = eval ("land" + i); currentLand._x = currentLand.oX + globalX; currentLand._y = currentLand.oY + globalY; i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); currentRock._x = currentRock.oX + globalX; currentRock._y = currentRock.oY + globalY; i++; } i = 1; while (i <= enemies) { currentEnemy = eval ("enemy" + i); currentEnemy._x = currentEnemy.oX + globalX; currentEnemy._y = currentEnemy.oY + globalY; if (currentEnemy.tower) { currentBullet = eval ("bullet" + i); currentBullet._x = currentBullet.oX + globalX; currentBullet._y = currentBullet.oY + globalY; } i++; } explosion._x = explosion.oX + globalX; explosion._y = explosion.oY + globalY; i = 0; while (i <= buttons) { currentButton = eval ("button" + i); currentResponder = eval ("responder" + i); currentButton._x = currentButton.oX + globalX; currentButton._y = currentButton.oY + globalY; currentResponder._x = currentResponder.oX + globalX; currentResponder._y = currentResponder.oY + globalY; i++; } i = 0; while (i <= objects) { currentObject = eval ("object" + i); currentObject._x = currentObject.oX + globalX; currentObject._y = currentObject.oY + globalY; i++; } leftbarrier._x = leftbarrier.oX + globalX; leftbarrier._y = leftbarrier.oY + globalY; rightbarrier._x = rightbarrier.oX + globalX; rightbarrier._y = rightbarrier.oY + globalY; topbarrier._x = topbarrier.oX + globalX; topbarrier._y = topbarrier.oY + globalY; bottombarrier._x = bottombarrier.oX + globalX; bottombarrier._y = bottombarrier.oY + globalY; end._x = end.oX + globalX; end._y = end.oY + globalY; mouse.oX = mouse.oX + dx; mouse.oY = mouse.oY + dy; mouse._y = mouse._y + dy; mouse._x = mouse._x + dx; bg._x = bg._x + (dx / 3); bg._y = bg._y + (dy / 3); if (notputdown != -1) { currentRock = eval ("rock" + notputdown); currentRock._x = mouse._x; currentRock._y = mouse._y + 25; currentRock.dx = mouse.dx; currentRock.dy = mouse.dy; } onLand = false; i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (mouse._y < (currentLand._y + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = currentLand._y; onLand = true; onLandNum = i; } else if (mouse._y > (((currentLand._y + 35.5) + 25.4) + (mouse.dy * 1.2))) { mouse.dy = mouse.dy * -1; mouse._y = mouse._y + (mouse.dy * 1.5); } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } i++; } if (notputdown != -1) { currentRock = eval ("rock" + notputdown); i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (currentRock.hitTest(currentLand)) { if (currentRock._y < (currentLand._y + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = currentLand._y - 25; onLand = true; onLandNum = i; } else if (currentRock._y > (((currentLand._y + 35) + 27) + (mouse.dy * 1.2))) { mouse.dy = mouse.dy * -1; mouse._y = mouse._y + (mouse.dy * 1.5); } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } i++; } notDropRock = eval ("rock" + notputdown); i = 1; while (i <= rocks) { if (i != notputdown) { currentRock = eval ("rock" + i); if (notDropRock.hitTest(currentRock)) { if (notDropRock._y < ((currentRock._y - 25) + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = currentRock._y - 54; onLand = true; } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } } i++; } } if (mouse.hitTest(leftbarrier)) { mouse.dx = mouse.dx * -1; mouse.oX = mouse.oX + (mouse.dx * 6); } if (mouse.hitTest(rightbarrier)) { mouse.dx = mouse.dx * -1; mouse.oX = mouse.oX + (mouse.dx * 6); } if (mouse.hitTest(topbarrier)) { mouse.dy = mouse.dy * -1; mouse.oY = mouse.oY + (mouse.dy * 6); } if (mouse.hitTest(bottombarrier)) { mouse.dy = mouse.dy * -1; mouse.oY = mouse.oY + (mouse.dy * 6); } i = 0; while (i <= rocks) { currentRock = eval ("rock" + i); if (currentRock.hitTest(leftbarrier)) { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 6); } if (currentRock.hitTest(rightbarrier)) { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 6); } if (currentRock.hitTest(topbarrier)) { currentRock.dy = currentRock.dy * -1; currentRock.oY = currentRock.oY + (currentRock.dy * 6); } if (currentRock.hitTest(bottombarrier)) { currentRock.dy = currentRock.dy * -1; currentRock.oX = currentRock.oX + (currentRock.dy * 6); } i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); e = 1; while (e <= enemies) { currentEnemy = eval ("enemy" + e); if (currentRock.hitTest(currentEnemy)) { if (currentRock._y < currentEnemy._y) { if (currentRock.dy > 0) { if (playsounds) { } currentEnemy.health = currentEnemy.health - currentRock.dy; if (currentEnemy.tower == false) { currentEnemy._yscale = currentEnemy.health * 10; } else { currentEnemy._yscale = currentEnemy.health * 5; } currentEnemy.speed = 0; currentRock.dy = 0; currentRock.dx = 0; if (notputdown == i) { mouse._y = mouse._y - 5; mouse.dy = mouse.dy - 1; currentX = currentRock.oX + globalX; currentY = currentRock.oY + globalY; dx = mouse._x - currentX; dy = mouse._y - currentY; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); notputdown = -1; } if (currentEnemy.health <= 1) { if (i != notputdown) { if (playsounds) { explosionS.start(0, 1); } explosion.oX = currentEnemy.oX; explosion.oY = currentEnemy.oY; if (currentEnemy.tower == true) { explosion._yscale = 200; explosion._xscale = 100; } else { explosion._yscale = 65; explosion._xscale = 65; } explosion.gotoAndPlay(1); currentEnemy.oX = -1000; currentEnemy.oY = -1000; } else { if (playsounds) { explosionS.start(0, 1); } if (currentEnemy.tower == true) { explosion._yscale = 200; explosion._xscale = 100; } else { explosion._yscale = 65; explosion._xscale = 65; } explosion.gotoAndPlay(1); currentEnemy.oX = -1000; currentEnemy.oY = -1000; mouse._y = mouse._y - 5; mouse.dy = mouse.dy - 1; currentX = currentRock.oX + globalX; currentY = currentRock.oY + globalY; dx = mouse._x - currentX; dy = mouse._y - currentY; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); notputdown = -1; } currentEnemy.dead = true; } } } } e++; } i++; } i = 1; while (i <= rocks) { if (i != notputdown) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (mouse._y < ((currentRock._y - 25) + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = (currentRock.oY + globalY) - 26; onLand = true; } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } } i++; } i = 0; while (i <= buttons) { currentResponder = eval ("responder" + i); if (mouse.hitTest(currentResponder)) { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } i++; } pressed = false; if (Key.isDown(38)) { if (onLand) { mouse.dy = -2; mouse._y = mouse._y + mouse.dy; } else if (flightJuice > 0) { pressed = true; mouse.gotoAndStop("up"); mouse.dy = mouse.dy - thrust; flightJuice = flightJuice - 1; } } if (Key.isDown(40)) { if (onLand) { } else if (flightJuice > 0) { pressed = true; mouse.gotoAndStop("down"); mouse.dy = mouse.dy + thrust; flightJuice = flightJuice - 1; } if (mouse.hitTest(topbarrier)) { mouse._y = mouse._y + 7; } i = 0; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (currentLand._y < (mouse._y - 5)) { mouse._y = mouse._y + 7; } } i++; } } if (Key.isDown(37)) { pressed = true; if (onLand) { mouse.dx = mouse.dx - thrust; mouse.gotoAndStop("left"); } else if (flightJuice > 0) { pressed = true; mouse.dx = mouse.dx - thrust; mouse.gotoAndStop("left"); flightJuice = flightJuice - 1; } i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (i != onLandNum) { if (mouse._y > currentLand._y) { mouse._x = mouse._x - 7; } } } i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (mouse._y > (currentRock._y - 26)) { if (i != notputdown) { mouse._x = mouse._x - 7; } } } i++; } i = 0; while (i <= buttons) { currentResponder = eval ("responder" + i); if (mouse.hitTest(currentResponder)) { mouse._x = mouse._x - 7; } i++; } if (mouse.hitTest(rightbarrier)) { mouse._x = mouse._x - 7; } } else if (Key.isDown(39)) { pressed = true; if (onLand) { mouse.dx = mouse.dx + thrust; mouse.gotoAndStop("left"); } else if (flightJuice > 0) { pressed = true; mouse.dx = mouse.dx + thrust; mouse.gotoAndStop("left"); flightJuice = flightJuice - 1; } mouse.gotoAndStop("right"); i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (i != onLandNum) { if (mouse._y > currentLand._y) { mouse._x = mouse._x + 7; } } } i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (mouse._y > (currentRock._y - 26)) { if (i != notputdown) { mouse._x = mouse._x + 7; } } } i++; } i = 0; while (i <= buttons) { currentResponder = eval ("responder" + i); if (mouse.hitTest(currentResponder)) { mouse._x = mouse._x + 7; } i++; } if (mouse.hitTest(leftbarrier)) { mouse._x = mouse._x + 7; } } else if (mouse.dx < 0) { mouse.dx = mouse.dx + thrust; } else if (mouse.dx > 0) { mouse.dx = mouse.dx - thrust; } if (mouse.dx < 0.1) { if (mouse.dx > 0) { mouse.dx = 0; } } if (mouse.dx > -0.1) { if (mouse.dx < 0) { mouse.dx = 0; } } if (pressed == false) { mouse.gotoAndStop("center"); } if (pressed == true) { if (playsounds) { thrustsoundpauser++; if (thrustsoundpauser == totalforthruster) { thruster.start(0, 1); thrustsoundpauser = 0; } } } if (Key.isDown(32)) { if (donePressSpace) { donePressSpace = false; if (notputdown == -1) { i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (playsounds) { pickup.start(0, 1); } notputdown = i; dx = mouse._x - currentRock._x; dy = mouse._y - currentRock._y; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); } i++; } } else { mouse._y = mouse._y - 5; mouse.dy = mouse.dy - 1; if (playsounds) { pickup.start(0, 1); } currentRock = eval ("rock" + notputdown); currentX = currentRock.oX + globalX; currentY = currentRock.oY + globalY; dx = mouse._x - currentX; dy = mouse._y - currentY; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); notputdown = -1; } } } else { donePressSpace = true; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (i != notputdown) { currentRock.dy = currentRock.dy + gravity; currentRock.oX = currentRock.oX + currentRock.dx; currentRock.oY = currentRock.oY + currentRock.dy; } l = 1; while (l <= lands) { currentLand = eval ("land" + l); if (currentRock.hitTest(currentLand)) { if (currentRock._y < ((currentLand._y + currentRock.dy) + 0.5)) { currentRock.oY = currentLand.oY; currentRock.dy = 0; currentRock.dx = 0; } else if (currentRock._y > (currentLand._y + 25.5)) { currentRock.dy = currentRock.dy * -1; currentRock.oY = currentRock.oY + (currentRock.dy * 2); } else { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 4); } } l++; } b = 1; while (b <= rocks) { otherRock = eval ("rock" + b); if (b != i) { if (currentRock.hitTest(otherRock)) { if (currentRock.oY < otherRock.oY) { currentRock.oY = otherRock.oY - 29; currentRock.dy = 0; currentRock.dx = 0; } } } b++; } b = 0; while (b <= buttons) { currentResponder = eval ("responder" + b); if (currentRock.hitTest(currentResponder)) { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 6); } b++; } i++; } i = 1; while (i <= enemies) { currentEnemy = eval ("enemy" + i); if (currentEnemy.tower == false) { if (currentEnemy.gotoLeft == true) { if (currentEnemy.patrolPoint < currentEnemy.patrolLength) { currentEnemy.oX = currentEnemy.oX + currentEnemy.speed; currentEnemy.patrolPoint = currentEnemy.patrolPoint + currentEnemy.speed; } else { currentEnemy.gotoLeft = false; currentEnemy.gotoAndPlay("turn"); } } else if (currentEnemy.patrolPoint > 0) { currentEnemy.oX = currentEnemy.oX - currentEnemy.speed; currentEnemy.patrolPoint = currentEnemy.patrolPoint - currentEnemy.speed; } else { currentEnemy.gotoLeft = true; currentEnemy.gotoAndPlay("turn"); } } i++; } i = 0; while (i <= enemies) { currentEnemy = eval ("enemy" + i); if (mouse.hitTest(currentEnemy)) { if (currentEnemy.tower == false) { health = health - currentEnemy.damage; } } if (currentEnemy.tower == true) { currentBullet = eval ("bullet" + i); if (mouse.hitTest(currentBullet)) { health = health - currentEnemy.damage; } } i++; } i = 0; while (i <= buttons) { currentButton = eval ("button" + i); currentResponder = eval ("responder" + i); hit = false; r = 0; while (r <= rocks) { currentRock = eval ("rock" + r); if (currentButton.hitTest(currentRock)) { hit = true; if (currentButton.pressed == false) { currentButton.pressed = true; currentResponder.oX = currentResponder.oX + 10000; } } r++; } if (mousehitsbuttons == true) { if (mouse.hitTest(currentButton)) { hit = true; if (currentButton.pressed == false) { currentButton.pressed = true; currentResponder.oX = currentResponder.oX + 10000; } } } if (hit == false) { if (currentButton.pressed == true) { currentButton.pressed = false; currentResponder.oX = currentResponder.oX - 10000; currentResponder.alpha = 0; } } i++; } currentResponder.fadeOut = false; currentResponder.alpha = 100; currentResponder.speed = 6; if (mouse.hitTest(end)) { if (win == false) { level++; winS.start(0, 1); end.gotoAndPlay("win"); win = true; } } i = 0; while (i <= enemies) { currentTower = eval ("enemy" + i); if (currentTower.tower == true) { currentTop = eval ("towertop" + i); currentBullet = eval ("bullet" + i); currentTop._x = currentTower._x; currentTop._y = currentTower._y - (95 * (currentTower._yscale / 100)); currentTop._yscale = currentTower._yscale; dx = currentTop._x - mouse._x; dy = currentTop._y - mouse._y; radians = Math.atan(dy / dx); degrees = (radians * 180) / Math.PI; if (dx > 0) { degrees = degrees + 180; } radians = (degrees / 180) * Math.PI; degrees = degrees + 90; currentTop._rotation = degrees; distance = Math.sqrt((dx * dx) + (dy * dy)); currentTower.counter++; if (currentTower.counter >= currentTower.counterLimit) { currentTower.counter = 0; currentBullet.oX = currentTower.oX; currentBullet.oY = currentTower.oY - (95 * (currentTower._yscale / 100)); currentBullet.dx = Math.cos(radians) * currentTower.launchSpeed; currentBullet.dy = Math.sin(radians) * currentTower.launchSpeed; } currentBullet.oX = currentBullet.oX + currentBullet.dx; currentBullet.oY = currentBullet.oY + currentBullet.dy; } i++; } }; menu.onRelease = function () { gotoAndStop ("menu"); }; currentAlpha = 100; faderbox._alpha = currentAlpha; fadeOut = function () { if (loading == true) { faderbox.gotoAndStop("blue"); } if (loading == false) { faderbox.gotoAndStop("red"); } currentAlpha = currentAlpha + speed; if (currentAlpha >= 100) { currentAlpha = 100; if (loading == true) { gotoAndStop ("loading"); } if (loading == false) { gotoAndStop ("lose"); } } faderbox._x = 0; faderbox._y = 0; faderbox._alpha = currentAlpha; }; fadeIn = function () { faderbox.gotoAndStop("blue"); currentAlpha = currentAlpha - speed; if (currentAlpha <= 0) { currentAlpha = 0; faderbox._x = -10000; faderbox._y = -10000; } faderbox._alpha = currentAlpha; if (health < topHealth) { faderbox.gotoAndStop("red"); faderbox._x = 0; faderbox._y = 0; faderbox._alpha = (100 - (health * healthMultiplier)) - 20; if (faderbox._alpha < 0) { faderbox._alpha = 0; } currentAlpha = faderbox._alpha; } };
Frame 94
lands = 12; total = 0; rocks = 6; objects = 5; buttons = 3; enemies = 8; notputdown = -1; health = topHealth; healthMultiplier = 100 / health; flightJuice = topFlightJuice; flightMultiplier = 100 / flightJuice; mouse.maxWidth = 62.1; landWidth = 188; onLandNum = 0; globalX = 0; globalY = 0; win = false; mousehitsbuttons = false; topsmoke = 5; smoke = 0; thrustsoundpauser = 0; totalforthruster = 4; fadein = true; loading = true; stop(); mouse = eval (type); mouse._x = startX._x; mouse._y = startX._y; startX._x = -100; startX._y = -100; mouse.dy = 0; mouse.dx = 0; mouse.oX = mouse._x; mouse.oY = mouse._y; explosion.oX = -10000; explosion.oY = -10000; leftbarrier.oX = leftbarrier._x; leftbarrier.oY = leftbarrier._y; rightbarrier.oX = rightbarrier._x; rightbarrier.oY = rightbarrier._y; topbarrier.oX = topbarrier._x; topbarrier.oY = topbarrier._y; bottombarrier.oX = bottombarrier._x; bottombarrier.oY = bottombarrier._y; end.oX = end._x; end.oY = end._y; enemy1.tower = false; enemy2.tower = false; enemy3.tower = false; enemy4.tower = false; enemy5.tower = true; enemy6.tower = true; enemy7.tower = true; enemy8.tower = true; i = 0; while (i <= objects) { currentObject = eval ("object" + i); currentObject.oX = currentObject._x; currentObject.oY = currentObject._y; i++; } enemy1.gotoLeft = true; i = 1; while (i <= enemies) { currentEnemy = eval ("enemy" + i); currentEnemy.health = 8; currentEnemy.speed = 2; firstFlag = eval ("firstPatrolMarker" + i); secondFlag = eval ("secondPatrolMarker" + i); currentEnemy.patrolLength = secondFlag._x - firstFlag._x; currentEnemy.patrolPoint = currentEnemy._x - firstFlag._x; firstFlag._x = -100; secondFlag._x = -100; currentEnemy.damage = 1; currentEnemy.oX = currentEnemy._x; currentEnemy.oY = currentEnemy._y; currentEnemy.dead = false; currentEnemy.gotoLeft = true; i++; } i = 0; while (i <= enemies) { currentEnemy = eval ("enemy" + i); if (currentEnemy.tower == true) { currentEnemy.counter = 0; currentEnemy.counterLimit = 60; currentEnemy.launchSpeed = 2; currentEnemy.health = 20; } i++; } i = 0; while (i <= buttons) { currentButton = eval ("button" + i); currentButton.pressed = false; currentButton.oX = currentButton._x; currentButton.oY = currentButton._y; currentResponder = eval ("responder" + i); currentResponder.oX = currentResponder._x; currentResponder.oY = currentResponder._y; currentResponder.fadeOut = false; currentResponder.alpha = 100; currentResponder.speed = 6; i++; } i = 0; while (i <= rocks) { currentRock = eval ("rock" + i); currentRock.oX = currentRock._x; currentRock.oY = currentRock._y; currentRock.dx = 0; currentRock.dy = 0; currentRock.originX = currentRock._x; currentRock.originY = currentRock._y; i++; } i = 0; while (i <= lands) { currentLand = eval ("land" + i); currentLand.oX = currentLand._x; currentLand.oY = currentLand._y; i++; } mouse.onEnterFrame = function () { if (fadein == true) { fadeIn(); } else { fadeOut(); } mouse.dy = mouse.dy + gravity; mouse._y = mouse._y + mouse.dy; mouse._x = mouse._x + mouse.dx; healthbar._xscale = health * healthMultiplier; if (flightJuice > 0) { flightbar._xscale = flightJuice * flightMultiplier; } if (health <= 0) { fadein = false; loading = false; } if (health < topHealth) { health = health + (regenerateRate / 5); } if (flightJuice < topFlightJuice) { flightJuice = flightJuice + regenerateRate; } dx = (Stage.width / 2) - mouse._x; dy = (Stage.width / 2) - mouse._y; dx = dx / 4; dy = dy / 4; if (mouse.dx > topspeed) { mouse.dx = topspeed; } if (mouse.dx < (-topspeed)) { mouse.dx = -topspeed; } if (mouse.dy > topspeed) { mouse.dy = topspeed; } if (mouse.dy < (-topspeed)) { mouse.dy = -topspeed; } globalX = globalX + dx; globalY = globalY + dy; i = 1; while (i <= lands) { currentLand = eval ("land" + i); currentLand._x = currentLand.oX + globalX; currentLand._y = currentLand.oY + globalY; i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); currentRock._x = currentRock.oX + globalX; currentRock._y = currentRock.oY + globalY; i++; } i = 1; while (i <= enemies) { currentEnemy = eval ("enemy" + i); currentEnemy._x = currentEnemy.oX + globalX; currentEnemy._y = currentEnemy.oY + globalY; if (currentEnemy.tower) { currentBullet = eval ("bullet" + i); currentBullet._x = currentBullet.oX + globalX; currentBullet._y = currentBullet.oY + globalY; } i++; } explosion._x = explosion.oX + globalX; explosion._y = explosion.oY + globalY; i = 0; while (i <= buttons) { currentButton = eval ("button" + i); currentResponder = eval ("responder" + i); currentButton._x = currentButton.oX + globalX; currentButton._y = currentButton.oY + globalY; currentResponder._x = currentResponder.oX + globalX; currentResponder._y = currentResponder.oY + globalY; i++; } i = 0; while (i <= objects) { currentObject = eval ("object" + i); currentObject._x = currentObject.oX + globalX; currentObject._y = currentObject.oY + globalY; i++; } leftbarrier._x = leftbarrier.oX + globalX; leftbarrier._y = leftbarrier.oY + globalY; rightbarrier._x = rightbarrier.oX + globalX; rightbarrier._y = rightbarrier.oY + globalY; topbarrier._x = topbarrier.oX + globalX; topbarrier._y = topbarrier.oY + globalY; bottombarrier._x = bottombarrier.oX + globalX; bottombarrier._y = bottombarrier.oY + globalY; end._x = end.oX + globalX; end._y = end.oY + globalY; mouse.oX = mouse.oX + dx; mouse.oY = mouse.oY + dy; mouse._y = mouse._y + dy; mouse._x = mouse._x + dx; bg._x = bg._x + (dx / 3); bg._y = bg._y + (dy / 3); if (notputdown != -1) { currentRock = eval ("rock" + notputdown); currentRock._x = mouse._x; currentRock._y = mouse._y + 25; currentRock.dx = mouse.dx; currentRock.dy = mouse.dy; } onLand = false; i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (mouse._y < (currentLand._y + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = currentLand._y; onLand = true; onLandNum = i; } else if (mouse._y > (((currentLand._y + 35.5) + 25.4) + (mouse.dy * 1.2))) { mouse.dy = mouse.dy * -1; mouse._y = mouse._y + (mouse.dy * 1.5); } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } i++; } if (notputdown != -1) { currentRock = eval ("rock" + notputdown); i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (currentRock.hitTest(currentLand)) { if (currentRock._y < (currentLand._y + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = currentLand._y - 25; onLand = true; onLandNum = i; } else if (currentRock._y > (((currentLand._y + 35) + 27) + (mouse.dy * 1.2))) { mouse.dy = mouse.dy * -1; mouse._y = mouse._y + (mouse.dy * 1.5); } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } i++; } notDropRock = eval ("rock" + notputdown); i = 1; while (i <= rocks) { if (i != notputdown) { currentRock = eval ("rock" + i); if (notDropRock.hitTest(currentRock)) { if (notDropRock._y < ((currentRock._y - 25) + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = currentRock._y - 54; onLand = true; } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } } i++; } } if (mouse.hitTest(leftbarrier)) { mouse.dx = mouse.dx * -1; mouse.oX = mouse.oX + (mouse.dx * 6); } if (mouse.hitTest(rightbarrier)) { mouse.dx = mouse.dx * -1; mouse.oX = mouse.oX + (mouse.dx * 6); } if (mouse.hitTest(topbarrier)) { mouse.dy = mouse.dy * -1; mouse.oY = mouse.oY + (mouse.dy * 6); } if (mouse.hitTest(bottombarrier)) { mouse.dy = mouse.dy * -1; mouse.oY = mouse.oY + (mouse.dy * 6); } i = 0; while (i <= rocks) { currentRock = eval ("rock" + i); if (currentRock.hitTest(leftbarrier)) { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 6); } if (currentRock.hitTest(rightbarrier)) { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 6); } if (currentRock.hitTest(topbarrier)) { currentRock.dy = currentRock.dy * -1; currentRock.oY = currentRock.oY + (currentRock.dy * 6); } if (currentRock.hitTest(bottombarrier)) { currentRock.dy = currentRock.dy * -1; currentRock.oX = currentRock.oX + (currentRock.dy * 6); } i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); e = 1; while (e <= enemies) { currentEnemy = eval ("enemy" + e); if (currentRock.hitTest(currentEnemy)) { if (currentRock._y < currentEnemy._y) { if (currentRock.dy > 0) { if (playsounds) { } currentEnemy.health = currentEnemy.health - currentRock.dy; if (currentEnemy.tower == false) { currentEnemy._yscale = currentEnemy.health * 10; } else { currentEnemy._yscale = currentEnemy.health * 5; } currentEnemy.speed = 0; currentRock.dy = 0; currentRock.dx = 0; if (notputdown == i) { mouse._y = mouse._y - 5; mouse.dy = mouse.dy - 1; currentX = currentRock.oX + globalX; currentY = currentRock.oY + globalY; dx = mouse._x - currentX; dy = mouse._y - currentY; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); notputdown = -1; } if (currentEnemy.health <= 1) { if (i != notputdown) { if (playsounds) { explosionS.start(0, 1); } explosion.oX = currentEnemy.oX; explosion.oY = currentEnemy.oY; if (currentEnemy.tower == true) { explosion._yscale = 200; explosion._xscale = 100; } else { explosion._yscale = 65; explosion._xscale = 65; } explosion.gotoAndPlay(1); currentEnemy.oX = -1000; currentEnemy.oY = -1000; } else { if (playsounds) { explosionS.start(0, 1); } if (currentEnemy.tower == true) { explosion._yscale = 200; explosion._xscale = 100; } else { explosion._yscale = 65; explosion._xscale = 65; } explosion.gotoAndPlay(1); currentEnemy.oX = -1000; currentEnemy.oY = -1000; mouse._y = mouse._y - 5; mouse.dy = mouse.dy - 1; currentX = currentRock.oX + globalX; currentY = currentRock.oY + globalY; dx = mouse._x - currentX; dy = mouse._y - currentY; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); notputdown = -1; } currentEnemy.dead = true; } } } } e++; } i++; } i = 1; while (i <= rocks) { if (i != notputdown) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (mouse._y < ((currentRock._y - 25) + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = (currentRock.oY + globalY) - 26; onLand = true; } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } } i++; } i = 0; while (i <= buttons) { currentResponder = eval ("responder" + i); if (mouse.hitTest(currentResponder)) { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } i++; } pressed = false; if (Key.isDown(38)) { if (onLand) { mouse.dy = -2; mouse._y = mouse._y + mouse.dy; } else if (flightJuice > 0) { pressed = true; mouse.gotoAndStop("up"); mouse.dy = mouse.dy - thrust; flightJuice = flightJuice - 1; } } if (Key.isDown(40)) { if (onLand) { } else if (flightJuice > 0) { pressed = true; mouse.gotoAndStop("down"); mouse.dy = mouse.dy + thrust; flightJuice = flightJuice - 1; } if (mouse.hitTest(topbarrier)) { mouse._y = mouse._y + 7; } i = 0; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (currentLand._y < (mouse._y - 5)) { mouse._y = mouse._y + 7; } } i++; } } if (Key.isDown(37)) { pressed = true; if (onLand) { mouse.dx = mouse.dx - thrust; mouse.gotoAndStop("left"); } else if (flightJuice > 0) { pressed = true; mouse.dx = mouse.dx - thrust; mouse.gotoAndStop("left"); flightJuice = flightJuice - 1; } i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (i != onLandNum) { if (mouse._y > currentLand._y) { mouse._x = mouse._x - 7; } } } i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (mouse._y > (currentRock._y - 26)) { if (i != notputdown) { mouse._x = mouse._x - 7; } } } i++; } i = 0; while (i <= buttons) { currentResponder = eval ("responder" + i); if (mouse.hitTest(currentResponder)) { mouse._x = mouse._x - 7; } i++; } if (mouse.hitTest(rightbarrier)) { mouse._x = mouse._x - 7; } } else if (Key.isDown(39)) { pressed = true; if (onLand) { mouse.dx = mouse.dx + thrust; mouse.gotoAndStop("left"); } else if (flightJuice > 0) { pressed = true; mouse.dx = mouse.dx + thrust; mouse.gotoAndStop("left"); flightJuice = flightJuice - 1; } mouse.gotoAndStop("right"); i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (i != onLandNum) { if (mouse._y > currentLand._y) { mouse._x = mouse._x + 7; } } } i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (mouse._y > (currentRock._y - 26)) { if (i != notputdown) { mouse._x = mouse._x + 7; } } } i++; } i = 0; while (i <= buttons) { currentResponder = eval ("responder" + i); if (mouse.hitTest(currentResponder)) { mouse._x = mouse._x + 7; } i++; } if (mouse.hitTest(leftbarrier)) { mouse._x = mouse._x + 7; } } else if (mouse.dx < 0) { mouse.dx = mouse.dx + thrust; } else if (mouse.dx > 0) { mouse.dx = mouse.dx - thrust; } if (mouse.dx < 0.1) { if (mouse.dx > 0) { mouse.dx = 0; } } if (mouse.dx > -0.1) { if (mouse.dx < 0) { mouse.dx = 0; } } if (pressed == false) { mouse.gotoAndStop("center"); } if (pressed == true) { if (playsounds) { thrustsoundpauser++; if (thrustsoundpauser == totalforthruster) { thruster.start(0, 1); thrustsoundpauser = 0; } } } if (Key.isDown(32)) { if (donePressSpace) { donePressSpace = false; if (notputdown == -1) { i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (playsounds) { pickup.start(0, 1); } notputdown = i; dx = mouse._x - currentRock._x; dy = mouse._y - currentRock._y; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); } i++; } } else { mouse._y = mouse._y - 5; mouse.dy = mouse.dy - 1; if (playsounds) { pickup.start(0, 1); } currentRock = eval ("rock" + notputdown); currentX = currentRock.oX + globalX; currentY = currentRock.oY + globalY; dx = mouse._x - currentX; dy = mouse._y - currentY; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); notputdown = -1; } } } else { donePressSpace = true; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (i != notputdown) { currentRock.dy = currentRock.dy + gravity; currentRock.oX = currentRock.oX + currentRock.dx; currentRock.oY = currentRock.oY + currentRock.dy; } l = 1; while (l <= lands) { currentLand = eval ("land" + l); if (currentRock.hitTest(currentLand)) { if (currentRock._y < ((currentLand._y + currentRock.dy) + 0.5)) { currentRock.oY = currentLand.oY; currentRock.dy = 0; currentRock.dx = 0; } else if (currentRock._y > (currentLand._y + 25.5)) { currentRock.dy = currentRock.dy * -1; currentRock.oY = currentRock.oY + (currentRock.dy * 2); } else { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 4); } } l++; } b = 1; while (b <= rocks) { otherRock = eval ("rock" + b); if (b != i) { if (currentRock.hitTest(otherRock)) { if (currentRock.oY < otherRock.oY) { currentRock.oY = otherRock.oY - 29; currentRock.dy = 0; currentRock.dx = 0; } } } b++; } b = 0; while (b <= buttons) { currentResponder = eval ("responder" + b); if (currentRock.hitTest(currentResponder)) { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 6); } b++; } i++; } i = 1; while (i <= enemies) { currentEnemy = eval ("enemy" + i); if (currentEnemy.tower == false) { if (currentEnemy.gotoLeft == true) { if (currentEnemy.patrolPoint < currentEnemy.patrolLength) { currentEnemy.oX = currentEnemy.oX + currentEnemy.speed; currentEnemy.patrolPoint = currentEnemy.patrolPoint + currentEnemy.speed; } else { currentEnemy.gotoLeft = false; currentEnemy.gotoAndPlay("turn"); } } else if (currentEnemy.patrolPoint > 0) { currentEnemy.oX = currentEnemy.oX - currentEnemy.speed; currentEnemy.patrolPoint = currentEnemy.patrolPoint - currentEnemy.speed; } else { currentEnemy.gotoLeft = true; currentEnemy.gotoAndPlay("turn"); } } i++; } i = 0; while (i <= enemies) { currentEnemy = eval ("enemy" + i); if (mouse.hitTest(currentEnemy)) { if (currentEnemy.tower == false) { health = health - currentEnemy.damage; } } if (currentEnemy.tower == true) { currentBullet = eval ("bullet" + i); if (mouse.hitTest(currentBullet)) { health = health - currentEnemy.damage; } } i++; } i = 0; while (i <= buttons) { currentButton = eval ("button" + i); currentResponder = eval ("responder" + i); hit = false; r = 0; while (r <= rocks) { currentRock = eval ("rock" + r); if (currentButton.hitTest(currentRock)) { hit = true; if (currentButton.pressed == false) { currentButton.pressed = true; currentResponder.oX = currentResponder.oX + 10000; } } r++; } if (mousehitsbuttons == true) { if (mouse.hitTest(currentButton)) { hit = true; if (currentButton.pressed == false) { currentButton.pressed = true; currentResponder.oX = currentResponder.oX + 10000; } } } if (hit == false) { if (currentButton.pressed == true) { currentButton.pressed = false; currentResponder.oX = currentResponder.oX - 10000; currentResponder.alpha = 0; } } i++; } currentResponder.fadeOut = false; currentResponder.alpha = 100; currentResponder.speed = 6; if (mouse.hitTest(end)) { if (win == false) { level++; winS.start(0, 1); end.gotoAndPlay("win"); win = true; } } i = 0; while (i <= enemies) { currentTower = eval ("enemy" + i); if (currentTower.tower == true) { currentTop = eval ("towertop" + i); currentBullet = eval ("bullet" + i); currentTop._x = currentTower._x; currentTop._y = currentTower._y - (95 * (currentTower._yscale / 100)); currentTop._yscale = currentTower._yscale; dx = currentTop._x - mouse._x; dy = currentTop._y - mouse._y; radians = Math.atan(dy / dx); degrees = (radians * 180) / Math.PI; if (dx > 0) { degrees = degrees + 180; } radians = (degrees / 180) * Math.PI; degrees = degrees + 90; currentTop._rotation = degrees; distance = Math.sqrt((dx * dx) + (dy * dy)); currentTower.counter++; if (currentTower.counter >= currentTower.counterLimit) { currentTower.counter = 0; currentBullet.oX = currentTower.oX; currentBullet.oY = currentTower.oY - (95 * (currentTower._yscale / 100)); currentBullet.dx = Math.cos(radians) * currentTower.launchSpeed; currentBullet.dy = Math.sin(radians) * currentTower.launchSpeed; } currentBullet.oX = currentBullet.oX + currentBullet.dx; currentBullet.oY = currentBullet.oY + currentBullet.dy; } i++; } }; menu.onRelease = function () { gotoAndStop ("menu"); }; currentAlpha = 100; faderbox._alpha = currentAlpha; fadeOut = function () { if (loading == true) { faderbox.gotoAndStop("blue"); } if (loading == false) { faderbox.gotoAndStop("red"); } currentAlpha = currentAlpha + speed; if (currentAlpha >= 100) { currentAlpha = 100; if (loading == true) { gotoAndStop ("loading"); } if (loading == false) { gotoAndStop ("lose"); } } faderbox._x = 0; faderbox._y = 0; faderbox._alpha = currentAlpha; }; fadeIn = function () { faderbox.gotoAndStop("blue"); currentAlpha = currentAlpha - speed; if (currentAlpha <= 0) { currentAlpha = 0; faderbox._x = -10000; faderbox._y = -10000; } faderbox._alpha = currentAlpha; if (health < topHealth) { faderbox.gotoAndStop("red"); faderbox._x = 0; faderbox._y = 0; faderbox._alpha = (100 - (health * healthMultiplier)) - 20; if (faderbox._alpha < 0) { faderbox._alpha = 0; } currentAlpha = faderbox._alpha; } };
Frame 95
lands = 12; total = 0; rocks = 6; objects = 5; buttons = 3; enemies = 8; notputdown = -1; health = topHealth; healthMultiplier = 100 / health; flightJuice = topFlightJuice; flightMultiplier = 100 / flightJuice; mouse.maxWidth = 62.1; landWidth = 188; onLandNum = 0; globalX = 0; globalY = 0; win = false; mousehitsbuttons = false; topsmoke = 5; smoke = 0; thrustsoundpauser = 0; totalforthruster = 4; fadein = true; loading = true; stop(); mouse = eval (type); mouse._x = startX._x; mouse._y = startX._y; startX._x = -100; startX._y = -100; mouse.dy = 0; mouse.dx = 0; mouse.oX = mouse._x; mouse.oY = mouse._y; explosion.oX = -10000; explosion.oY = -10000; leftbarrier.oX = leftbarrier._x; leftbarrier.oY = leftbarrier._y; rightbarrier.oX = rightbarrier._x; rightbarrier.oY = rightbarrier._y; topbarrier.oX = topbarrier._x; topbarrier.oY = topbarrier._y; bottombarrier.oX = bottombarrier._x; bottombarrier.oY = bottombarrier._y; end.oX = end._x; end.oY = end._y; enemy1.tower = false; enemy2.tower = false; enemy3.tower = false; enemy4.tower = false; enemy5.tower = true; enemy6.tower = true; enemy7.tower = true; enemy8.tower = true; i = 0; while (i <= objects) { currentObject = eval ("object" + i); currentObject.oX = currentObject._x; currentObject.oY = currentObject._y; i++; } enemy1.gotoLeft = true; i = 1; while (i <= enemies) { currentEnemy = eval ("enemy" + i); currentEnemy.health = 8; currentEnemy.speed = 2; firstFlag = eval ("firstPatrolMarker" + i); secondFlag = eval ("secondPatrolMarker" + i); currentEnemy.patrolLength = secondFlag._x - firstFlag._x; currentEnemy.patrolPoint = currentEnemy._x - firstFlag._x; firstFlag._x = -100; secondFlag._x = -100; currentEnemy.damage = 1; currentEnemy.oX = currentEnemy._x; currentEnemy.oY = currentEnemy._y; currentEnemy.dead = false; currentEnemy.gotoLeft = true; i++; } i = 0; while (i <= enemies) { currentEnemy = eval ("enemy" + i); if (currentEnemy.tower == true) { currentEnemy.counter = 0; currentEnemy.counterLimit = 60; currentEnemy.launchSpeed = 2; currentEnemy.health = 20; } i++; } i = 0; while (i <= buttons) { currentButton = eval ("button" + i); currentButton.pressed = false; currentButton.oX = currentButton._x; currentButton.oY = currentButton._y; currentResponder = eval ("responder" + i); currentResponder.oX = currentResponder._x; currentResponder.oY = currentResponder._y; currentResponder.fadeOut = false; currentResponder.alpha = 100; currentResponder.speed = 6; i++; } i = 0; while (i <= rocks) { currentRock = eval ("rock" + i); currentRock.oX = currentRock._x; currentRock.oY = currentRock._y; currentRock.dx = 0; currentRock.dy = 0; currentRock.originX = currentRock._x; currentRock.originY = currentRock._y; i++; } i = 0; while (i <= lands) { currentLand = eval ("land" + i); currentLand.oX = currentLand._x; currentLand.oY = currentLand._y; i++; } mouse.onEnterFrame = function () { if (fadein == true) { fadeIn(); } else { fadeOut(); } mouse.dy = mouse.dy + gravity; mouse._y = mouse._y + mouse.dy; mouse._x = mouse._x + mouse.dx; healthbar._xscale = health * healthMultiplier; if (flightJuice > 0) { flightbar._xscale = flightJuice * flightMultiplier; } if (health <= 0) { fadein = false; loading = false; } if (health < topHealth) { health = health + (regenerateRate / 5); } if (flightJuice < topFlightJuice) { flightJuice = flightJuice + regenerateRate; } dx = (Stage.width / 2) - mouse._x; dy = (Stage.width / 2) - mouse._y; dx = dx / 4; dy = dy / 4; if (mouse.dx > topspeed) { mouse.dx = topspeed; } if (mouse.dx < (-topspeed)) { mouse.dx = -topspeed; } if (mouse.dy > topspeed) { mouse.dy = topspeed; } if (mouse.dy < (-topspeed)) { mouse.dy = -topspeed; } globalX = globalX + dx; globalY = globalY + dy; i = 1; while (i <= lands) { currentLand = eval ("land" + i); currentLand._x = currentLand.oX + globalX; currentLand._y = currentLand.oY + globalY; i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); currentRock._x = currentRock.oX + globalX; currentRock._y = currentRock.oY + globalY; i++; } i = 1; while (i <= enemies) { currentEnemy = eval ("enemy" + i); currentEnemy._x = currentEnemy.oX + globalX; currentEnemy._y = currentEnemy.oY + globalY; if (currentEnemy.tower) { currentBullet = eval ("bullet" + i); currentBullet._x = currentBullet.oX + globalX; currentBullet._y = currentBullet.oY + globalY; } i++; } explosion._x = explosion.oX + globalX; explosion._y = explosion.oY + globalY; i = 0; while (i <= buttons) { currentButton = eval ("button" + i); currentResponder = eval ("responder" + i); currentButton._x = currentButton.oX + globalX; currentButton._y = currentButton.oY + globalY; currentResponder._x = currentResponder.oX + globalX; currentResponder._y = currentResponder.oY + globalY; i++; } i = 0; while (i <= objects) { currentObject = eval ("object" + i); currentObject._x = currentObject.oX + globalX; currentObject._y = currentObject.oY + globalY; i++; } leftbarrier._x = leftbarrier.oX + globalX; leftbarrier._y = leftbarrier.oY + globalY; rightbarrier._x = rightbarrier.oX + globalX; rightbarrier._y = rightbarrier.oY + globalY; topbarrier._x = topbarrier.oX + globalX; topbarrier._y = topbarrier.oY + globalY; bottombarrier._x = bottombarrier.oX + globalX; bottombarrier._y = bottombarrier.oY + globalY; end._x = end.oX + globalX; end._y = end.oY + globalY; mouse.oX = mouse.oX + dx; mouse.oY = mouse.oY + dy; mouse._y = mouse._y + dy; mouse._x = mouse._x + dx; bg._x = bg._x + (dx / 3); bg._y = bg._y + (dy / 3); if (notputdown != -1) { currentRock = eval ("rock" + notputdown); currentRock._x = mouse._x; currentRock._y = mouse._y + 25; currentRock.dx = mouse.dx; currentRock.dy = mouse.dy; } onLand = false; i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (mouse._y < (currentLand._y + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = currentLand._y; onLand = true; onLandNum = i; } else if (mouse._y > (((currentLand._y + 35.5) + 25.4) + (mouse.dy * 1.2))) { mouse.dy = mouse.dy * -1; mouse._y = mouse._y + (mouse.dy * 1.5); } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } i++; } if (notputdown != -1) { currentRock = eval ("rock" + notputdown); i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (currentRock.hitTest(currentLand)) { if (currentRock._y < (currentLand._y + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = currentLand._y - 25; onLand = true; onLandNum = i; } else if (currentRock._y > (((currentLand._y + 35) + 27) + (mouse.dy * 1.2))) { mouse.dy = mouse.dy * -1; mouse._y = mouse._y + (mouse.dy * 1.5); } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } i++; } notDropRock = eval ("rock" + notputdown); i = 1; while (i <= rocks) { if (i != notputdown) { currentRock = eval ("rock" + i); if (notDropRock.hitTest(currentRock)) { if (notDropRock._y < ((currentRock._y - 25) + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = currentRock._y - 54; onLand = true; } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } } i++; } } if (mouse.hitTest(leftbarrier)) { mouse.dx = mouse.dx * -1; mouse.oX = mouse.oX + (mouse.dx * 6); } if (mouse.hitTest(rightbarrier)) { mouse.dx = mouse.dx * -1; mouse.oX = mouse.oX + (mouse.dx * 6); } if (mouse.hitTest(topbarrier)) { mouse.dy = mouse.dy * -1; mouse.oY = mouse.oY + (mouse.dy * 6); } if (mouse.hitTest(bottombarrier)) { mouse.dy = mouse.dy * -1; mouse.oY = mouse.oY + (mouse.dy * 6); } i = 0; while (i <= rocks) { currentRock = eval ("rock" + i); if (currentRock.hitTest(leftbarrier)) { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 6); } if (currentRock.hitTest(rightbarrier)) { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 6); } if (currentRock.hitTest(topbarrier)) { currentRock.dy = currentRock.dy * -1; currentRock.oY = currentRock.oY + (currentRock.dy * 6); } if (currentRock.hitTest(bottombarrier)) { currentRock.dy = currentRock.dy * -1; currentRock.oX = currentRock.oX + (currentRock.dy * 6); } i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); e = 1; while (e <= enemies) { currentEnemy = eval ("enemy" + e); if (currentRock.hitTest(currentEnemy)) { if (currentRock._y < currentEnemy._y) { if (currentRock.dy > 0) { if (playsounds) { } currentEnemy.health = currentEnemy.health - currentRock.dy; if (currentEnemy.tower == false) { currentEnemy._yscale = currentEnemy.health * 10; } else { currentEnemy._yscale = currentEnemy.health * 5; } currentEnemy.speed = 0; currentRock.dy = 0; currentRock.dx = 0; if (notputdown == i) { mouse._y = mouse._y - 5; mouse.dy = mouse.dy - 1; currentX = currentRock.oX + globalX; currentY = currentRock.oY + globalY; dx = mouse._x - currentX; dy = mouse._y - currentY; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); notputdown = -1; } if (currentEnemy.health <= 1) { if (i != notputdown) { if (playsounds) { explosionS.start(0, 1); } explosion.oX = currentEnemy.oX; explosion.oY = currentEnemy.oY; if (currentEnemy.tower == true) { explosion._yscale = 200; explosion._xscale = 100; } else { explosion._yscale = 65; explosion._xscale = 65; } explosion.gotoAndPlay(1); currentEnemy.oX = -1000; currentEnemy.oY = -1000; } else { if (playsounds) { explosionS.start(0, 1); } if (currentEnemy.tower == true) { explosion._yscale = 200; explosion._xscale = 100; } else { explosion._yscale = 65; explosion._xscale = 65; } explosion.gotoAndPlay(1); currentEnemy.oX = -1000; currentEnemy.oY = -1000; mouse._y = mouse._y - 5; mouse.dy = mouse.dy - 1; currentX = currentRock.oX + globalX; currentY = currentRock.oY + globalY; dx = mouse._x - currentX; dy = mouse._y - currentY; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); notputdown = -1; } currentEnemy.dead = true; } } } } e++; } i++; } i = 1; while (i <= rocks) { if (i != notputdown) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (mouse._y < ((currentRock._y - 25) + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = (currentRock.oY + globalY) - 26; onLand = true; } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } } i++; } i = 0; while (i <= buttons) { currentResponder = eval ("responder" + i); if (mouse.hitTest(currentResponder)) { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } i++; } pressed = false; if (Key.isDown(38)) { if (onLand) { mouse.dy = -2; mouse._y = mouse._y + mouse.dy; } else if (flightJuice > 0) { pressed = true; mouse.gotoAndStop("up"); mouse.dy = mouse.dy - thrust; flightJuice = flightJuice - 1; } } if (Key.isDown(40)) { if (onLand) { } else if (flightJuice > 0) { pressed = true; mouse.gotoAndStop("down"); mouse.dy = mouse.dy + thrust; flightJuice = flightJuice - 1; } if (mouse.hitTest(topbarrier)) { mouse._y = mouse._y + 7; } i = 0; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (currentLand._y < (mouse._y - 5)) { mouse._y = mouse._y + 7; } } i++; } } if (Key.isDown(37)) { pressed = true; if (onLand) { mouse.dx = mouse.dx - thrust; mouse.gotoAndStop("left"); } else if (flightJuice > 0) { pressed = true; mouse.dx = mouse.dx - thrust; mouse.gotoAndStop("left"); flightJuice = flightJuice - 1; } i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (i != onLandNum) { if (mouse._y > currentLand._y) { mouse._x = mouse._x - 7; } } } i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (mouse._y > (currentRock._y - 26)) { if (i != notputdown) { mouse._x = mouse._x - 7; } } } i++; } i = 0; while (i <= buttons) { currentResponder = eval ("responder" + i); if (mouse.hitTest(currentResponder)) { mouse._x = mouse._x - 7; } i++; } if (mouse.hitTest(rightbarrier)) { mouse._x = mouse._x - 7; } } else if (Key.isDown(39)) { pressed = true; if (onLand) { mouse.dx = mouse.dx + thrust; mouse.gotoAndStop("left"); } else if (flightJuice > 0) { pressed = true; mouse.dx = mouse.dx + thrust; mouse.gotoAndStop("left"); flightJuice = flightJuice - 1; } mouse.gotoAndStop("right"); i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (i != onLandNum) { if (mouse._y > currentLand._y) { mouse._x = mouse._x + 7; } } } i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (mouse._y > (currentRock._y - 26)) { if (i != notputdown) { mouse._x = mouse._x + 7; } } } i++; } i = 0; while (i <= buttons) { currentResponder = eval ("responder" + i); if (mouse.hitTest(currentResponder)) { mouse._x = mouse._x + 7; } i++; } if (mouse.hitTest(leftbarrier)) { mouse._x = mouse._x + 7; } } else if (mouse.dx < 0) { mouse.dx = mouse.dx + thrust; } else if (mouse.dx > 0) { mouse.dx = mouse.dx - thrust; } if (mouse.dx < 0.1) { if (mouse.dx > 0) { mouse.dx = 0; } } if (mouse.dx > -0.1) { if (mouse.dx < 0) { mouse.dx = 0; } } if (pressed == false) { mouse.gotoAndStop("center"); } if (pressed == true) { if (playsounds) { thrustsoundpauser++; if (thrustsoundpauser == totalforthruster) { thruster.start(0, 1); thrustsoundpauser = 0; } } } if (Key.isDown(32)) { if (donePressSpace) { donePressSpace = false; if (notputdown == -1) { i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (playsounds) { pickup.start(0, 1); } notputdown = i; dx = mouse._x - currentRock._x; dy = mouse._y - currentRock._y; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); } i++; } } else { mouse._y = mouse._y - 5; mouse.dy = mouse.dy - 1; if (playsounds) { pickup.start(0, 1); } currentRock = eval ("rock" + notputdown); currentX = currentRock.oX + globalX; currentY = currentRock.oY + globalY; dx = mouse._x - currentX; dy = mouse._y - currentY; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); notputdown = -1; } } } else { donePressSpace = true; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (i != notputdown) { currentRock.dy = currentRock.dy + gravity; currentRock.oX = currentRock.oX + currentRock.dx; currentRock.oY = currentRock.oY + currentRock.dy; } l = 1; while (l <= lands) { currentLand = eval ("land" + l); if (currentRock.hitTest(currentLand)) { if (currentRock._y < ((currentLand._y + currentRock.dy) + 0.5)) { currentRock.oY = currentLand.oY; currentRock.dy = 0; currentRock.dx = 0; } else if (currentRock._y > (currentLand._y + 25.5)) { currentRock.dy = currentRock.dy * -1; currentRock.oY = currentRock.oY + (currentRock.dy * 2); } else { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 4); } } l++; } b = 1; while (b <= rocks) { otherRock = eval ("rock" + b); if (b != i) { if (currentRock.hitTest(otherRock)) { if (currentRock.oY < otherRock.oY) { currentRock.oY = otherRock.oY - 29; currentRock.dy = 0; currentRock.dx = 0; } } } b++; } b = 0; while (b <= buttons) { currentResponder = eval ("responder" + b); if (currentRock.hitTest(currentResponder)) { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 6); } b++; } i++; } i = 1; while (i <= enemies) { currentEnemy = eval ("enemy" + i); if (currentEnemy.tower == false) { if (currentEnemy.gotoLeft == true) { if (currentEnemy.patrolPoint < currentEnemy.patrolLength) { currentEnemy.oX = currentEnemy.oX + currentEnemy.speed; currentEnemy.patrolPoint = currentEnemy.patrolPoint + currentEnemy.speed; } else { currentEnemy.gotoLeft = false; currentEnemy.gotoAndPlay("turn"); } } else if (currentEnemy.patrolPoint > 0) { currentEnemy.oX = currentEnemy.oX - currentEnemy.speed; currentEnemy.patrolPoint = currentEnemy.patrolPoint - currentEnemy.speed; } else { currentEnemy.gotoLeft = true; currentEnemy.gotoAndPlay("turn"); } } i++; } i = 0; while (i <= enemies) { currentEnemy = eval ("enemy" + i); if (mouse.hitTest(currentEnemy)) { if (currentEnemy.tower == false) { health = health - currentEnemy.damage; } } if (currentEnemy.tower == true) { currentBullet = eval ("bullet" + i); if (mouse.hitTest(currentBullet)) { health = health - currentEnemy.damage; } } i++; } i = 0; while (i <= buttons) { currentButton = eval ("button" + i); currentResponder = eval ("responder" + i); hit = false; r = 0; while (r <= rocks) { currentRock = eval ("rock" + r); if (currentButton.hitTest(currentRock)) { hit = true; if (currentButton.pressed == false) { currentButton.pressed = true; currentResponder.oX = currentResponder.oX + 10000; } } r++; } if (mousehitsbuttons == true) { if (mouse.hitTest(currentButton)) { hit = true; if (currentButton.pressed == false) { currentButton.pressed = true; currentResponder.oX = currentResponder.oX + 10000; } } } if (hit == false) { if (currentButton.pressed == true) { currentButton.pressed = false; currentResponder.oX = currentResponder.oX - 10000; currentResponder.alpha = 0; } } i++; } currentResponder.fadeOut = false; currentResponder.alpha = 100; currentResponder.speed = 6; if (mouse.hitTest(end)) { if (win == false) { level++; winS.start(0, 1); end.gotoAndPlay("win"); win = true; } } i = 0; while (i <= enemies) { currentTower = eval ("enemy" + i); if (currentTower.tower == true) { currentTop = eval ("towertop" + i); currentBullet = eval ("bullet" + i); currentTop._x = currentTower._x; currentTop._y = currentTower._y - (95 * (currentTower._yscale / 100)); currentTop._yscale = currentTower._yscale; dx = currentTop._x - mouse._x; dy = currentTop._y - mouse._y; radians = Math.atan(dy / dx); degrees = (radians * 180) / Math.PI; if (dx > 0) { degrees = degrees + 180; } radians = (degrees / 180) * Math.PI; degrees = degrees + 90; currentTop._rotation = degrees; distance = Math.sqrt((dx * dx) + (dy * dy)); currentTower.counter++; if (currentTower.counter >= currentTower.counterLimit) { currentTower.counter = 0; currentBullet.oX = currentTower.oX; currentBullet.oY = currentTower.oY - (95 * (currentTower._yscale / 100)); currentBullet.dx = Math.cos(radians) * currentTower.launchSpeed; currentBullet.dy = Math.sin(radians) * currentTower.launchSpeed; } currentBullet.oX = currentBullet.oX + currentBullet.dx; currentBullet.oY = currentBullet.oY + currentBullet.dy; } i++; } }; menu.onRelease = function () { gotoAndStop ("menu"); }; currentAlpha = 100; faderbox._alpha = currentAlpha; fadeOut = function () { if (loading == true) { faderbox.gotoAndStop("blue"); } if (loading == false) { faderbox.gotoAndStop("red"); } currentAlpha = currentAlpha + speed; if (currentAlpha >= 100) { currentAlpha = 100; if (loading == true) { gotoAndStop ("loading"); } if (loading == false) { gotoAndStop ("lose"); } } faderbox._x = 0; faderbox._y = 0; faderbox._alpha = currentAlpha; }; fadeIn = function () { faderbox.gotoAndStop("blue"); currentAlpha = currentAlpha - speed; if (currentAlpha <= 0) { currentAlpha = 0; faderbox._x = -10000; faderbox._y = -10000; } faderbox._alpha = currentAlpha; if (health < topHealth) { faderbox.gotoAndStop("red"); faderbox._x = 0; faderbox._y = 0; faderbox._alpha = (100 - (health * healthMultiplier)) - 20; if (faderbox._alpha < 0) { faderbox._alpha = 0; } currentAlpha = faderbox._alpha; } };
Frame 96
lands = 12; total = 0; rocks = 6; objects = 5; buttons = 3; enemies = 8; notputdown = -1; health = topHealth; healthMultiplier = 100 / health; flightJuice = topFlightJuice; flightMultiplier = 100 / flightJuice; mouse.maxWidth = 62.1; landWidth = 188; onLandNum = 0; globalX = 0; globalY = 0; win = false; mousehitsbuttons = false; topsmoke = 5; smoke = 0; thrustsoundpauser = 0; totalforthruster = 4; fadein = true; loading = true; stop(); mouse = eval (type); mouse._x = startX._x; mouse._y = startX._y; startX._x = -100; startX._y = -100; mouse.dy = 0; mouse.dx = 0; mouse.oX = mouse._x; mouse.oY = mouse._y; explosion.oX = -10000; explosion.oY = -10000; leftbarrier.oX = leftbarrier._x; leftbarrier.oY = leftbarrier._y; rightbarrier.oX = rightbarrier._x; rightbarrier.oY = rightbarrier._y; topbarrier.oX = topbarrier._x; topbarrier.oY = topbarrier._y; bottombarrier.oX = bottombarrier._x; bottombarrier.oY = bottombarrier._y; end.oX = end._x; end.oY = end._y; enemy1.tower = false; enemy2.tower = false; enemy3.tower = false; enemy4.tower = false; enemy5.tower = true; enemy6.tower = true; enemy7.tower = true; enemy8.tower = true; i = 0; while (i <= objects) { currentObject = eval ("object" + i); currentObject.oX = currentObject._x; currentObject.oY = currentObject._y; i++; } enemy1.gotoLeft = true; i = 1; while (i <= enemies) { currentEnemy = eval ("enemy" + i); currentEnemy.health = 8; currentEnemy.speed = 2; firstFlag = eval ("firstPatrolMarker" + i); secondFlag = eval ("secondPatrolMarker" + i); currentEnemy.patrolLength = secondFlag._x - firstFlag._x; currentEnemy.patrolPoint = currentEnemy._x - firstFlag._x; firstFlag._x = -100; secondFlag._x = -100; currentEnemy.damage = 1; currentEnemy.oX = currentEnemy._x; currentEnemy.oY = currentEnemy._y; currentEnemy.dead = false; currentEnemy.gotoLeft = true; i++; } i = 0; while (i <= enemies) { currentEnemy = eval ("enemy" + i); if (currentEnemy.tower == true) { currentEnemy.counter = 0; currentEnemy.counterLimit = 60; currentEnemy.launchSpeed = 2; currentEnemy.health = 20; } i++; } i = 0; while (i <= buttons) { currentButton = eval ("button" + i); currentButton.pressed = false; currentButton.oX = currentButton._x; currentButton.oY = currentButton._y; currentResponder = eval ("responder" + i); currentResponder.oX = currentResponder._x; currentResponder.oY = currentResponder._y; currentResponder.fadeOut = false; currentResponder.alpha = 100; currentResponder.speed = 6; i++; } i = 0; while (i <= rocks) { currentRock = eval ("rock" + i); currentRock.oX = currentRock._x; currentRock.oY = currentRock._y; currentRock.dx = 0; currentRock.dy = 0; currentRock.originX = currentRock._x; currentRock.originY = currentRock._y; i++; } i = 0; while (i <= lands) { currentLand = eval ("land" + i); currentLand.oX = currentLand._x; currentLand.oY = currentLand._y; i++; } mouse.onEnterFrame = function () { if (fadein == true) { fadeIn(); } else { fadeOut(); } mouse.dy = mouse.dy + gravity; mouse._y = mouse._y + mouse.dy; mouse._x = mouse._x + mouse.dx; healthbar._xscale = health * healthMultiplier; if (flightJuice > 0) { flightbar._xscale = flightJuice * flightMultiplier; } if (health <= 0) { fadein = false; loading = false; } if (health < topHealth) { health = health + (regenerateRate / 5); } if (flightJuice < topFlightJuice) { flightJuice = flightJuice + regenerateRate; } dx = (Stage.width / 2) - mouse._x; dy = (Stage.width / 2) - mouse._y; dx = dx / 4; dy = dy / 4; if (mouse.dx > topspeed) { mouse.dx = topspeed; } if (mouse.dx < (-topspeed)) { mouse.dx = -topspeed; } if (mouse.dy > topspeed) { mouse.dy = topspeed; } if (mouse.dy < (-topspeed)) { mouse.dy = -topspeed; } globalX = globalX + dx; globalY = globalY + dy; i = 1; while (i <= lands) { currentLand = eval ("land" + i); currentLand._x = currentLand.oX + globalX; currentLand._y = currentLand.oY + globalY; i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); currentRock._x = currentRock.oX + globalX; currentRock._y = currentRock.oY + globalY; i++; } i = 1; while (i <= enemies) { currentEnemy = eval ("enemy" + i); currentEnemy._x = currentEnemy.oX + globalX; currentEnemy._y = currentEnemy.oY + globalY; if (currentEnemy.tower) { currentBullet = eval ("bullet" + i); currentBullet._x = currentBullet.oX + globalX; currentBullet._y = currentBullet.oY + globalY; } i++; } explosion._x = explosion.oX + globalX; explosion._y = explosion.oY + globalY; i = 0; while (i <= buttons) { currentButton = eval ("button" + i); currentResponder = eval ("responder" + i); currentButton._x = currentButton.oX + globalX; currentButton._y = currentButton.oY + globalY; currentResponder._x = currentResponder.oX + globalX; currentResponder._y = currentResponder.oY + globalY; i++; } i = 0; while (i <= objects) { currentObject = eval ("object" + i); currentObject._x = currentObject.oX + globalX; currentObject._y = currentObject.oY + globalY; i++; } leftbarrier._x = leftbarrier.oX + globalX; leftbarrier._y = leftbarrier.oY + globalY; rightbarrier._x = rightbarrier.oX + globalX; rightbarrier._y = rightbarrier.oY + globalY; topbarrier._x = topbarrier.oX + globalX; topbarrier._y = topbarrier.oY + globalY; bottombarrier._x = bottombarrier.oX + globalX; bottombarrier._y = bottombarrier.oY + globalY; end._x = end.oX + globalX; end._y = end.oY + globalY; mouse.oX = mouse.oX + dx; mouse.oY = mouse.oY + dy; mouse._y = mouse._y + dy; mouse._x = mouse._x + dx; bg._x = bg._x + (dx / 3); bg._y = bg._y + (dy / 3); if (notputdown != -1) { currentRock = eval ("rock" + notputdown); currentRock._x = mouse._x; currentRock._y = mouse._y + 25; currentRock.dx = mouse.dx; currentRock.dy = mouse.dy; } onLand = false; i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (mouse._y < (currentLand._y + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = currentLand._y; onLand = true; onLandNum = i; } else if (mouse._y > (((currentLand._y + 35.5) + 25.4) + (mouse.dy * 1.2))) { mouse.dy = mouse.dy * -1; mouse._y = mouse._y + (mouse.dy * 1.5); } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } i++; } if (notputdown != -1) { currentRock = eval ("rock" + notputdown); i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (currentRock.hitTest(currentLand)) { if (currentRock._y < (currentLand._y + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = currentLand._y - 25; onLand = true; onLandNum = i; } else if (currentRock._y > (((currentLand._y + 35) + 27) + (mouse.dy * 1.2))) { mouse.dy = mouse.dy * -1; mouse._y = mouse._y + (mouse.dy * 1.5); } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } i++; } notDropRock = eval ("rock" + notputdown); i = 1; while (i <= rocks) { if (i != notputdown) { currentRock = eval ("rock" + i); if (notDropRock.hitTest(currentRock)) { if (notDropRock._y < ((currentRock._y - 25) + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = currentRock._y - 54; onLand = true; } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } } i++; } } if (mouse.hitTest(leftbarrier)) { mouse.dx = mouse.dx * -1; mouse.oX = mouse.oX + (mouse.dx * 6); } if (mouse.hitTest(rightbarrier)) { mouse.dx = mouse.dx * -1; mouse.oX = mouse.oX + (mouse.dx * 6); } if (mouse.hitTest(topbarrier)) { mouse.dy = mouse.dy * -1; mouse.oY = mouse.oY + (mouse.dy * 6); } if (mouse.hitTest(bottombarrier)) { mouse.dy = mouse.dy * -1; mouse.oY = mouse.oY + (mouse.dy * 6); } i = 0; while (i <= rocks) { currentRock = eval ("rock" + i); if (currentRock.hitTest(leftbarrier)) { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 6); } if (currentRock.hitTest(rightbarrier)) { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 6); } if (currentRock.hitTest(topbarrier)) { currentRock.dy = currentRock.dy * -1; currentRock.oY = currentRock.oY + (currentRock.dy * 6); } if (currentRock.hitTest(bottombarrier)) { currentRock.dy = currentRock.dy * -1; currentRock.oX = currentRock.oX + (currentRock.dy * 6); } i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); e = 1; while (e <= enemies) { currentEnemy = eval ("enemy" + e); if (currentRock.hitTest(currentEnemy)) { if (currentRock._y < currentEnemy._y) { if (currentRock.dy > 0) { if (playsounds) { } currentEnemy.health = currentEnemy.health - currentRock.dy; if (currentEnemy.tower == false) { currentEnemy._yscale = currentEnemy.health * 10; } else { currentEnemy._yscale = currentEnemy.health * 5; } currentEnemy.speed = 0; currentRock.dy = 0; currentRock.dx = 0; if (notputdown == i) { mouse._y = mouse._y - 5; mouse.dy = mouse.dy - 1; currentX = currentRock.oX + globalX; currentY = currentRock.oY + globalY; dx = mouse._x - currentX; dy = mouse._y - currentY; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); notputdown = -1; } if (currentEnemy.health <= 1) { if (i != notputdown) { if (playsounds) { explosionS.start(0, 1); } explosion.oX = currentEnemy.oX; explosion.oY = currentEnemy.oY; if (currentEnemy.tower == true) { explosion._yscale = 200; explosion._xscale = 100; } else { explosion._yscale = 65; explosion._xscale = 65; } explosion.gotoAndPlay(1); currentEnemy.oX = -1000; currentEnemy.oY = -1000; } else { if (playsounds) { explosionS.start(0, 1); } if (currentEnemy.tower == true) { explosion._yscale = 200; explosion._xscale = 100; } else { explosion._yscale = 65; explosion._xscale = 65; } explosion.gotoAndPlay(1); currentEnemy.oX = -1000; currentEnemy.oY = -1000; mouse._y = mouse._y - 5; mouse.dy = mouse.dy - 1; currentX = currentRock.oX + globalX; currentY = currentRock.oY + globalY; dx = mouse._x - currentX; dy = mouse._y - currentY; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); notputdown = -1; } currentEnemy.dead = true; } } } } e++; } i++; } i = 1; while (i <= rocks) { if (i != notputdown) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (mouse._y < ((currentRock._y - 25) + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = (currentRock.oY + globalY) - 26; onLand = true; } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } } i++; } i = 0; while (i <= buttons) { currentResponder = eval ("responder" + i); if (mouse.hitTest(currentResponder)) { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } i++; } pressed = false; if (Key.isDown(38)) { if (onLand) { mouse.dy = -2; mouse._y = mouse._y + mouse.dy; } else if (flightJuice > 0) { pressed = true; mouse.gotoAndStop("up"); mouse.dy = mouse.dy - thrust; flightJuice = flightJuice - 1; } } if (Key.isDown(40)) { if (onLand) { } else if (flightJuice > 0) { pressed = true; mouse.gotoAndStop("down"); mouse.dy = mouse.dy + thrust; flightJuice = flightJuice - 1; } if (mouse.hitTest(topbarrier)) { mouse._y = mouse._y + 7; } i = 0; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (currentLand._y < (mouse._y - 5)) { mouse._y = mouse._y + 7; } } i++; } } if (Key.isDown(37)) { pressed = true; if (onLand) { mouse.dx = mouse.dx - thrust; mouse.gotoAndStop("left"); } else if (flightJuice > 0) { pressed = true; mouse.dx = mouse.dx - thrust; mouse.gotoAndStop("left"); flightJuice = flightJuice - 1; } i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (i != onLandNum) { if (mouse._y > currentLand._y) { mouse._x = mouse._x - 7; } } } i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (mouse._y > (currentRock._y - 26)) { if (i != notputdown) { mouse._x = mouse._x - 7; } } } i++; } i = 0; while (i <= buttons) { currentResponder = eval ("responder" + i); if (mouse.hitTest(currentResponder)) { mouse._x = mouse._x - 7; } i++; } if (mouse.hitTest(rightbarrier)) { mouse._x = mouse._x - 7; } } else if (Key.isDown(39)) { pressed = true; if (onLand) { mouse.dx = mouse.dx + thrust; mouse.gotoAndStop("left"); } else if (flightJuice > 0) { pressed = true; mouse.dx = mouse.dx + thrust; mouse.gotoAndStop("left"); flightJuice = flightJuice - 1; } mouse.gotoAndStop("right"); i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (i != onLandNum) { if (mouse._y > currentLand._y) { mouse._x = mouse._x + 7; } } } i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (mouse._y > (currentRock._y - 26)) { if (i != notputdown) { mouse._x = mouse._x + 7; } } } i++; } i = 0; while (i <= buttons) { currentResponder = eval ("responder" + i); if (mouse.hitTest(currentResponder)) { mouse._x = mouse._x + 7; } i++; } if (mouse.hitTest(leftbarrier)) { mouse._x = mouse._x + 7; } } else if (mouse.dx < 0) { mouse.dx = mouse.dx + thrust; } else if (mouse.dx > 0) { mouse.dx = mouse.dx - thrust; } if (mouse.dx < 0.1) { if (mouse.dx > 0) { mouse.dx = 0; } } if (mouse.dx > -0.1) { if (mouse.dx < 0) { mouse.dx = 0; } } if (pressed == false) { mouse.gotoAndStop("center"); } if (pressed == true) { if (playsounds) { thrustsoundpauser++; if (thrustsoundpauser == totalforthruster) { thruster.start(0, 1); thrustsoundpauser = 0; } } } if (Key.isDown(32)) { if (donePressSpace) { donePressSpace = false; if (notputdown == -1) { i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (playsounds) { pickup.start(0, 1); } notputdown = i; dx = mouse._x - currentRock._x; dy = mouse._y - currentRock._y; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); } i++; } } else { mouse._y = mouse._y - 5; mouse.dy = mouse.dy - 1; if (playsounds) { pickup.start(0, 1); } currentRock = eval ("rock" + notputdown); currentX = currentRock.oX + globalX; currentY = currentRock.oY + globalY; dx = mouse._x - currentX; dy = mouse._y - currentY; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); notputdown = -1; } } } else { donePressSpace = true; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (i != notputdown) { currentRock.dy = currentRock.dy + gravity; currentRock.oX = currentRock.oX + currentRock.dx; currentRock.oY = currentRock.oY + currentRock.dy; } l = 1; while (l <= lands) { currentLand = eval ("land" + l); if (currentRock.hitTest(currentLand)) { if (currentRock._y < ((currentLand._y + currentRock.dy) + 0.5)) { currentRock.oY = currentLand.oY; currentRock.dy = 0; currentRock.dx = 0; } else if (currentRock._y > (currentLand._y + 25.5)) { currentRock.dy = currentRock.dy * -1; currentRock.oY = currentRock.oY + (currentRock.dy * 2); } else { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 4); } } l++; } b = 1; while (b <= rocks) { otherRock = eval ("rock" + b); if (b != i) { if (currentRock.hitTest(otherRock)) { if (currentRock.oY < otherRock.oY) { currentRock.oY = otherRock.oY - 29; currentRock.dy = 0; currentRock.dx = 0; } } } b++; } b = 0; while (b <= buttons) { currentResponder = eval ("responder" + b); if (currentRock.hitTest(currentResponder)) { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 6); } b++; } i++; } i = 1; while (i <= enemies) { currentEnemy = eval ("enemy" + i); if (currentEnemy.tower == false) { if (currentEnemy.gotoLeft == true) { if (currentEnemy.patrolPoint < currentEnemy.patrolLength) { currentEnemy.oX = currentEnemy.oX + currentEnemy.speed; currentEnemy.patrolPoint = currentEnemy.patrolPoint + currentEnemy.speed; } else { currentEnemy.gotoLeft = false; currentEnemy.gotoAndPlay("turn"); } } else if (currentEnemy.patrolPoint > 0) { currentEnemy.oX = currentEnemy.oX - currentEnemy.speed; currentEnemy.patrolPoint = currentEnemy.patrolPoint - currentEnemy.speed; } else { currentEnemy.gotoLeft = true; currentEnemy.gotoAndPlay("turn"); } } i++; } i = 0; while (i <= enemies) { currentEnemy = eval ("enemy" + i); if (mouse.hitTest(currentEnemy)) { if (currentEnemy.tower == false) { health = health - currentEnemy.damage; } } if (currentEnemy.tower == true) { currentBullet = eval ("bullet" + i); if (mouse.hitTest(currentBullet)) { health = health - currentEnemy.damage; } } i++; } i = 0; while (i <= buttons) { currentButton = eval ("button" + i); currentResponder = eval ("responder" + i); hit = false; r = 0; while (r <= rocks) { currentRock = eval ("rock" + r); if (currentButton.hitTest(currentRock)) { hit = true; if (currentButton.pressed == false) { currentButton.pressed = true; currentResponder.oX = currentResponder.oX + 10000; } } r++; } if (mousehitsbuttons == true) { if (mouse.hitTest(currentButton)) { hit = true; if (currentButton.pressed == false) { currentButton.pressed = true; currentResponder.oX = currentResponder.oX + 10000; } } } if (hit == false) { if (currentButton.pressed == true) { currentButton.pressed = false; currentResponder.oX = currentResponder.oX - 10000; currentResponder.alpha = 0; } } i++; } currentResponder.fadeOut = false; currentResponder.alpha = 100; currentResponder.speed = 6; if (mouse.hitTest(end)) { if (win == false) { level++; winS.start(0, 1); end.gotoAndPlay("win"); win = true; } } i = 0; while (i <= enemies) { currentTower = eval ("enemy" + i); if (currentTower.tower == true) { currentTop = eval ("towertop" + i); currentBullet = eval ("bullet" + i); currentTop._x = currentTower._x; currentTop._y = currentTower._y - (95 * (currentTower._yscale / 100)); currentTop._yscale = currentTower._yscale; dx = currentTop._x - mouse._x; dy = currentTop._y - mouse._y; radians = Math.atan(dy / dx); degrees = (radians * 180) / Math.PI; if (dx > 0) { degrees = degrees + 180; } radians = (degrees / 180) * Math.PI; degrees = degrees + 90; currentTop._rotation = degrees; distance = Math.sqrt((dx * dx) + (dy * dy)); currentTower.counter++; if (currentTower.counter >= currentTower.counterLimit) { currentTower.counter = 0; currentBullet.oX = currentTower.oX; currentBullet.oY = currentTower.oY - (95 * (currentTower._yscale / 100)); currentBullet.dx = Math.cos(radians) * currentTower.launchSpeed; currentBullet.dy = Math.sin(radians) * currentTower.launchSpeed; } currentBullet.oX = currentBullet.oX + currentBullet.dx; currentBullet.oY = currentBullet.oY + currentBullet.dy; } i++; } }; menu.onRelease = function () { gotoAndStop ("menu"); }; currentAlpha = 100; faderbox._alpha = currentAlpha; fadeOut = function () { if (loading == true) { faderbox.gotoAndStop("blue"); } if (loading == false) { faderbox.gotoAndStop("red"); } currentAlpha = currentAlpha + speed; if (currentAlpha >= 100) { currentAlpha = 100; if (loading == true) { gotoAndStop ("loading"); } if (loading == false) { gotoAndStop ("lose"); } } faderbox._x = 0; faderbox._y = 0; faderbox._alpha = currentAlpha; }; fadeIn = function () { faderbox.gotoAndStop("blue"); currentAlpha = currentAlpha - speed; if (currentAlpha <= 0) { currentAlpha = 0; faderbox._x = -10000; faderbox._y = -10000; } faderbox._alpha = currentAlpha; if (health < topHealth) { faderbox.gotoAndStop("red"); faderbox._x = 0; faderbox._y = 0; faderbox._alpha = (100 - (health * healthMultiplier)) - 20; if (faderbox._alpha < 0) { faderbox._alpha = 0; } currentAlpha = faderbox._alpha; } };
Frame 97
lands = 12; total = 0; rocks = 6; objects = 5; buttons = 3; enemies = 8; notputdown = -1; health = topHealth; healthMultiplier = 100 / health; flightJuice = topFlightJuice; flightMultiplier = 100 / flightJuice; mouse.maxWidth = 62.1; landWidth = 188; onLandNum = 0; globalX = 0; globalY = 0; win = false; mousehitsbuttons = false; topsmoke = 5; smoke = 0; thrustsoundpauser = 0; totalforthruster = 4; fadein = true; loading = true; stop(); mouse = eval (type); mouse._x = startX._x; mouse._y = startX._y; startX._x = -100; startX._y = -100; mouse.dy = 0; mouse.dx = 0; mouse.oX = mouse._x; mouse.oY = mouse._y; explosion.oX = -10000; explosion.oY = -10000; leftbarrier.oX = leftbarrier._x; leftbarrier.oY = leftbarrier._y; rightbarrier.oX = rightbarrier._x; rightbarrier.oY = rightbarrier._y; topbarrier.oX = topbarrier._x; topbarrier.oY = topbarrier._y; bottombarrier.oX = bottombarrier._x; bottombarrier.oY = bottombarrier._y; end.oX = end._x; end.oY = end._y; enemy1.tower = false; enemy2.tower = false; enemy3.tower = false; enemy4.tower = false; enemy5.tower = true; enemy6.tower = true; enemy7.tower = true; enemy8.tower = true; i = 0; while (i <= objects) { currentObject = eval ("object" + i); currentObject.oX = currentObject._x; currentObject.oY = currentObject._y; i++; } enemy1.gotoLeft = true; i = 1; while (i <= enemies) { currentEnemy = eval ("enemy" + i); currentEnemy.health = 8; currentEnemy.speed = 2; firstFlag = eval ("firstPatrolMarker" + i); secondFlag = eval ("secondPatrolMarker" + i); currentEnemy.patrolLength = secondFlag._x - firstFlag._x; currentEnemy.patrolPoint = currentEnemy._x - firstFlag._x; firstFlag._x = -100; secondFlag._x = -100; currentEnemy.damage = 1; currentEnemy.oX = currentEnemy._x; currentEnemy.oY = currentEnemy._y; currentEnemy.dead = false; currentEnemy.gotoLeft = true; i++; } i = 0; while (i <= enemies) { currentEnemy = eval ("enemy" + i); if (currentEnemy.tower == true) { currentEnemy.counter = 0; currentEnemy.counterLimit = 60; currentEnemy.launchSpeed = 2; currentEnemy.health = 20; } i++; } i = 0; while (i <= buttons) { currentButton = eval ("button" + i); currentButton.pressed = false; currentButton.oX = currentButton._x; currentButton.oY = currentButton._y; currentResponder = eval ("responder" + i); currentResponder.oX = currentResponder._x; currentResponder.oY = currentResponder._y; currentResponder.fadeOut = false; currentResponder.alpha = 100; currentResponder.speed = 6; i++; } i = 0; while (i <= rocks) { currentRock = eval ("rock" + i); currentRock.oX = currentRock._x; currentRock.oY = currentRock._y; currentRock.dx = 0; currentRock.dy = 0; currentRock.originX = currentRock._x; currentRock.originY = currentRock._y; i++; } i = 0; while (i <= lands) { currentLand = eval ("land" + i); currentLand.oX = currentLand._x; currentLand.oY = currentLand._y; i++; } mouse.onEnterFrame = function () { if (fadein == true) { fadeIn(); } else { fadeOut(); } mouse.dy = mouse.dy + gravity; mouse._y = mouse._y + mouse.dy; mouse._x = mouse._x + mouse.dx; healthbar._xscale = health * healthMultiplier; if (flightJuice > 0) { flightbar._xscale = flightJuice * flightMultiplier; } if (health <= 0) { fadein = false; loading = false; } if (health < topHealth) { health = health + (regenerateRate / 5); } if (flightJuice < topFlightJuice) { flightJuice = flightJuice + regenerateRate; } dx = (Stage.width / 2) - mouse._x; dy = (Stage.width / 2) - mouse._y; dx = dx / 4; dy = dy / 4; if (mouse.dx > topspeed) { mouse.dx = topspeed; } if (mouse.dx < (-topspeed)) { mouse.dx = -topspeed; } if (mouse.dy > topspeed) { mouse.dy = topspeed; } if (mouse.dy < (-topspeed)) { mouse.dy = -topspeed; } globalX = globalX + dx; globalY = globalY + dy; i = 1; while (i <= lands) { currentLand = eval ("land" + i); currentLand._x = currentLand.oX + globalX; currentLand._y = currentLand.oY + globalY; i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); currentRock._x = currentRock.oX + globalX; currentRock._y = currentRock.oY + globalY; i++; } i = 1; while (i <= enemies) { currentEnemy = eval ("enemy" + i); currentEnemy._x = currentEnemy.oX + globalX; currentEnemy._y = currentEnemy.oY + globalY; if (currentEnemy.tower) { currentBullet = eval ("bullet" + i); currentBullet._x = currentBullet.oX + globalX; currentBullet._y = currentBullet.oY + globalY; } i++; } explosion._x = explosion.oX + globalX; explosion._y = explosion.oY + globalY; i = 0; while (i <= buttons) { currentButton = eval ("button" + i); currentResponder = eval ("responder" + i); currentButton._x = currentButton.oX + globalX; currentButton._y = currentButton.oY + globalY; currentResponder._x = currentResponder.oX + globalX; currentResponder._y = currentResponder.oY + globalY; i++; } i = 0; while (i <= objects) { currentObject = eval ("object" + i); currentObject._x = currentObject.oX + globalX; currentObject._y = currentObject.oY + globalY; i++; } leftbarrier._x = leftbarrier.oX + globalX; leftbarrier._y = leftbarrier.oY + globalY; rightbarrier._x = rightbarrier.oX + globalX; rightbarrier._y = rightbarrier.oY + globalY; topbarrier._x = topbarrier.oX + globalX; topbarrier._y = topbarrier.oY + globalY; bottombarrier._x = bottombarrier.oX + globalX; bottombarrier._y = bottombarrier.oY + globalY; end._x = end.oX + globalX; end._y = end.oY + globalY; mouse.oX = mouse.oX + dx; mouse.oY = mouse.oY + dy; mouse._y = mouse._y + dy; mouse._x = mouse._x + dx; bg._x = bg._x + (dx / 3); bg._y = bg._y + (dy / 3); if (notputdown != -1) { currentRock = eval ("rock" + notputdown); currentRock._x = mouse._x; currentRock._y = mouse._y + 25; currentRock.dx = mouse.dx; currentRock.dy = mouse.dy; } onLand = false; i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (mouse._y < (currentLand._y + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = currentLand._y; onLand = true; onLandNum = i; } else if (mouse._y > (((currentLand._y + 35.5) + 25.4) + (mouse.dy * 1.2))) { mouse.dy = mouse.dy * -1; mouse._y = mouse._y + (mouse.dy * 1.5); } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } i++; } if (notputdown != -1) { currentRock = eval ("rock" + notputdown); i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (currentRock.hitTest(currentLand)) { if (currentRock._y < (currentLand._y + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = currentLand._y - 25; onLand = true; onLandNum = i; } else if (currentRock._y > (((currentLand._y + 35) + 27) + (mouse.dy * 1.2))) { mouse.dy = mouse.dy * -1; mouse._y = mouse._y + (mouse.dy * 1.5); } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } i++; } notDropRock = eval ("rock" + notputdown); i = 1; while (i <= rocks) { if (i != notputdown) { currentRock = eval ("rock" + i); if (notDropRock.hitTest(currentRock)) { if (notDropRock._y < ((currentRock._y - 25) + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = currentRock._y - 54; onLand = true; } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } } i++; } } if (mouse.hitTest(leftbarrier)) { mouse.dx = mouse.dx * -1; mouse.oX = mouse.oX + (mouse.dx * 6); } if (mouse.hitTest(rightbarrier)) { mouse.dx = mouse.dx * -1; mouse.oX = mouse.oX + (mouse.dx * 6); } if (mouse.hitTest(topbarrier)) { mouse.dy = mouse.dy * -1; mouse.oY = mouse.oY + (mouse.dy * 6); } if (mouse.hitTest(bottombarrier)) { mouse.dy = mouse.dy * -1; mouse.oY = mouse.oY + (mouse.dy * 6); } i = 0; while (i <= rocks) { currentRock = eval ("rock" + i); if (currentRock.hitTest(leftbarrier)) { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 6); } if (currentRock.hitTest(rightbarrier)) { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 6); } if (currentRock.hitTest(topbarrier)) { currentRock.dy = currentRock.dy * -1; currentRock.oY = currentRock.oY + (currentRock.dy * 6); } if (currentRock.hitTest(bottombarrier)) { currentRock.dy = currentRock.dy * -1; currentRock.oX = currentRock.oX + (currentRock.dy * 6); } i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); e = 1; while (e <= enemies) { currentEnemy = eval ("enemy" + e); if (currentRock.hitTest(currentEnemy)) { if (currentRock._y < currentEnemy._y) { if (currentRock.dy > 0) { if (playsounds) { } currentEnemy.health = currentEnemy.health - currentRock.dy; if (currentEnemy.tower == false) { currentEnemy._yscale = currentEnemy.health * 10; } else { currentEnemy._yscale = currentEnemy.health * 5; } currentEnemy.speed = 0; currentRock.dy = 0; currentRock.dx = 0; if (notputdown == i) { mouse._y = mouse._y - 5; mouse.dy = mouse.dy - 1; currentX = currentRock.oX + globalX; currentY = currentRock.oY + globalY; dx = mouse._x - currentX; dy = mouse._y - currentY; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); notputdown = -1; } if (currentEnemy.health <= 1) { if (i != notputdown) { if (playsounds) { explosionS.start(0, 1); } explosion.oX = currentEnemy.oX; explosion.oY = currentEnemy.oY; if (currentEnemy.tower == true) { explosion._yscale = 200; explosion._xscale = 100; } else { explosion._yscale = 65; explosion._xscale = 65; } explosion.gotoAndPlay(1); currentEnemy.oX = -1000; currentEnemy.oY = -1000; } else { if (playsounds) { explosionS.start(0, 1); } if (currentEnemy.tower == true) { explosion._yscale = 200; explosion._xscale = 100; } else { explosion._yscale = 65; explosion._xscale = 65; } explosion.gotoAndPlay(1); currentEnemy.oX = -1000; currentEnemy.oY = -1000; mouse._y = mouse._y - 5; mouse.dy = mouse.dy - 1; currentX = currentRock.oX + globalX; currentY = currentRock.oY + globalY; dx = mouse._x - currentX; dy = mouse._y - currentY; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); notputdown = -1; } currentEnemy.dead = true; } } } } e++; } i++; } i = 1; while (i <= rocks) { if (i != notputdown) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (mouse._y < ((currentRock._y - 25) + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = (currentRock.oY + globalY) - 26; onLand = true; } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } } i++; } i = 0; while (i <= buttons) { currentResponder = eval ("responder" + i); if (mouse.hitTest(currentResponder)) { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } i++; } pressed = false; if (Key.isDown(38)) { if (onLand) { mouse.dy = -2; mouse._y = mouse._y + mouse.dy; } else if (flightJuice > 0) { pressed = true; mouse.gotoAndStop("up"); mouse.dy = mouse.dy - thrust; flightJuice = flightJuice - 1; } } if (Key.isDown(40)) { if (onLand) { } else if (flightJuice > 0) { pressed = true; mouse.gotoAndStop("down"); mouse.dy = mouse.dy + thrust; flightJuice = flightJuice - 1; } if (mouse.hitTest(topbarrier)) { mouse._y = mouse._y + 7; } i = 0; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (currentLand._y < (mouse._y - 5)) { mouse._y = mouse._y + 7; } } i++; } } if (Key.isDown(37)) { pressed = true; if (onLand) { mouse.dx = mouse.dx - thrust; mouse.gotoAndStop("left"); } else if (flightJuice > 0) { pressed = true; mouse.dx = mouse.dx - thrust; mouse.gotoAndStop("left"); flightJuice = flightJuice - 1; } i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (i != onLandNum) { if (mouse._y > currentLand._y) { mouse._x = mouse._x - 7; } } } i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (mouse._y > (currentRock._y - 26)) { if (i != notputdown) { mouse._x = mouse._x - 7; } } } i++; } i = 0; while (i <= buttons) { currentResponder = eval ("responder" + i); if (mouse.hitTest(currentResponder)) { mouse._x = mouse._x - 7; } i++; } if (mouse.hitTest(rightbarrier)) { mouse._x = mouse._x - 7; } } else if (Key.isDown(39)) { pressed = true; if (onLand) { mouse.dx = mouse.dx + thrust; mouse.gotoAndStop("left"); } else if (flightJuice > 0) { pressed = true; mouse.dx = mouse.dx + thrust; mouse.gotoAndStop("left"); flightJuice = flightJuice - 1; } mouse.gotoAndStop("right"); i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (i != onLandNum) { if (mouse._y > currentLand._y) { mouse._x = mouse._x + 7; } } } i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (mouse._y > (currentRock._y - 26)) { if (i != notputdown) { mouse._x = mouse._x + 7; } } } i++; } i = 0; while (i <= buttons) { currentResponder = eval ("responder" + i); if (mouse.hitTest(currentResponder)) { mouse._x = mouse._x + 7; } i++; } if (mouse.hitTest(leftbarrier)) { mouse._x = mouse._x + 7; } } else if (mouse.dx < 0) { mouse.dx = mouse.dx + thrust; } else if (mouse.dx > 0) { mouse.dx = mouse.dx - thrust; } if (mouse.dx < 0.1) { if (mouse.dx > 0) { mouse.dx = 0; } } if (mouse.dx > -0.1) { if (mouse.dx < 0) { mouse.dx = 0; } } if (pressed == false) { mouse.gotoAndStop("center"); } if (pressed == true) { if (playsounds) { thrustsoundpauser++; if (thrustsoundpauser == totalforthruster) { thruster.start(0, 1); thrustsoundpauser = 0; } } } if (Key.isDown(32)) { if (donePressSpace) { donePressSpace = false; if (notputdown == -1) { i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (playsounds) { pickup.start(0, 1); } notputdown = i; dx = mouse._x - currentRock._x; dy = mouse._y - currentRock._y; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); } i++; } } else { mouse._y = mouse._y - 5; mouse.dy = mouse.dy - 1; if (playsounds) { pickup.start(0, 1); } currentRock = eval ("rock" + notputdown); currentX = currentRock.oX + globalX; currentY = currentRock.oY + globalY; dx = mouse._x - currentX; dy = mouse._y - currentY; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); notputdown = -1; } } } else { donePressSpace = true; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (i != notputdown) { currentRock.dy = currentRock.dy + gravity; currentRock.oX = currentRock.oX + currentRock.dx; currentRock.oY = currentRock.oY + currentRock.dy; } l = 1; while (l <= lands) { currentLand = eval ("land" + l); if (currentRock.hitTest(currentLand)) { if (currentRock._y < ((currentLand._y + currentRock.dy) + 0.5)) { currentRock.oY = currentLand.oY; currentRock.dy = 0; currentRock.dx = 0; } else if (currentRock._y > (currentLand._y + 25.5)) { currentRock.dy = currentRock.dy * -1; currentRock.oY = currentRock.oY + (currentRock.dy * 2); } else { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 4); } } l++; } b = 1; while (b <= rocks) { otherRock = eval ("rock" + b); if (b != i) { if (currentRock.hitTest(otherRock)) { if (currentRock.oY < otherRock.oY) { currentRock.oY = otherRock.oY - 29; currentRock.dy = 0; currentRock.dx = 0; } } } b++; } b = 0; while (b <= buttons) { currentResponder = eval ("responder" + b); if (currentRock.hitTest(currentResponder)) { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 6); } b++; } i++; } i = 1; while (i <= enemies) { currentEnemy = eval ("enemy" + i); if (currentEnemy.tower == false) { if (currentEnemy.gotoLeft == true) { if (currentEnemy.patrolPoint < currentEnemy.patrolLength) { currentEnemy.oX = currentEnemy.oX + currentEnemy.speed; currentEnemy.patrolPoint = currentEnemy.patrolPoint + currentEnemy.speed; } else { currentEnemy.gotoLeft = false; currentEnemy.gotoAndPlay("turn"); } } else if (currentEnemy.patrolPoint > 0) { currentEnemy.oX = currentEnemy.oX - currentEnemy.speed; currentEnemy.patrolPoint = currentEnemy.patrolPoint - currentEnemy.speed; } else { currentEnemy.gotoLeft = true; currentEnemy.gotoAndPlay("turn"); } } i++; } i = 0; while (i <= enemies) { currentEnemy = eval ("enemy" + i); if (mouse.hitTest(currentEnemy)) { if (currentEnemy.tower == false) { health = health - currentEnemy.damage; } } if (currentEnemy.tower == true) { currentBullet = eval ("bullet" + i); if (mouse.hitTest(currentBullet)) { health = health - currentEnemy.damage; } } i++; } i = 0; while (i <= buttons) { currentButton = eval ("button" + i); currentResponder = eval ("responder" + i); hit = false; r = 0; while (r <= rocks) { currentRock = eval ("rock" + r); if (currentButton.hitTest(currentRock)) { hit = true; if (currentButton.pressed == false) { currentButton.pressed = true; currentResponder.oX = currentResponder.oX + 10000; } } r++; } if (mousehitsbuttons == true) { if (mouse.hitTest(currentButton)) { hit = true; if (currentButton.pressed == false) { currentButton.pressed = true; currentResponder.oX = currentResponder.oX + 10000; } } } if (hit == false) { if (currentButton.pressed == true) { currentButton.pressed = false; currentResponder.oX = currentResponder.oX - 10000; currentResponder.alpha = 0; } } i++; } currentResponder.fadeOut = false; currentResponder.alpha = 100; currentResponder.speed = 6; if (mouse.hitTest(end)) { if (win == false) { level++; winS.start(0, 1); end.gotoAndPlay("win"); win = true; } } i = 0; while (i <= enemies) { currentTower = eval ("enemy" + i); if (currentTower.tower == true) { currentTop = eval ("towertop" + i); currentBullet = eval ("bullet" + i); currentTop._x = currentTower._x; currentTop._y = currentTower._y - (95 * (currentTower._yscale / 100)); currentTop._yscale = currentTower._yscale; dx = currentTop._x - mouse._x; dy = currentTop._y - mouse._y; radians = Math.atan(dy / dx); degrees = (radians * 180) / Math.PI; if (dx > 0) { degrees = degrees + 180; } radians = (degrees / 180) * Math.PI; degrees = degrees + 90; currentTop._rotation = degrees; distance = Math.sqrt((dx * dx) + (dy * dy)); currentTower.counter++; if (currentTower.counter >= currentTower.counterLimit) { currentTower.counter = 0; currentBullet.oX = currentTower.oX; currentBullet.oY = currentTower.oY - (95 * (currentTower._yscale / 100)); currentBullet.dx = Math.cos(radians) * currentTower.launchSpeed; currentBullet.dy = Math.sin(radians) * currentTower.launchSpeed; } currentBullet.oX = currentBullet.oX + currentBullet.dx; currentBullet.oY = currentBullet.oY + currentBullet.dy; } i++; } }; menu.onRelease = function () { gotoAndStop ("menu"); }; currentAlpha = 100; faderbox._alpha = currentAlpha; fadeOut = function () { if (loading == true) { faderbox.gotoAndStop("blue"); } if (loading == false) { faderbox.gotoAndStop("red"); } currentAlpha = currentAlpha + speed; if (currentAlpha >= 100) { currentAlpha = 100; if (loading == true) { gotoAndStop ("loading"); } if (loading == false) { gotoAndStop ("lose"); } } faderbox._x = 0; faderbox._y = 0; faderbox._alpha = currentAlpha; }; fadeIn = function () { faderbox.gotoAndStop("blue"); currentAlpha = currentAlpha - speed; if (currentAlpha <= 0) { currentAlpha = 0; faderbox._x = -10000; faderbox._y = -10000; } faderbox._alpha = currentAlpha; if (health < topHealth) { faderbox.gotoAndStop("red"); faderbox._x = 0; faderbox._y = 0; faderbox._alpha = (100 - (health * healthMultiplier)) - 20; if (faderbox._alpha < 0) { faderbox._alpha = 0; } currentAlpha = faderbox._alpha; } };
Frame 98
lands = 12; total = 0; rocks = 6; objects = 5; buttons = 3; enemies = 8; notputdown = -1; health = topHealth; healthMultiplier = 100 / health; flightJuice = topFlightJuice; flightMultiplier = 100 / flightJuice; mouse.maxWidth = 62.1; landWidth = 188; onLandNum = 0; globalX = 0; globalY = 0; win = false; mousehitsbuttons = false; topsmoke = 5; smoke = 0; thrustsoundpauser = 0; totalforthruster = 4; fadein = true; loading = true; stop(); mouse = eval (type); mouse._x = startX._x; mouse._y = startX._y; startX._x = -100; startX._y = -100; mouse.dy = 0; mouse.dx = 0; mouse.oX = mouse._x; mouse.oY = mouse._y; explosion.oX = -10000; explosion.oY = -10000; leftbarrier.oX = leftbarrier._x; leftbarrier.oY = leftbarrier._y; rightbarrier.oX = rightbarrier._x; rightbarrier.oY = rightbarrier._y; topbarrier.oX = topbarrier._x; topbarrier.oY = topbarrier._y; bottombarrier.oX = bottombarrier._x; bottombarrier.oY = bottombarrier._y; end.oX = end._x; end.oY = end._y; enemy1.tower = false; enemy2.tower = false; enemy3.tower = false; enemy4.tower = false; enemy5.tower = true; enemy6.tower = true; enemy7.tower = true; enemy8.tower = true; i = 0; while (i <= objects) { currentObject = eval ("object" + i); currentObject.oX = currentObject._x; currentObject.oY = currentObject._y; i++; } enemy1.gotoLeft = true; i = 1; while (i <= enemies) { currentEnemy = eval ("enemy" + i); currentEnemy.health = 8; currentEnemy.speed = 2; firstFlag = eval ("firstPatrolMarker" + i); secondFlag = eval ("secondPatrolMarker" + i); currentEnemy.patrolLength = secondFlag._x - firstFlag._x; currentEnemy.patrolPoint = currentEnemy._x - firstFlag._x; firstFlag._x = -100; secondFlag._x = -100; currentEnemy.damage = 1; currentEnemy.oX = currentEnemy._x; currentEnemy.oY = currentEnemy._y; currentEnemy.dead = false; currentEnemy.gotoLeft = true; i++; } i = 0; while (i <= enemies) { currentEnemy = eval ("enemy" + i); if (currentEnemy.tower == true) { currentEnemy.counter = 0; currentEnemy.counterLimit = 60; currentEnemy.launchSpeed = 2; currentEnemy.health = 20; } i++; } i = 0; while (i <= buttons) { currentButton = eval ("button" + i); currentButton.pressed = false; currentButton.oX = currentButton._x; currentButton.oY = currentButton._y; currentResponder = eval ("responder" + i); currentResponder.oX = currentResponder._x; currentResponder.oY = currentResponder._y; currentResponder.fadeOut = false; currentResponder.alpha = 100; currentResponder.speed = 6; i++; } i = 0; while (i <= rocks) { currentRock = eval ("rock" + i); currentRock.oX = currentRock._x; currentRock.oY = currentRock._y; currentRock.dx = 0; currentRock.dy = 0; currentRock.originX = currentRock._x; currentRock.originY = currentRock._y; i++; } i = 0; while (i <= lands) { currentLand = eval ("land" + i); currentLand.oX = currentLand._x; currentLand.oY = currentLand._y; i++; } mouse.onEnterFrame = function () { if (fadein == true) { fadeIn(); } else { fadeOut(); } mouse.dy = mouse.dy + gravity; mouse._y = mouse._y + mouse.dy; mouse._x = mouse._x + mouse.dx; healthbar._xscale = health * healthMultiplier; if (flightJuice > 0) { flightbar._xscale = flightJuice * flightMultiplier; } if (health <= 0) { fadein = false; loading = false; } if (health < topHealth) { health = health + (regenerateRate / 5); } if (flightJuice < topFlightJuice) { flightJuice = flightJuice + regenerateRate; } dx = (Stage.width / 2) - mouse._x; dy = (Stage.width / 2) - mouse._y; dx = dx / 4; dy = dy / 4; if (mouse.dx > topspeed) { mouse.dx = topspeed; } if (mouse.dx < (-topspeed)) { mouse.dx = -topspeed; } if (mouse.dy > topspeed) { mouse.dy = topspeed; } if (mouse.dy < (-topspeed)) { mouse.dy = -topspeed; } globalX = globalX + dx; globalY = globalY + dy; i = 1; while (i <= lands) { currentLand = eval ("land" + i); currentLand._x = currentLand.oX + globalX; currentLand._y = currentLand.oY + globalY; i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); currentRock._x = currentRock.oX + globalX; currentRock._y = currentRock.oY + globalY; i++; } i = 1; while (i <= enemies) { currentEnemy = eval ("enemy" + i); currentEnemy._x = currentEnemy.oX + globalX; currentEnemy._y = currentEnemy.oY + globalY; if (currentEnemy.tower) { currentBullet = eval ("bullet" + i); currentBullet._x = currentBullet.oX + globalX; currentBullet._y = currentBullet.oY + globalY; } i++; } explosion._x = explosion.oX + globalX; explosion._y = explosion.oY + globalY; i = 0; while (i <= buttons) { currentButton = eval ("button" + i); currentResponder = eval ("responder" + i); currentButton._x = currentButton.oX + globalX; currentButton._y = currentButton.oY + globalY; currentResponder._x = currentResponder.oX + globalX; currentResponder._y = currentResponder.oY + globalY; i++; } i = 0; while (i <= objects) { currentObject = eval ("object" + i); currentObject._x = currentObject.oX + globalX; currentObject._y = currentObject.oY + globalY; i++; } leftbarrier._x = leftbarrier.oX + globalX; leftbarrier._y = leftbarrier.oY + globalY; rightbarrier._x = rightbarrier.oX + globalX; rightbarrier._y = rightbarrier.oY + globalY; topbarrier._x = topbarrier.oX + globalX; topbarrier._y = topbarrier.oY + globalY; bottombarrier._x = bottombarrier.oX + globalX; bottombarrier._y = bottombarrier.oY + globalY; end._x = end.oX + globalX; end._y = end.oY + globalY; mouse.oX = mouse.oX + dx; mouse.oY = mouse.oY + dy; mouse._y = mouse._y + dy; mouse._x = mouse._x + dx; bg._x = bg._x + (dx / 3); bg._y = bg._y + (dy / 3); if (notputdown != -1) { currentRock = eval ("rock" + notputdown); currentRock._x = mouse._x; currentRock._y = mouse._y + 25; currentRock.dx = mouse.dx; currentRock.dy = mouse.dy; } onLand = false; i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (mouse._y < (currentLand._y + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = currentLand._y; onLand = true; onLandNum = i; } else if (mouse._y > (((currentLand._y + 35.5) + 25.4) + (mouse.dy * 1.2))) { mouse.dy = mouse.dy * -1; mouse._y = mouse._y + (mouse.dy * 1.5); } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } i++; } if (notputdown != -1) { currentRock = eval ("rock" + notputdown); i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (currentRock.hitTest(currentLand)) { if (currentRock._y < (currentLand._y + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = currentLand._y - 25; onLand = true; onLandNum = i; } else if (currentRock._y > (((currentLand._y + 35) + 27) + (mouse.dy * 1.2))) { mouse.dy = mouse.dy * -1; mouse._y = mouse._y + (mouse.dy * 1.5); } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } i++; } notDropRock = eval ("rock" + notputdown); i = 1; while (i <= rocks) { if (i != notputdown) { currentRock = eval ("rock" + i); if (notDropRock.hitTest(currentRock)) { if (notDropRock._y < ((currentRock._y - 25) + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = currentRock._y - 54; onLand = true; } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } } i++; } } if (mouse.hitTest(leftbarrier)) { mouse.dx = mouse.dx * -1; mouse.oX = mouse.oX + (mouse.dx * 6); } if (mouse.hitTest(rightbarrier)) { mouse.dx = mouse.dx * -1; mouse.oX = mouse.oX + (mouse.dx * 6); } if (mouse.hitTest(topbarrier)) { mouse.dy = mouse.dy * -1; mouse.oY = mouse.oY + (mouse.dy * 6); } if (mouse.hitTest(bottombarrier)) { mouse.dy = mouse.dy * -1; mouse.oY = mouse.oY + (mouse.dy * 6); } i = 0; while (i <= rocks) { currentRock = eval ("rock" + i); if (currentRock.hitTest(leftbarrier)) { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 6); } if (currentRock.hitTest(rightbarrier)) { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 6); } if (currentRock.hitTest(topbarrier)) { currentRock.dy = currentRock.dy * -1; currentRock.oY = currentRock.oY + (currentRock.dy * 6); } if (currentRock.hitTest(bottombarrier)) { currentRock.dy = currentRock.dy * -1; currentRock.oX = currentRock.oX + (currentRock.dy * 6); } i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); e = 1; while (e <= enemies) { currentEnemy = eval ("enemy" + e); if (currentRock.hitTest(currentEnemy)) { if (currentRock._y < currentEnemy._y) { if (currentRock.dy > 0) { if (playsounds) { } currentEnemy.health = currentEnemy.health - currentRock.dy; if (currentEnemy.tower == false) { currentEnemy._yscale = currentEnemy.health * 10; } else { currentEnemy._yscale = currentEnemy.health * 5; } currentEnemy.speed = 0; currentRock.dy = 0; currentRock.dx = 0; if (notputdown == i) { mouse._y = mouse._y - 5; mouse.dy = mouse.dy - 1; currentX = currentRock.oX + globalX; currentY = currentRock.oY + globalY; dx = mouse._x - currentX; dy = mouse._y - currentY; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); notputdown = -1; } if (currentEnemy.health <= 1) { if (i != notputdown) { if (playsounds) { explosionS.start(0, 1); } explosion.oX = currentEnemy.oX; explosion.oY = currentEnemy.oY; if (currentEnemy.tower == true) { explosion._yscale = 200; explosion._xscale = 100; } else { explosion._yscale = 65; explosion._xscale = 65; } explosion.gotoAndPlay(1); currentEnemy.oX = -1000; currentEnemy.oY = -1000; } else { if (playsounds) { explosionS.start(0, 1); } if (currentEnemy.tower == true) { explosion._yscale = 200; explosion._xscale = 100; } else { explosion._yscale = 65; explosion._xscale = 65; } explosion.gotoAndPlay(1); currentEnemy.oX = -1000; currentEnemy.oY = -1000; mouse._y = mouse._y - 5; mouse.dy = mouse.dy - 1; currentX = currentRock.oX + globalX; currentY = currentRock.oY + globalY; dx = mouse._x - currentX; dy = mouse._y - currentY; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); notputdown = -1; } currentEnemy.dead = true; } } } } e++; } i++; } i = 1; while (i <= rocks) { if (i != notputdown) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (mouse._y < ((currentRock._y - 25) + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = (currentRock.oY + globalY) - 26; onLand = true; } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } } i++; } i = 0; while (i <= buttons) { currentResponder = eval ("responder" + i); if (mouse.hitTest(currentResponder)) { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } i++; } pressed = false; if (Key.isDown(38)) { if (onLand) { mouse.dy = -2; mouse._y = mouse._y + mouse.dy; } else if (flightJuice > 0) { pressed = true; mouse.gotoAndStop("up"); mouse.dy = mouse.dy - thrust; flightJuice = flightJuice - 1; } } if (Key.isDown(40)) { if (onLand) { } else if (flightJuice > 0) { pressed = true; mouse.gotoAndStop("down"); mouse.dy = mouse.dy + thrust; flightJuice = flightJuice - 1; } if (mouse.hitTest(topbarrier)) { mouse._y = mouse._y + 7; } i = 0; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (currentLand._y < (mouse._y - 5)) { mouse._y = mouse._y + 7; } } i++; } } if (Key.isDown(37)) { pressed = true; if (onLand) { mouse.dx = mouse.dx - thrust; mouse.gotoAndStop("left"); } else if (flightJuice > 0) { pressed = true; mouse.dx = mouse.dx - thrust; mouse.gotoAndStop("left"); flightJuice = flightJuice - 1; } i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (i != onLandNum) { if (mouse._y > currentLand._y) { mouse._x = mouse._x - 7; } } } i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (mouse._y > (currentRock._y - 26)) { if (i != notputdown) { mouse._x = mouse._x - 7; } } } i++; } i = 0; while (i <= buttons) { currentResponder = eval ("responder" + i); if (mouse.hitTest(currentResponder)) { mouse._x = mouse._x - 7; } i++; } if (mouse.hitTest(rightbarrier)) { mouse._x = mouse._x - 7; } } else if (Key.isDown(39)) { pressed = true; if (onLand) { mouse.dx = mouse.dx + thrust; mouse.gotoAndStop("left"); } else if (flightJuice > 0) { pressed = true; mouse.dx = mouse.dx + thrust; mouse.gotoAndStop("left"); flightJuice = flightJuice - 1; } mouse.gotoAndStop("right"); i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (i != onLandNum) { if (mouse._y > currentLand._y) { mouse._x = mouse._x + 7; } } } i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (mouse._y > (currentRock._y - 26)) { if (i != notputdown) { mouse._x = mouse._x + 7; } } } i++; } i = 0; while (i <= buttons) { currentResponder = eval ("responder" + i); if (mouse.hitTest(currentResponder)) { mouse._x = mouse._x + 7; } i++; } if (mouse.hitTest(leftbarrier)) { mouse._x = mouse._x + 7; } } else if (mouse.dx < 0) { mouse.dx = mouse.dx + thrust; } else if (mouse.dx > 0) { mouse.dx = mouse.dx - thrust; } if (mouse.dx < 0.1) { if (mouse.dx > 0) { mouse.dx = 0; } } if (mouse.dx > -0.1) { if (mouse.dx < 0) { mouse.dx = 0; } } if (pressed == false) { mouse.gotoAndStop("center"); } if (pressed == true) { if (playsounds) { thrustsoundpauser++; if (thrustsoundpauser == totalforthruster) { thruster.start(0, 1); thrustsoundpauser = 0; } } } if (Key.isDown(32)) { if (donePressSpace) { donePressSpace = false; if (notputdown == -1) { i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (playsounds) { pickup.start(0, 1); } notputdown = i; dx = mouse._x - currentRock._x; dy = mouse._y - currentRock._y; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); } i++; } } else { mouse._y = mouse._y - 5; mouse.dy = mouse.dy - 1; if (playsounds) { pickup.start(0, 1); } currentRock = eval ("rock" + notputdown); currentX = currentRock.oX + globalX; currentY = currentRock.oY + globalY; dx = mouse._x - currentX; dy = mouse._y - currentY; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); notputdown = -1; } } } else { donePressSpace = true; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (i != notputdown) { currentRock.dy = currentRock.dy + gravity; currentRock.oX = currentRock.oX + currentRock.dx; currentRock.oY = currentRock.oY + currentRock.dy; } l = 1; while (l <= lands) { currentLand = eval ("land" + l); if (currentRock.hitTest(currentLand)) { if (currentRock._y < ((currentLand._y + currentRock.dy) + 0.5)) { currentRock.oY = currentLand.oY; currentRock.dy = 0; currentRock.dx = 0; } else if (currentRock._y > (currentLand._y + 25.5)) { currentRock.dy = currentRock.dy * -1; currentRock.oY = currentRock.oY + (currentRock.dy * 2); } else { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 4); } } l++; } b = 1; while (b <= rocks) { otherRock = eval ("rock" + b); if (b != i) { if (currentRock.hitTest(otherRock)) { if (currentRock.oY < otherRock.oY) { currentRock.oY = otherRock.oY - 29; currentRock.dy = 0; currentRock.dx = 0; } } } b++; } b = 0; while (b <= buttons) { currentResponder = eval ("responder" + b); if (currentRock.hitTest(currentResponder)) { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 6); } b++; } i++; } i = 1; while (i <= enemies) { currentEnemy = eval ("enemy" + i); if (currentEnemy.tower == false) { if (currentEnemy.gotoLeft == true) { if (currentEnemy.patrolPoint < currentEnemy.patrolLength) { currentEnemy.oX = currentEnemy.oX + currentEnemy.speed; currentEnemy.patrolPoint = currentEnemy.patrolPoint + currentEnemy.speed; } else { currentEnemy.gotoLeft = false; currentEnemy.gotoAndPlay("turn"); } } else if (currentEnemy.patrolPoint > 0) { currentEnemy.oX = currentEnemy.oX - currentEnemy.speed; currentEnemy.patrolPoint = currentEnemy.patrolPoint - currentEnemy.speed; } else { currentEnemy.gotoLeft = true; currentEnemy.gotoAndPlay("turn"); } } i++; } i = 0; while (i <= enemies) { currentEnemy = eval ("enemy" + i); if (mouse.hitTest(currentEnemy)) { if (currentEnemy.tower == false) { health = health - currentEnemy.damage; } } if (currentEnemy.tower == true) { currentBullet = eval ("bullet" + i); if (mouse.hitTest(currentBullet)) { health = health - currentEnemy.damage; } } i++; } i = 0; while (i <= buttons) { currentButton = eval ("button" + i); currentResponder = eval ("responder" + i); hit = false; r = 0; while (r <= rocks) { currentRock = eval ("rock" + r); if (currentButton.hitTest(currentRock)) { hit = true; if (currentButton.pressed == false) { currentButton.pressed = true; currentResponder.oX = currentResponder.oX + 10000; } } r++; } if (mousehitsbuttons == true) { if (mouse.hitTest(currentButton)) { hit = true; if (currentButton.pressed == false) { currentButton.pressed = true; currentResponder.oX = currentResponder.oX + 10000; } } } if (hit == false) { if (currentButton.pressed == true) { currentButton.pressed = false; currentResponder.oX = currentResponder.oX - 10000; currentResponder.alpha = 0; } } i++; } currentResponder.fadeOut = false; currentResponder.alpha = 100; currentResponder.speed = 6; if (mouse.hitTest(end)) { if (win == false) { level++; winS.start(0, 1); end.gotoAndPlay("win"); win = true; } } i = 0; while (i <= enemies) { currentTower = eval ("enemy" + i); if (currentTower.tower == true) { currentTop = eval ("towertop" + i); currentBullet = eval ("bullet" + i); currentTop._x = currentTower._x; currentTop._y = currentTower._y - (95 * (currentTower._yscale / 100)); currentTop._yscale = currentTower._yscale; dx = currentTop._x - mouse._x; dy = currentTop._y - mouse._y; radians = Math.atan(dy / dx); degrees = (radians * 180) / Math.PI; if (dx > 0) { degrees = degrees + 180; } radians = (degrees / 180) * Math.PI; degrees = degrees + 90; currentTop._rotation = degrees; distance = Math.sqrt((dx * dx) + (dy * dy)); currentTower.counter++; if (currentTower.counter >= currentTower.counterLimit) { currentTower.counter = 0; currentBullet.oX = currentTower.oX; currentBullet.oY = currentTower.oY - (95 * (currentTower._yscale / 100)); currentBullet.dx = Math.cos(radians) * currentTower.launchSpeed; currentBullet.dy = Math.sin(radians) * currentTower.launchSpeed; } currentBullet.oX = currentBullet.oX + currentBullet.dx; currentBullet.oY = currentBullet.oY + currentBullet.dy; } i++; } }; menu.onRelease = function () { gotoAndStop ("menu"); }; currentAlpha = 100; faderbox._alpha = currentAlpha; fadeOut = function () { if (loading == true) { faderbox.gotoAndStop("blue"); } if (loading == false) { faderbox.gotoAndStop("red"); } currentAlpha = currentAlpha + speed; if (currentAlpha >= 100) { currentAlpha = 100; if (loading == true) { gotoAndStop ("loading"); } if (loading == false) { gotoAndStop ("lose"); } } faderbox._x = 0; faderbox._y = 0; faderbox._alpha = currentAlpha; }; fadeIn = function () { faderbox.gotoAndStop("blue"); currentAlpha = currentAlpha - speed; if (currentAlpha <= 0) { currentAlpha = 0; faderbox._x = -10000; faderbox._y = -10000; } faderbox._alpha = currentAlpha; if (health < topHealth) { faderbox.gotoAndStop("red"); faderbox._x = 0; faderbox._y = 0; faderbox._alpha = (100 - (health * healthMultiplier)) - 20; if (faderbox._alpha < 0) { faderbox._alpha = 0; } currentAlpha = faderbox._alpha; } };
Frame 99
lands = 12; total = 0; rocks = 6; objects = 5; buttons = 3; enemies = 8; notputdown = -1; health = topHealth; healthMultiplier = 100 / health; flightJuice = topFlightJuice; flightMultiplier = 100 / flightJuice; mouse.maxWidth = 62.1; landWidth = 188; onLandNum = 0; globalX = 0; globalY = 0; win = false; mousehitsbuttons = false; topsmoke = 5; smoke = 0; thrustsoundpauser = 0; totalforthruster = 4; fadein = true; loading = true; stop(); mouse = eval (type); mouse._x = startX._x; mouse._y = startX._y; startX._x = -100; startX._y = -100; mouse.dy = 0; mouse.dx = 0; mouse.oX = mouse._x; mouse.oY = mouse._y; explosion.oX = -10000; explosion.oY = -10000; leftbarrier.oX = leftbarrier._x; leftbarrier.oY = leftbarrier._y; rightbarrier.oX = rightbarrier._x; rightbarrier.oY = rightbarrier._y; topbarrier.oX = topbarrier._x; topbarrier.oY = topbarrier._y; bottombarrier.oX = bottombarrier._x; bottombarrier.oY = bottombarrier._y; end.oX = end._x; end.oY = end._y; enemy1.tower = false; enemy2.tower = false; enemy3.tower = false; enemy4.tower = false; enemy5.tower = true; enemy6.tower = true; enemy7.tower = true; enemy8.tower = true; i = 0; while (i <= objects) { currentObject = eval ("object" + i); currentObject.oX = currentObject._x; currentObject.oY = currentObject._y; i++; } enemy1.gotoLeft = true; i = 1; while (i <= enemies) { currentEnemy = eval ("enemy" + i); currentEnemy.health = 8; currentEnemy.speed = 2; firstFlag = eval ("firstPatrolMarker" + i); secondFlag = eval ("secondPatrolMarker" + i); currentEnemy.patrolLength = secondFlag._x - firstFlag._x; currentEnemy.patrolPoint = currentEnemy._x - firstFlag._x; firstFlag._x = -100; secondFlag._x = -100; currentEnemy.damage = 1; currentEnemy.oX = currentEnemy._x; currentEnemy.oY = currentEnemy._y; currentEnemy.dead = false; currentEnemy.gotoLeft = true; i++; } i = 0; while (i <= enemies) { currentEnemy = eval ("enemy" + i); if (currentEnemy.tower == true) { currentEnemy.counter = 0; currentEnemy.counterLimit = 60; currentEnemy.launchSpeed = 2; currentEnemy.health = 20; } i++; } i = 0; while (i <= buttons) { currentButton = eval ("button" + i); currentButton.pressed = false; currentButton.oX = currentButton._x; currentButton.oY = currentButton._y; currentResponder = eval ("responder" + i); currentResponder.oX = currentResponder._x; currentResponder.oY = currentResponder._y; currentResponder.fadeOut = false; currentResponder.alpha = 100; currentResponder.speed = 6; i++; } i = 0; while (i <= rocks) { currentRock = eval ("rock" + i); currentRock.oX = currentRock._x; currentRock.oY = currentRock._y; currentRock.dx = 0; currentRock.dy = 0; currentRock.originX = currentRock._x; currentRock.originY = currentRock._y; i++; } i = 0; while (i <= lands) { currentLand = eval ("land" + i); currentLand.oX = currentLand._x; currentLand.oY = currentLand._y; i++; } mouse.onEnterFrame = function () { if (fadein == true) { fadeIn(); } else { fadeOut(); } mouse.dy = mouse.dy + gravity; mouse._y = mouse._y + mouse.dy; mouse._x = mouse._x + mouse.dx; healthbar._xscale = health * healthMultiplier; if (flightJuice > 0) { flightbar._xscale = flightJuice * flightMultiplier; } if (health <= 0) { fadein = false; loading = false; } if (health < topHealth) { health = health + (regenerateRate / 5); } if (flightJuice < topFlightJuice) { flightJuice = flightJuice + regenerateRate; } dx = (Stage.width / 2) - mouse._x; dy = (Stage.width / 2) - mouse._y; dx = dx / 4; dy = dy / 4; if (mouse.dx > topspeed) { mouse.dx = topspeed; } if (mouse.dx < (-topspeed)) { mouse.dx = -topspeed; } if (mouse.dy > topspeed) { mouse.dy = topspeed; } if (mouse.dy < (-topspeed)) { mouse.dy = -topspeed; } globalX = globalX + dx; globalY = globalY + dy; i = 1; while (i <= lands) { currentLand = eval ("land" + i); currentLand._x = currentLand.oX + globalX; currentLand._y = currentLand.oY + globalY; i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); currentRock._x = currentRock.oX + globalX; currentRock._y = currentRock.oY + globalY; i++; } i = 1; while (i <= enemies) { currentEnemy = eval ("enemy" + i); currentEnemy._x = currentEnemy.oX + globalX; currentEnemy._y = currentEnemy.oY + globalY; if (currentEnemy.tower) { currentBullet = eval ("bullet" + i); currentBullet._x = currentBullet.oX + globalX; currentBullet._y = currentBullet.oY + globalY; } i++; } explosion._x = explosion.oX + globalX; explosion._y = explosion.oY + globalY; i = 0; while (i <= buttons) { currentButton = eval ("button" + i); currentResponder = eval ("responder" + i); currentButton._x = currentButton.oX + globalX; currentButton._y = currentButton.oY + globalY; currentResponder._x = currentResponder.oX + globalX; currentResponder._y = currentResponder.oY + globalY; i++; } i = 0; while (i <= objects) { currentObject = eval ("object" + i); currentObject._x = currentObject.oX + globalX; currentObject._y = currentObject.oY + globalY; i++; } leftbarrier._x = leftbarrier.oX + globalX; leftbarrier._y = leftbarrier.oY + globalY; rightbarrier._x = rightbarrier.oX + globalX; rightbarrier._y = rightbarrier.oY + globalY; topbarrier._x = topbarrier.oX + globalX; topbarrier._y = topbarrier.oY + globalY; bottombarrier._x = bottombarrier.oX + globalX; bottombarrier._y = bottombarrier.oY + globalY; end._x = end.oX + globalX; end._y = end.oY + globalY; mouse.oX = mouse.oX + dx; mouse.oY = mouse.oY + dy; mouse._y = mouse._y + dy; mouse._x = mouse._x + dx; bg._x = bg._x + (dx / 3); bg._y = bg._y + (dy / 3); if (notputdown != -1) { currentRock = eval ("rock" + notputdown); currentRock._x = mouse._x; currentRock._y = mouse._y + 25; currentRock.dx = mouse.dx; currentRock.dy = mouse.dy; } onLand = false; i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (mouse._y < (currentLand._y + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = currentLand._y; onLand = true; onLandNum = i; } else if (mouse._y > (((currentLand._y + 35.5) + 25.4) + (mouse.dy * 1.2))) { mouse.dy = mouse.dy * -1; mouse._y = mouse._y + (mouse.dy * 1.5); } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } i++; } if (notputdown != -1) { currentRock = eval ("rock" + notputdown); i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (currentRock.hitTest(currentLand)) { if (currentRock._y < (currentLand._y + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = currentLand._y - 25; onLand = true; onLandNum = i; } else if (currentRock._y > (((currentLand._y + 35) + 27) + (mouse.dy * 1.2))) { mouse.dy = mouse.dy * -1; mouse._y = mouse._y + (mouse.dy * 1.5); } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } i++; } notDropRock = eval ("rock" + notputdown); i = 1; while (i <= rocks) { if (i != notputdown) { currentRock = eval ("rock" + i); if (notDropRock.hitTest(currentRock)) { if (notDropRock._y < ((currentRock._y - 25) + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = currentRock._y - 54; onLand = true; } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } } i++; } } if (mouse.hitTest(leftbarrier)) { mouse.dx = mouse.dx * -1; mouse.oX = mouse.oX + (mouse.dx * 6); } if (mouse.hitTest(rightbarrier)) { mouse.dx = mouse.dx * -1; mouse.oX = mouse.oX + (mouse.dx * 6); } if (mouse.hitTest(topbarrier)) { mouse.dy = mouse.dy * -1; mouse.oY = mouse.oY + (mouse.dy * 6); } if (mouse.hitTest(bottombarrier)) { mouse.dy = mouse.dy * -1; mouse.oY = mouse.oY + (mouse.dy * 6); } i = 0; while (i <= rocks) { currentRock = eval ("rock" + i); if (currentRock.hitTest(leftbarrier)) { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 6); } if (currentRock.hitTest(rightbarrier)) { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 6); } if (currentRock.hitTest(topbarrier)) { currentRock.dy = currentRock.dy * -1; currentRock.oY = currentRock.oY + (currentRock.dy * 6); } if (currentRock.hitTest(bottombarrier)) { currentRock.dy = currentRock.dy * -1; currentRock.oX = currentRock.oX + (currentRock.dy * 6); } i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); e = 1; while (e <= enemies) { currentEnemy = eval ("enemy" + e); if (currentRock.hitTest(currentEnemy)) { if (currentRock._y < currentEnemy._y) { if (currentRock.dy > 0) { if (playsounds) { } currentEnemy.health = currentEnemy.health - currentRock.dy; if (currentEnemy.tower == false) { currentEnemy._yscale = currentEnemy.health * 10; } else { currentEnemy._yscale = currentEnemy.health * 5; } currentEnemy.speed = 0; currentRock.dy = 0; currentRock.dx = 0; if (notputdown == i) { mouse._y = mouse._y - 5; mouse.dy = mouse.dy - 1; currentX = currentRock.oX + globalX; currentY = currentRock.oY + globalY; dx = mouse._x - currentX; dy = mouse._y - currentY; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); notputdown = -1; } if (currentEnemy.health <= 1) { if (i != notputdown) { if (playsounds) { explosionS.start(0, 1); } explosion.oX = currentEnemy.oX; explosion.oY = currentEnemy.oY; if (currentEnemy.tower == true) { explosion._yscale = 200; explosion._xscale = 100; } else { explosion._yscale = 65; explosion._xscale = 65; } explosion.gotoAndPlay(1); currentEnemy.oX = -1000; currentEnemy.oY = -1000; } else { if (playsounds) { explosionS.start(0, 1); } if (currentEnemy.tower == true) { explosion._yscale = 200; explosion._xscale = 100; } else { explosion._yscale = 65; explosion._xscale = 65; } explosion.gotoAndPlay(1); currentEnemy.oX = -1000; currentEnemy.oY = -1000; mouse._y = mouse._y - 5; mouse.dy = mouse.dy - 1; currentX = currentRock.oX + globalX; currentY = currentRock.oY + globalY; dx = mouse._x - currentX; dy = mouse._y - currentY; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); notputdown = -1; } currentEnemy.dead = true; } } } } e++; } i++; } i = 1; while (i <= rocks) { if (i != notputdown) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (mouse._y < ((currentRock._y - 25) + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = (currentRock.oY + globalY) - 26; onLand = true; } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } } i++; } i = 0; while (i <= buttons) { currentResponder = eval ("responder" + i); if (mouse.hitTest(currentResponder)) { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } i++; } pressed = false; if (Key.isDown(38)) { if (onLand) { mouse.dy = -2; mouse._y = mouse._y + mouse.dy; } else if (flightJuice > 0) { pressed = true; mouse.gotoAndStop("up"); mouse.dy = mouse.dy - thrust; flightJuice = flightJuice - 1; } } if (Key.isDown(40)) { if (onLand) { } else if (flightJuice > 0) { pressed = true; mouse.gotoAndStop("down"); mouse.dy = mouse.dy + thrust; flightJuice = flightJuice - 1; } if (mouse.hitTest(topbarrier)) { mouse._y = mouse._y + 7; } i = 0; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (currentLand._y < (mouse._y - 5)) { mouse._y = mouse._y + 7; } } i++; } } if (Key.isDown(37)) { pressed = true; if (onLand) { mouse.dx = mouse.dx - thrust; mouse.gotoAndStop("left"); } else if (flightJuice > 0) { pressed = true; mouse.dx = mouse.dx - thrust; mouse.gotoAndStop("left"); flightJuice = flightJuice - 1; } i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (i != onLandNum) { if (mouse._y > currentLand._y) { mouse._x = mouse._x - 7; } } } i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (mouse._y > (currentRock._y - 26)) { if (i != notputdown) { mouse._x = mouse._x - 7; } } } i++; } i = 0; while (i <= buttons) { currentResponder = eval ("responder" + i); if (mouse.hitTest(currentResponder)) { mouse._x = mouse._x - 7; } i++; } if (mouse.hitTest(rightbarrier)) { mouse._x = mouse._x - 7; } } else if (Key.isDown(39)) { pressed = true; if (onLand) { mouse.dx = mouse.dx + thrust; mouse.gotoAndStop("left"); } else if (flightJuice > 0) { pressed = true; mouse.dx = mouse.dx + thrust; mouse.gotoAndStop("left"); flightJuice = flightJuice - 1; } mouse.gotoAndStop("right"); i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (i != onLandNum) { if (mouse._y > currentLand._y) { mouse._x = mouse._x + 7; } } } i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (mouse._y > (currentRock._y - 26)) { if (i != notputdown) { mouse._x = mouse._x + 7; } } } i++; } i = 0; while (i <= buttons) { currentResponder = eval ("responder" + i); if (mouse.hitTest(currentResponder)) { mouse._x = mouse._x + 7; } i++; } if (mouse.hitTest(leftbarrier)) { mouse._x = mouse._x + 7; } } else if (mouse.dx < 0) { mouse.dx = mouse.dx + thrust; } else if (mouse.dx > 0) { mouse.dx = mouse.dx - thrust; } if (mouse.dx < 0.1) { if (mouse.dx > 0) { mouse.dx = 0; } } if (mouse.dx > -0.1) { if (mouse.dx < 0) { mouse.dx = 0; } } if (pressed == false) { mouse.gotoAndStop("center"); } if (pressed == true) { if (playsounds) { thrustsoundpauser++; if (thrustsoundpauser == totalforthruster) { thruster.start(0, 1); thrustsoundpauser = 0; } } } if (Key.isDown(32)) { if (donePressSpace) { donePressSpace = false; if (notputdown == -1) { i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (playsounds) { pickup.start(0, 1); } notputdown = i; dx = mouse._x - currentRock._x; dy = mouse._y - currentRock._y; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); } i++; } } else { mouse._y = mouse._y - 5; mouse.dy = mouse.dy - 1; if (playsounds) { pickup.start(0, 1); } currentRock = eval ("rock" + notputdown); currentX = currentRock.oX + globalX; currentY = currentRock.oY + globalY; dx = mouse._x - currentX; dy = mouse._y - currentY; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); notputdown = -1; } } } else { donePressSpace = true; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (i != notputdown) { currentRock.dy = currentRock.dy + gravity; currentRock.oX = currentRock.oX + currentRock.dx; currentRock.oY = currentRock.oY + currentRock.dy; } l = 1; while (l <= lands) { currentLand = eval ("land" + l); if (currentRock.hitTest(currentLand)) { if (currentRock._y < ((currentLand._y + currentRock.dy) + 0.5)) { currentRock.oY = currentLand.oY; currentRock.dy = 0; currentRock.dx = 0; } else if (currentRock._y > (currentLand._y + 25.5)) { currentRock.dy = currentRock.dy * -1; currentRock.oY = currentRock.oY + (currentRock.dy * 2); } else { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 4); } } l++; } b = 1; while (b <= rocks) { otherRock = eval ("rock" + b); if (b != i) { if (currentRock.hitTest(otherRock)) { if (currentRock.oY < otherRock.oY) { currentRock.oY = otherRock.oY - 29; currentRock.dy = 0; currentRock.dx = 0; } } } b++; } b = 0; while (b <= buttons) { currentResponder = eval ("responder" + b); if (currentRock.hitTest(currentResponder)) { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 6); } b++; } i++; } i = 1; while (i <= enemies) { currentEnemy = eval ("enemy" + i); if (currentEnemy.tower == false) { if (currentEnemy.gotoLeft == true) { if (currentEnemy.patrolPoint < currentEnemy.patrolLength) { currentEnemy.oX = currentEnemy.oX + currentEnemy.speed; currentEnemy.patrolPoint = currentEnemy.patrolPoint + currentEnemy.speed; } else { currentEnemy.gotoLeft = false; currentEnemy.gotoAndPlay("turn"); } } else if (currentEnemy.patrolPoint > 0) { currentEnemy.oX = currentEnemy.oX - currentEnemy.speed; currentEnemy.patrolPoint = currentEnemy.patrolPoint - currentEnemy.speed; } else { currentEnemy.gotoLeft = true; currentEnemy.gotoAndPlay("turn"); } } i++; } i = 0; while (i <= enemies) { currentEnemy = eval ("enemy" + i); if (mouse.hitTest(currentEnemy)) { if (currentEnemy.tower == false) { health = health - currentEnemy.damage; } } if (currentEnemy.tower == true) { currentBullet = eval ("bullet" + i); if (mouse.hitTest(currentBullet)) { health = health - currentEnemy.damage; } } i++; } i = 0; while (i <= buttons) { currentButton = eval ("button" + i); currentResponder = eval ("responder" + i); hit = false; r = 0; while (r <= rocks) { currentRock = eval ("rock" + r); if (currentButton.hitTest(currentRock)) { hit = true; if (currentButton.pressed == false) { currentButton.pressed = true; currentResponder.oX = currentResponder.oX + 10000; } } r++; } if (mousehitsbuttons == true) { if (mouse.hitTest(currentButton)) { hit = true; if (currentButton.pressed == false) { currentButton.pressed = true; currentResponder.oX = currentResponder.oX + 10000; } } } if (hit == false) { if (currentButton.pressed == true) { currentButton.pressed = false; currentResponder.oX = currentResponder.oX - 10000; currentResponder.alpha = 0; } } i++; } currentResponder.fadeOut = false; currentResponder.alpha = 100; currentResponder.speed = 6; if (mouse.hitTest(end)) { if (win == false) { level++; winS.start(0, 1); end.gotoAndPlay("win"); win = true; } } i = 0; while (i <= enemies) { currentTower = eval ("enemy" + i); if (currentTower.tower == true) { currentTop = eval ("towertop" + i); currentBullet = eval ("bullet" + i); currentTop._x = currentTower._x; currentTop._y = currentTower._y - (95 * (currentTower._yscale / 100)); currentTop._yscale = currentTower._yscale; dx = currentTop._x - mouse._x; dy = currentTop._y - mouse._y; radians = Math.atan(dy / dx); degrees = (radians * 180) / Math.PI; if (dx > 0) { degrees = degrees + 180; } radians = (degrees / 180) * Math.PI; degrees = degrees + 90; currentTop._rotation = degrees; distance = Math.sqrt((dx * dx) + (dy * dy)); currentTower.counter++; if (currentTower.counter >= currentTower.counterLimit) { currentTower.counter = 0; currentBullet.oX = currentTower.oX; currentBullet.oY = currentTower.oY - (95 * (currentTower._yscale / 100)); currentBullet.dx = Math.cos(radians) * currentTower.launchSpeed; currentBullet.dy = Math.sin(radians) * currentTower.launchSpeed; } currentBullet.oX = currentBullet.oX + currentBullet.dx; currentBullet.oY = currentBullet.oY + currentBullet.dy; } i++; } }; menu.onRelease = function () { gotoAndStop ("menu"); }; currentAlpha = 100; faderbox._alpha = currentAlpha; fadeOut = function () { if (loading == true) { faderbox.gotoAndStop("blue"); } if (loading == false) { faderbox.gotoAndStop("red"); } currentAlpha = currentAlpha + speed; if (currentAlpha >= 100) { currentAlpha = 100; if (loading == true) { gotoAndStop ("loading"); } if (loading == false) { gotoAndStop ("lose"); } } faderbox._x = 0; faderbox._y = 0; faderbox._alpha = currentAlpha; }; fadeIn = function () { faderbox.gotoAndStop("blue"); currentAlpha = currentAlpha - speed; if (currentAlpha <= 0) { currentAlpha = 0; faderbox._x = -10000; faderbox._y = -10000; } faderbox._alpha = currentAlpha; if (health < topHealth) { faderbox.gotoAndStop("red"); faderbox._x = 0; faderbox._y = 0; faderbox._alpha = (100 - (health * healthMultiplier)) - 20; if (faderbox._alpha < 0) { faderbox._alpha = 0; } currentAlpha = faderbox._alpha; } };
Frame 100
lands = 12; total = 0; rocks = 6; objects = 5; buttons = 3; enemies = 8; notputdown = -1; health = topHealth; healthMultiplier = 100 / health; flightJuice = topFlightJuice; flightMultiplier = 100 / flightJuice; mouse.maxWidth = 62.1; landWidth = 188; onLandNum = 0; globalX = 0; globalY = 0; win = false; mousehitsbuttons = false; topsmoke = 5; smoke = 0; thrustsoundpauser = 0; totalforthruster = 4; fadein = true; loading = true; stop(); mouse = eval (type); mouse._x = startX._x; mouse._y = startX._y; startX._x = -100; startX._y = -100; mouse.dy = 0; mouse.dx = 0; mouse.oX = mouse._x; mouse.oY = mouse._y; explosion.oX = -10000; explosion.oY = -10000; leftbarrier.oX = leftbarrier._x; leftbarrier.oY = leftbarrier._y; rightbarrier.oX = rightbarrier._x; rightbarrier.oY = rightbarrier._y; topbarrier.oX = topbarrier._x; topbarrier.oY = topbarrier._y; bottombarrier.oX = bottombarrier._x; bottombarrier.oY = bottombarrier._y; end.oX = end._x; end.oY = end._y; enemy1.tower = false; enemy2.tower = false; enemy3.tower = false; enemy4.tower = false; enemy5.tower = true; enemy6.tower = true; enemy7.tower = true; enemy8.tower = true; i = 0; while (i <= objects) { currentObject = eval ("object" + i); currentObject.oX = currentObject._x; currentObject.oY = currentObject._y; i++; } enemy1.gotoLeft = true; i = 1; while (i <= enemies) { currentEnemy = eval ("enemy" + i); currentEnemy.health = 8; currentEnemy.speed = 2; firstFlag = eval ("firstPatrolMarker" + i); secondFlag = eval ("secondPatrolMarker" + i); currentEnemy.patrolLength = secondFlag._x - firstFlag._x; currentEnemy.patrolPoint = currentEnemy._x - firstFlag._x; firstFlag._x = -100; secondFlag._x = -100; currentEnemy.damage = 1; currentEnemy.oX = currentEnemy._x; currentEnemy.oY = currentEnemy._y; currentEnemy.dead = false; currentEnemy.gotoLeft = true; i++; } i = 0; while (i <= enemies) { currentEnemy = eval ("enemy" + i); if (currentEnemy.tower == true) { currentEnemy.counter = 0; currentEnemy.counterLimit = 60; currentEnemy.launchSpeed = 2; currentEnemy.health = 20; } i++; } i = 0; while (i <= buttons) { currentButton = eval ("button" + i); currentButton.pressed = false; currentButton.oX = currentButton._x; currentButton.oY = currentButton._y; currentResponder = eval ("responder" + i); currentResponder.oX = currentResponder._x; currentResponder.oY = currentResponder._y; currentResponder.fadeOut = false; currentResponder.alpha = 100; currentResponder.speed = 6; i++; } i = 0; while (i <= rocks) { currentRock = eval ("rock" + i); currentRock.oX = currentRock._x; currentRock.oY = currentRock._y; currentRock.dx = 0; currentRock.dy = 0; currentRock.originX = currentRock._x; currentRock.originY = currentRock._y; i++; } i = 0; while (i <= lands) { currentLand = eval ("land" + i); currentLand.oX = currentLand._x; currentLand.oY = currentLand._y; i++; } mouse.onEnterFrame = function () { if (fadein == true) { fadeIn(); } else { fadeOut(); } mouse.dy = mouse.dy + gravity; mouse._y = mouse._y + mouse.dy; mouse._x = mouse._x + mouse.dx; healthbar._xscale = health * healthMultiplier; if (flightJuice > 0) { flightbar._xscale = flightJuice * flightMultiplier; } if (health <= 0) { fadein = false; loading = false; } if (health < topHealth) { health = health + (regenerateRate / 5); } if (flightJuice < topFlightJuice) { flightJuice = flightJuice + regenerateRate; } dx = (Stage.width / 2) - mouse._x; dy = (Stage.width / 2) - mouse._y; dx = dx / 4; dy = dy / 4; if (mouse.dx > topspeed) { mouse.dx = topspeed; } if (mouse.dx < (-topspeed)) { mouse.dx = -topspeed; } if (mouse.dy > topspeed) { mouse.dy = topspeed; } if (mouse.dy < (-topspeed)) { mouse.dy = -topspeed; } globalX = globalX + dx; globalY = globalY + dy; i = 1; while (i <= lands) { currentLand = eval ("land" + i); currentLand._x = currentLand.oX + globalX; currentLand._y = currentLand.oY + globalY; i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); currentRock._x = currentRock.oX + globalX; currentRock._y = currentRock.oY + globalY; i++; } i = 1; while (i <= enemies) { currentEnemy = eval ("enemy" + i); currentEnemy._x = currentEnemy.oX + globalX; currentEnemy._y = currentEnemy.oY + globalY; if (currentEnemy.tower) { currentBullet = eval ("bullet" + i); currentBullet._x = currentBullet.oX + globalX; currentBullet._y = currentBullet.oY + globalY; } i++; } explosion._x = explosion.oX + globalX; explosion._y = explosion.oY + globalY; i = 0; while (i <= buttons) { currentButton = eval ("button" + i); currentResponder = eval ("responder" + i); currentButton._x = currentButton.oX + globalX; currentButton._y = currentButton.oY + globalY; currentResponder._x = currentResponder.oX + globalX; currentResponder._y = currentResponder.oY + globalY; i++; } i = 0; while (i <= objects) { currentObject = eval ("object" + i); currentObject._x = currentObject.oX + globalX; currentObject._y = currentObject.oY + globalY; i++; } leftbarrier._x = leftbarrier.oX + globalX; leftbarrier._y = leftbarrier.oY + globalY; rightbarrier._x = rightbarrier.oX + globalX; rightbarrier._y = rightbarrier.oY + globalY; topbarrier._x = topbarrier.oX + globalX; topbarrier._y = topbarrier.oY + globalY; bottombarrier._x = bottombarrier.oX + globalX; bottombarrier._y = bottombarrier.oY + globalY; end._x = end.oX + globalX; end._y = end.oY + globalY; mouse.oX = mouse.oX + dx; mouse.oY = mouse.oY + dy; mouse._y = mouse._y + dy; mouse._x = mouse._x + dx; bg._x = bg._x + (dx / 3); bg._y = bg._y + (dy / 3); if (notputdown != -1) { currentRock = eval ("rock" + notputdown); currentRock._x = mouse._x; currentRock._y = mouse._y + 25; currentRock.dx = mouse.dx; currentRock.dy = mouse.dy; } onLand = false; i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (mouse._y < (currentLand._y + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = currentLand._y; onLand = true; onLandNum = i; } else if (mouse._y > (((currentLand._y + 35.5) + 25.4) + (mouse.dy * 1.2))) { mouse.dy = mouse.dy * -1; mouse._y = mouse._y + (mouse.dy * 1.5); } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } i++; } if (notputdown != -1) { currentRock = eval ("rock" + notputdown); i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (currentRock.hitTest(currentLand)) { if (currentRock._y < (currentLand._y + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = currentLand._y - 25; onLand = true; onLandNum = i; } else if (currentRock._y > (((currentLand._y + 35) + 27) + (mouse.dy * 1.2))) { mouse.dy = mouse.dy * -1; mouse._y = mouse._y + (mouse.dy * 1.5); } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } i++; } notDropRock = eval ("rock" + notputdown); i = 1; while (i <= rocks) { if (i != notputdown) { currentRock = eval ("rock" + i); if (notDropRock.hitTest(currentRock)) { if (notDropRock._y < ((currentRock._y - 25) + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = currentRock._y - 54; onLand = true; } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } } i++; } } if (mouse.hitTest(leftbarrier)) { mouse.dx = mouse.dx * -1; mouse.oX = mouse.oX + (mouse.dx * 6); } if (mouse.hitTest(rightbarrier)) { mouse.dx = mouse.dx * -1; mouse.oX = mouse.oX + (mouse.dx * 6); } if (mouse.hitTest(topbarrier)) { mouse.dy = mouse.dy * -1; mouse.oY = mouse.oY + (mouse.dy * 6); } if (mouse.hitTest(bottombarrier)) { mouse.dy = mouse.dy * -1; mouse.oY = mouse.oY + (mouse.dy * 6); } i = 0; while (i <= rocks) { currentRock = eval ("rock" + i); if (currentRock.hitTest(leftbarrier)) { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 6); } if (currentRock.hitTest(rightbarrier)) { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 6); } if (currentRock.hitTest(topbarrier)) { currentRock.dy = currentRock.dy * -1; currentRock.oY = currentRock.oY + (currentRock.dy * 6); } if (currentRock.hitTest(bottombarrier)) { currentRock.dy = currentRock.dy * -1; currentRock.oX = currentRock.oX + (currentRock.dy * 6); } i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); e = 1; while (e <= enemies) { currentEnemy = eval ("enemy" + e); if (currentRock.hitTest(currentEnemy)) { if (currentRock._y < currentEnemy._y) { if (currentRock.dy > 0) { if (playsounds) { } currentEnemy.health = currentEnemy.health - currentRock.dy; if (currentEnemy.tower == false) { currentEnemy._yscale = currentEnemy.health * 10; } else { currentEnemy._yscale = currentEnemy.health * 5; } currentEnemy.speed = 0; currentRock.dy = 0; currentRock.dx = 0; if (notputdown == i) { mouse._y = mouse._y - 5; mouse.dy = mouse.dy - 1; currentX = currentRock.oX + globalX; currentY = currentRock.oY + globalY; dx = mouse._x - currentX; dy = mouse._y - currentY; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); notputdown = -1; } if (currentEnemy.health <= 1) { if (i != notputdown) { if (playsounds) { explosionS.start(0, 1); } explosion.oX = currentEnemy.oX; explosion.oY = currentEnemy.oY; if (currentEnemy.tower == true) { explosion._yscale = 200; explosion._xscale = 100; } else { explosion._yscale = 65; explosion._xscale = 65; } explosion.gotoAndPlay(1); currentEnemy.oX = -1000; currentEnemy.oY = -1000; } else { if (playsounds) { explosionS.start(0, 1); } if (currentEnemy.tower == true) { explosion._yscale = 200; explosion._xscale = 100; } else { explosion._yscale = 65; explosion._xscale = 65; } explosion.gotoAndPlay(1); currentEnemy.oX = -1000; currentEnemy.oY = -1000; mouse._y = mouse._y - 5; mouse.dy = mouse.dy - 1; currentX = currentRock.oX + globalX; currentY = currentRock.oY + globalY; dx = mouse._x - currentX; dy = mouse._y - currentY; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); notputdown = -1; } currentEnemy.dead = true; } } } } e++; } i++; } i = 1; while (i <= rocks) { if (i != notputdown) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (mouse._y < ((currentRock._y - 25) + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = (currentRock.oY + globalY) - 26; onLand = true; } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } } i++; } i = 0; while (i <= buttons) { currentResponder = eval ("responder" + i); if (mouse.hitTest(currentResponder)) { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } i++; } pressed = false; if (Key.isDown(38)) { if (onLand) { mouse.dy = -2; mouse._y = mouse._y + mouse.dy; } else if (flightJuice > 0) { pressed = true; mouse.gotoAndStop("up"); mouse.dy = mouse.dy - thrust; flightJuice = flightJuice - 1; } } if (Key.isDown(40)) { if (onLand) { } else if (flightJuice > 0) { pressed = true; mouse.gotoAndStop("down"); mouse.dy = mouse.dy + thrust; flightJuice = flightJuice - 1; } if (mouse.hitTest(topbarrier)) { mouse._y = mouse._y + 7; } i = 0; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (currentLand._y < (mouse._y - 5)) { mouse._y = mouse._y + 7; } } i++; } } if (Key.isDown(37)) { pressed = true; if (onLand) { mouse.dx = mouse.dx - thrust; mouse.gotoAndStop("left"); } else if (flightJuice > 0) { pressed = true; mouse.dx = mouse.dx - thrust; mouse.gotoAndStop("left"); flightJuice = flightJuice - 1; } i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (i != onLandNum) { if (mouse._y > currentLand._y) { mouse._x = mouse._x - 7; } } } i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (mouse._y > (currentRock._y - 26)) { if (i != notputdown) { mouse._x = mouse._x - 7; } } } i++; } i = 0; while (i <= buttons) { currentResponder = eval ("responder" + i); if (mouse.hitTest(currentResponder)) { mouse._x = mouse._x - 7; } i++; } if (mouse.hitTest(rightbarrier)) { mouse._x = mouse._x - 7; } } else if (Key.isDown(39)) { pressed = true; if (onLand) { mouse.dx = mouse.dx + thrust; mouse.gotoAndStop("left"); } else if (flightJuice > 0) { pressed = true; mouse.dx = mouse.dx + thrust; mouse.gotoAndStop("left"); flightJuice = flightJuice - 1; } mouse.gotoAndStop("right"); i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (i != onLandNum) { if (mouse._y > currentLand._y) { mouse._x = mouse._x + 7; } } } i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (mouse._y > (currentRock._y - 26)) { if (i != notputdown) { mouse._x = mouse._x + 7; } } } i++; } i = 0; while (i <= buttons) { currentResponder = eval ("responder" + i); if (mouse.hitTest(currentResponder)) { mouse._x = mouse._x + 7; } i++; } if (mouse.hitTest(leftbarrier)) { mouse._x = mouse._x + 7; } } else if (mouse.dx < 0) { mouse.dx = mouse.dx + thrust; } else if (mouse.dx > 0) { mouse.dx = mouse.dx - thrust; } if (mouse.dx < 0.1) { if (mouse.dx > 0) { mouse.dx = 0; } } if (mouse.dx > -0.1) { if (mouse.dx < 0) { mouse.dx = 0; } } if (pressed == false) { mouse.gotoAndStop("center"); } if (pressed == true) { if (playsounds) { thrustsoundpauser++; if (thrustsoundpauser == totalforthruster) { thruster.start(0, 1); thrustsoundpauser = 0; } } } if (Key.isDown(32)) { if (donePressSpace) { donePressSpace = false; if (notputdown == -1) { i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (playsounds) { pickup.start(0, 1); } notputdown = i; dx = mouse._x - currentRock._x; dy = mouse._y - currentRock._y; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); } i++; } } else { mouse._y = mouse._y - 5; mouse.dy = mouse.dy - 1; if (playsounds) { pickup.start(0, 1); } currentRock = eval ("rock" + notputdown); currentX = currentRock.oX + globalX; currentY = currentRock.oY + globalY; dx = mouse._x - currentX; dy = mouse._y - currentY; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); notputdown = -1; } } } else { donePressSpace = true; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (i != notputdown) { currentRock.dy = currentRock.dy + gravity; currentRock.oX = currentRock.oX + currentRock.dx; currentRock.oY = currentRock.oY + currentRock.dy; } l = 1; while (l <= lands) { currentLand = eval ("land" + l); if (currentRock.hitTest(currentLand)) { if (currentRock._y < ((currentLand._y + currentRock.dy) + 0.5)) { currentRock.oY = currentLand.oY; currentRock.dy = 0; currentRock.dx = 0; } else if (currentRock._y > (currentLand._y + 25.5)) { currentRock.dy = currentRock.dy * -1; currentRock.oY = currentRock.oY + (currentRock.dy * 2); } else { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 4); } } l++; } b = 1; while (b <= rocks) { otherRock = eval ("rock" + b); if (b != i) { if (currentRock.hitTest(otherRock)) { if (currentRock.oY < otherRock.oY) { currentRock.oY = otherRock.oY - 29; currentRock.dy = 0; currentRock.dx = 0; } } } b++; } b = 0; while (b <= buttons) { currentResponder = eval ("responder" + b); if (currentRock.hitTest(currentResponder)) { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 6); } b++; } i++; } i = 1; while (i <= enemies) { currentEnemy = eval ("enemy" + i); if (currentEnemy.tower == false) { if (currentEnemy.gotoLeft == true) { if (currentEnemy.patrolPoint < currentEnemy.patrolLength) { currentEnemy.oX = currentEnemy.oX + currentEnemy.speed; currentEnemy.patrolPoint = currentEnemy.patrolPoint + currentEnemy.speed; } else { currentEnemy.gotoLeft = false; currentEnemy.gotoAndPlay("turn"); } } else if (currentEnemy.patrolPoint > 0) { currentEnemy.oX = currentEnemy.oX - currentEnemy.speed; currentEnemy.patrolPoint = currentEnemy.patrolPoint - currentEnemy.speed; } else { currentEnemy.gotoLeft = true; currentEnemy.gotoAndPlay("turn"); } } i++; } i = 0; while (i <= enemies) { currentEnemy = eval ("enemy" + i); if (mouse.hitTest(currentEnemy)) { if (currentEnemy.tower == false) { health = health - currentEnemy.damage; } } if (currentEnemy.tower == true) { currentBullet = eval ("bullet" + i); if (mouse.hitTest(currentBullet)) { health = health - currentEnemy.damage; } } i++; } i = 0; while (i <= buttons) { currentButton = eval ("button" + i); currentResponder = eval ("responder" + i); hit = false; r = 0; while (r <= rocks) { currentRock = eval ("rock" + r); if (currentButton.hitTest(currentRock)) { hit = true; if (currentButton.pressed == false) { currentButton.pressed = true; currentResponder.oX = currentResponder.oX + 10000; } } r++; } if (mousehitsbuttons == true) { if (mouse.hitTest(currentButton)) { hit = true; if (currentButton.pressed == false) { currentButton.pressed = true; currentResponder.oX = currentResponder.oX + 10000; } } } if (hit == false) { if (currentButton.pressed == true) { currentButton.pressed = false; currentResponder.oX = currentResponder.oX - 10000; currentResponder.alpha = 0; } } i++; } currentResponder.fadeOut = false; currentResponder.alpha = 100; currentResponder.speed = 6; if (mouse.hitTest(end)) { if (win == false) { level++; winS.start(0, 1); end.gotoAndPlay("win"); win = true; } } i = 0; while (i <= enemies) { currentTower = eval ("enemy" + i); if (currentTower.tower == true) { currentTop = eval ("towertop" + i); currentBullet = eval ("bullet" + i); currentTop._x = currentTower._x; currentTop._y = currentTower._y - (95 * (currentTower._yscale / 100)); currentTop._yscale = currentTower._yscale; dx = currentTop._x - mouse._x; dy = currentTop._y - mouse._y; radians = Math.atan(dy / dx); degrees = (radians * 180) / Math.PI; if (dx > 0) { degrees = degrees + 180; } radians = (degrees / 180) * Math.PI; degrees = degrees + 90; currentTop._rotation = degrees; distance = Math.sqrt((dx * dx) + (dy * dy)); currentTower.counter++; if (currentTower.counter >= currentTower.counterLimit) { currentTower.counter = 0; currentBullet.oX = currentTower.oX; currentBullet.oY = currentTower.oY - (95 * (currentTower._yscale / 100)); currentBullet.dx = Math.cos(radians) * currentTower.launchSpeed; currentBullet.dy = Math.sin(radians) * currentTower.launchSpeed; } currentBullet.oX = currentBullet.oX + currentBullet.dx; currentBullet.oY = currentBullet.oY + currentBullet.dy; } i++; } }; menu.onRelease = function () { gotoAndStop ("menu"); }; currentAlpha = 100; faderbox._alpha = currentAlpha; fadeOut = function () { if (loading == true) { faderbox.gotoAndStop("blue"); } if (loading == false) { faderbox.gotoAndStop("red"); } currentAlpha = currentAlpha + speed; if (currentAlpha >= 100) { currentAlpha = 100; if (loading == true) { gotoAndStop ("loading"); } if (loading == false) { gotoAndStop ("lose"); } } faderbox._x = 0; faderbox._y = 0; faderbox._alpha = currentAlpha; }; fadeIn = function () { faderbox.gotoAndStop("blue"); currentAlpha = currentAlpha - speed; if (currentAlpha <= 0) { currentAlpha = 0; faderbox._x = -10000; faderbox._y = -10000; } faderbox._alpha = currentAlpha; if (health < topHealth) { faderbox.gotoAndStop("red"); faderbox._x = 0; faderbox._y = 0; faderbox._alpha = (100 - (health * healthMultiplier)) - 20; if (faderbox._alpha < 0) { faderbox._alpha = 0; } currentAlpha = faderbox._alpha; } };
Frame 101
lands = 12; total = 0; rocks = 6; objects = 5; buttons = 3; enemies = 8; notputdown = -1; health = topHealth; healthMultiplier = 100 / health; flightJuice = topFlightJuice; flightMultiplier = 100 / flightJuice; mouse.maxWidth = 62.1; landWidth = 188; onLandNum = 0; globalX = 0; globalY = 0; win = false; mousehitsbuttons = false; topsmoke = 5; smoke = 0; thrustsoundpauser = 0; totalforthruster = 4; fadein = true; loading = true; stop(); mouse = eval (type); mouse._x = startX._x; mouse._y = startX._y; startX._x = -100; startX._y = -100; mouse.dy = 0; mouse.dx = 0; mouse.oX = mouse._x; mouse.oY = mouse._y; explosion.oX = -10000; explosion.oY = -10000; leftbarrier.oX = leftbarrier._x; leftbarrier.oY = leftbarrier._y; rightbarrier.oX = rightbarrier._x; rightbarrier.oY = rightbarrier._y; topbarrier.oX = topbarrier._x; topbarrier.oY = topbarrier._y; bottombarrier.oX = bottombarrier._x; bottombarrier.oY = bottombarrier._y; end.oX = end._x; end.oY = end._y; enemy1.tower = false; enemy2.tower = false; enemy3.tower = false; enemy4.tower = false; enemy5.tower = true; enemy6.tower = true; enemy7.tower = true; enemy8.tower = true; i = 0; while (i <= objects) { currentObject = eval ("object" + i); currentObject.oX = currentObject._x; currentObject.oY = currentObject._y; i++; } enemy1.gotoLeft = true; i = 1; while (i <= enemies) { currentEnemy = eval ("enemy" + i); currentEnemy.health = 8; currentEnemy.speed = 2; firstFlag = eval ("firstPatrolMarker" + i); secondFlag = eval ("secondPatrolMarker" + i); currentEnemy.patrolLength = secondFlag._x - firstFlag._x; currentEnemy.patrolPoint = currentEnemy._x - firstFlag._x; firstFlag._x = -100; secondFlag._x = -100; currentEnemy.damage = 1; currentEnemy.oX = currentEnemy._x; currentEnemy.oY = currentEnemy._y; currentEnemy.dead = false; currentEnemy.gotoLeft = true; i++; } i = 0; while (i <= enemies) { currentEnemy = eval ("enemy" + i); if (currentEnemy.tower == true) { currentEnemy.counter = 0; currentEnemy.counterLimit = 60; currentEnemy.launchSpeed = 2; currentEnemy.health = 20; } i++; } i = 0; while (i <= buttons) { currentButton = eval ("button" + i); currentButton.pressed = false; currentButton.oX = currentButton._x; currentButton.oY = currentButton._y; currentResponder = eval ("responder" + i); currentResponder.oX = currentResponder._x; currentResponder.oY = currentResponder._y; currentResponder.fadeOut = false; currentResponder.alpha = 100; currentResponder.speed = 6; i++; } i = 0; while (i <= rocks) { currentRock = eval ("rock" + i); currentRock.oX = currentRock._x; currentRock.oY = currentRock._y; currentRock.dx = 0; currentRock.dy = 0; currentRock.originX = currentRock._x; currentRock.originY = currentRock._y; i++; } i = 0; while (i <= lands) { currentLand = eval ("land" + i); currentLand.oX = currentLand._x; currentLand.oY = currentLand._y; i++; } mouse.onEnterFrame = function () { if (fadein == true) { fadeIn(); } else { fadeOut(); } mouse.dy = mouse.dy + gravity; mouse._y = mouse._y + mouse.dy; mouse._x = mouse._x + mouse.dx; healthbar._xscale = health * healthMultiplier; if (flightJuice > 0) { flightbar._xscale = flightJuice * flightMultiplier; } if (health <= 0) { fadein = false; loading = false; } if (health < topHealth) { health = health + (regenerateRate / 5); } if (flightJuice < topFlightJuice) { flightJuice = flightJuice + regenerateRate; } dx = (Stage.width / 2) - mouse._x; dy = (Stage.width / 2) - mouse._y; dx = dx / 4; dy = dy / 4; if (mouse.dx > topspeed) { mouse.dx = topspeed; } if (mouse.dx < (-topspeed)) { mouse.dx = -topspeed; } if (mouse.dy > topspeed) { mouse.dy = topspeed; } if (mouse.dy < (-topspeed)) { mouse.dy = -topspeed; } globalX = globalX + dx; globalY = globalY + dy; i = 1; while (i <= lands) { currentLand = eval ("land" + i); currentLand._x = currentLand.oX + globalX; currentLand._y = currentLand.oY + globalY; i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); currentRock._x = currentRock.oX + globalX; currentRock._y = currentRock.oY + globalY; i++; } i = 1; while (i <= enemies) { currentEnemy = eval ("enemy" + i); currentEnemy._x = currentEnemy.oX + globalX; currentEnemy._y = currentEnemy.oY + globalY; if (currentEnemy.tower) { currentBullet = eval ("bullet" + i); currentBullet._x = currentBullet.oX + globalX; currentBullet._y = currentBullet.oY + globalY; } i++; } explosion._x = explosion.oX + globalX; explosion._y = explosion.oY + globalY; i = 0; while (i <= buttons) { currentButton = eval ("button" + i); currentResponder = eval ("responder" + i); currentButton._x = currentButton.oX + globalX; currentButton._y = currentButton.oY + globalY; currentResponder._x = currentResponder.oX + globalX; currentResponder._y = currentResponder.oY + globalY; i++; } i = 0; while (i <= objects) { currentObject = eval ("object" + i); currentObject._x = currentObject.oX + globalX; currentObject._y = currentObject.oY + globalY; i++; } leftbarrier._x = leftbarrier.oX + globalX; leftbarrier._y = leftbarrier.oY + globalY; rightbarrier._x = rightbarrier.oX + globalX; rightbarrier._y = rightbarrier.oY + globalY; topbarrier._x = topbarrier.oX + globalX; topbarrier._y = topbarrier.oY + globalY; bottombarrier._x = bottombarrier.oX + globalX; bottombarrier._y = bottombarrier.oY + globalY; end._x = end.oX + globalX; end._y = end.oY + globalY; mouse.oX = mouse.oX + dx; mouse.oY = mouse.oY + dy; mouse._y = mouse._y + dy; mouse._x = mouse._x + dx; bg._x = bg._x + (dx / 3); bg._y = bg._y + (dy / 3); if (notputdown != -1) { currentRock = eval ("rock" + notputdown); currentRock._x = mouse._x; currentRock._y = mouse._y + 25; currentRock.dx = mouse.dx; currentRock.dy = mouse.dy; } onLand = false; i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (mouse._y < (currentLand._y + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = currentLand._y; onLand = true; onLandNum = i; } else if (mouse._y > (((currentLand._y + 35.5) + 25.4) + (mouse.dy * 1.2))) { mouse.dy = mouse.dy * -1; mouse._y = mouse._y + (mouse.dy * 1.5); } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } i++; } if (notputdown != -1) { currentRock = eval ("rock" + notputdown); i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (currentRock.hitTest(currentLand)) { if (currentRock._y < (currentLand._y + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = currentLand._y - 25; onLand = true; onLandNum = i; } else if (currentRock._y > (((currentLand._y + 35) + 27) + (mouse.dy * 1.2))) { mouse.dy = mouse.dy * -1; mouse._y = mouse._y + (mouse.dy * 1.5); } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } i++; } notDropRock = eval ("rock" + notputdown); i = 1; while (i <= rocks) { if (i != notputdown) { currentRock = eval ("rock" + i); if (notDropRock.hitTest(currentRock)) { if (notDropRock._y < ((currentRock._y - 25) + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = currentRock._y - 54; onLand = true; } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } } i++; } } if (mouse.hitTest(leftbarrier)) { mouse.dx = mouse.dx * -1; mouse.oX = mouse.oX + (mouse.dx * 6); } if (mouse.hitTest(rightbarrier)) { mouse.dx = mouse.dx * -1; mouse.oX = mouse.oX + (mouse.dx * 6); } if (mouse.hitTest(topbarrier)) { mouse.dy = mouse.dy * -1; mouse.oY = mouse.oY + (mouse.dy * 6); } if (mouse.hitTest(bottombarrier)) { mouse.dy = mouse.dy * -1; mouse.oY = mouse.oY + (mouse.dy * 6); } i = 0; while (i <= rocks) { currentRock = eval ("rock" + i); if (currentRock.hitTest(leftbarrier)) { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 6); } if (currentRock.hitTest(rightbarrier)) { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 6); } if (currentRock.hitTest(topbarrier)) { currentRock.dy = currentRock.dy * -1; currentRock.oY = currentRock.oY + (currentRock.dy * 6); } if (currentRock.hitTest(bottombarrier)) { currentRock.dy = currentRock.dy * -1; currentRock.oX = currentRock.oX + (currentRock.dy * 6); } i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); e = 1; while (e <= enemies) { currentEnemy = eval ("enemy" + e); if (currentRock.hitTest(currentEnemy)) { if (currentRock._y < currentEnemy._y) { if (currentRock.dy > 0) { if (playsounds) { } currentEnemy.health = currentEnemy.health - currentRock.dy; if (currentEnemy.tower == false) { currentEnemy._yscale = currentEnemy.health * 10; } else { currentEnemy._yscale = currentEnemy.health * 5; } currentEnemy.speed = 0; currentRock.dy = 0; currentRock.dx = 0; if (notputdown == i) { mouse._y = mouse._y - 5; mouse.dy = mouse.dy - 1; currentX = currentRock.oX + globalX; currentY = currentRock.oY + globalY; dx = mouse._x - currentX; dy = mouse._y - currentY; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); notputdown = -1; } if (currentEnemy.health <= 1) { if (i != notputdown) { if (playsounds) { explosionS.start(0, 1); } explosion.oX = currentEnemy.oX; explosion.oY = currentEnemy.oY; if (currentEnemy.tower == true) { explosion._yscale = 200; explosion._xscale = 100; } else { explosion._yscale = 65; explosion._xscale = 65; } explosion.gotoAndPlay(1); currentEnemy.oX = -1000; currentEnemy.oY = -1000; } else { if (playsounds) { explosionS.start(0, 1); } if (currentEnemy.tower == true) { explosion._yscale = 200; explosion._xscale = 100; } else { explosion._yscale = 65; explosion._xscale = 65; } explosion.gotoAndPlay(1); currentEnemy.oX = -1000; currentEnemy.oY = -1000; mouse._y = mouse._y - 5; mouse.dy = mouse.dy - 1; currentX = currentRock.oX + globalX; currentY = currentRock.oY + globalY; dx = mouse._x - currentX; dy = mouse._y - currentY; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); notputdown = -1; } currentEnemy.dead = true; } } } } e++; } i++; } i = 1; while (i <= rocks) { if (i != notputdown) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (mouse._y < ((currentRock._y - 25) + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = (currentRock.oY + globalY) - 26; onLand = true; } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } } i++; } i = 0; while (i <= buttons) { currentResponder = eval ("responder" + i); if (mouse.hitTest(currentResponder)) { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } i++; } pressed = false; if (Key.isDown(38)) { if (onLand) { mouse.dy = -2; mouse._y = mouse._y + mouse.dy; } else if (flightJuice > 0) { pressed = true; mouse.gotoAndStop("up"); mouse.dy = mouse.dy - thrust; flightJuice = flightJuice - 1; } } if (Key.isDown(40)) { if (onLand) { } else if (flightJuice > 0) { pressed = true; mouse.gotoAndStop("down"); mouse.dy = mouse.dy + thrust; flightJuice = flightJuice - 1; } if (mouse.hitTest(topbarrier)) { mouse._y = mouse._y + 7; } i = 0; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (currentLand._y < (mouse._y - 5)) { mouse._y = mouse._y + 7; } } i++; } } if (Key.isDown(37)) { pressed = true; if (onLand) { mouse.dx = mouse.dx - thrust; mouse.gotoAndStop("left"); } else if (flightJuice > 0) { pressed = true; mouse.dx = mouse.dx - thrust; mouse.gotoAndStop("left"); flightJuice = flightJuice - 1; } i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (i != onLandNum) { if (mouse._y > currentLand._y) { mouse._x = mouse._x - 7; } } } i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (mouse._y > (currentRock._y - 26)) { if (i != notputdown) { mouse._x = mouse._x - 7; } } } i++; } i = 0; while (i <= buttons) { currentResponder = eval ("responder" + i); if (mouse.hitTest(currentResponder)) { mouse._x = mouse._x - 7; } i++; } if (mouse.hitTest(rightbarrier)) { mouse._x = mouse._x - 7; } } else if (Key.isDown(39)) { pressed = true; if (onLand) { mouse.dx = mouse.dx + thrust; mouse.gotoAndStop("left"); } else if (flightJuice > 0) { pressed = true; mouse.dx = mouse.dx + thrust; mouse.gotoAndStop("left"); flightJuice = flightJuice - 1; } mouse.gotoAndStop("right"); i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (i != onLandNum) { if (mouse._y > currentLand._y) { mouse._x = mouse._x + 7; } } } i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (mouse._y > (currentRock._y - 26)) { if (i != notputdown) { mouse._x = mouse._x + 7; } } } i++; } i = 0; while (i <= buttons) { currentResponder = eval ("responder" + i); if (mouse.hitTest(currentResponder)) { mouse._x = mouse._x + 7; } i++; } if (mouse.hitTest(leftbarrier)) { mouse._x = mouse._x + 7; } } else if (mouse.dx < 0) { mouse.dx = mouse.dx + thrust; } else if (mouse.dx > 0) { mouse.dx = mouse.dx - thrust; } if (mouse.dx < 0.1) { if (mouse.dx > 0) { mouse.dx = 0; } } if (mouse.dx > -0.1) { if (mouse.dx < 0) { mouse.dx = 0; } } if (pressed == false) { mouse.gotoAndStop("center"); } if (pressed == true) { if (playsounds) { thrustsoundpauser++; if (thrustsoundpauser == totalforthruster) { thruster.start(0, 1); thrustsoundpauser = 0; } } } if (Key.isDown(32)) { if (donePressSpace) { donePressSpace = false; if (notputdown == -1) { i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (playsounds) { pickup.start(0, 1); } notputdown = i; dx = mouse._x - currentRock._x; dy = mouse._y - currentRock._y; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); } i++; } } else { mouse._y = mouse._y - 5; mouse.dy = mouse.dy - 1; if (playsounds) { pickup.start(0, 1); } currentRock = eval ("rock" + notputdown); currentX = currentRock.oX + globalX; currentY = currentRock.oY + globalY; dx = mouse._x - currentX; dy = mouse._y - currentY; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); notputdown = -1; } } } else { donePressSpace = true; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (i != notputdown) { currentRock.dy = currentRock.dy + gravity; currentRock.oX = currentRock.oX + currentRock.dx; currentRock.oY = currentRock.oY + currentRock.dy; } l = 1; while (l <= lands) { currentLand = eval ("land" + l); if (currentRock.hitTest(currentLand)) { if (currentRock._y < ((currentLand._y + currentRock.dy) + 0.5)) { currentRock.oY = currentLand.oY; currentRock.dy = 0; currentRock.dx = 0; } else if (currentRock._y > (currentLand._y + 25.5)) { currentRock.dy = currentRock.dy * -1; currentRock.oY = currentRock.oY + (currentRock.dy * 2); } else { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 4); } } l++; } b = 1; while (b <= rocks) { otherRock = eval ("rock" + b); if (b != i) { if (currentRock.hitTest(otherRock)) { if (currentRock.oY < otherRock.oY) { currentRock.oY = otherRock.oY - 29; currentRock.dy = 0; currentRock.dx = 0; } } } b++; } b = 0; while (b <= buttons) { currentResponder = eval ("responder" + b); if (currentRock.hitTest(currentResponder)) { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 6); } b++; } i++; } i = 1; while (i <= enemies) { currentEnemy = eval ("enemy" + i); if (currentEnemy.tower == false) { if (currentEnemy.gotoLeft == true) { if (currentEnemy.patrolPoint < currentEnemy.patrolLength) { currentEnemy.oX = currentEnemy.oX + currentEnemy.speed; currentEnemy.patrolPoint = currentEnemy.patrolPoint + currentEnemy.speed; } else { currentEnemy.gotoLeft = false; currentEnemy.gotoAndPlay("turn"); } } else if (currentEnemy.patrolPoint > 0) { currentEnemy.oX = currentEnemy.oX - currentEnemy.speed; currentEnemy.patrolPoint = currentEnemy.patrolPoint - currentEnemy.speed; } else { currentEnemy.gotoLeft = true; currentEnemy.gotoAndPlay("turn"); } } i++; } i = 0; while (i <= enemies) { currentEnemy = eval ("enemy" + i); if (mouse.hitTest(currentEnemy)) { if (currentEnemy.tower == false) { health = health - currentEnemy.damage; } } if (currentEnemy.tower == true) { currentBullet = eval ("bullet" + i); if (mouse.hitTest(currentBullet)) { health = health - currentEnemy.damage; } } i++; } i = 0; while (i <= buttons) { currentButton = eval ("button" + i); currentResponder = eval ("responder" + i); hit = false; r = 0; while (r <= rocks) { currentRock = eval ("rock" + r); if (currentButton.hitTest(currentRock)) { hit = true; if (currentButton.pressed == false) { currentButton.pressed = true; currentResponder.oX = currentResponder.oX + 10000; } } r++; } if (mousehitsbuttons == true) { if (mouse.hitTest(currentButton)) { hit = true; if (currentButton.pressed == false) { currentButton.pressed = true; currentResponder.oX = currentResponder.oX + 10000; } } } if (hit == false) { if (currentButton.pressed == true) { currentButton.pressed = false; currentResponder.oX = currentResponder.oX - 10000; currentResponder.alpha = 0; } } i++; } currentResponder.fadeOut = false; currentResponder.alpha = 100; currentResponder.speed = 6; if (mouse.hitTest(end)) { if (win == false) { level++; winS.start(0, 1); end.gotoAndPlay("win"); win = true; } } i = 0; while (i <= enemies) { currentTower = eval ("enemy" + i); if (currentTower.tower == true) { currentTop = eval ("towertop" + i); currentBullet = eval ("bullet" + i); currentTop._x = currentTower._x; currentTop._y = currentTower._y - (95 * (currentTower._yscale / 100)); currentTop._yscale = currentTower._yscale; dx = currentTop._x - mouse._x; dy = currentTop._y - mouse._y; radians = Math.atan(dy / dx); degrees = (radians * 180) / Math.PI; if (dx > 0) { degrees = degrees + 180; } radians = (degrees / 180) * Math.PI; degrees = degrees + 90; currentTop._rotation = degrees; distance = Math.sqrt((dx * dx) + (dy * dy)); currentTower.counter++; if (currentTower.counter >= currentTower.counterLimit) { currentTower.counter = 0; currentBullet.oX = currentTower.oX; currentBullet.oY = currentTower.oY - (95 * (currentTower._yscale / 100)); currentBullet.dx = Math.cos(radians) * currentTower.launchSpeed; currentBullet.dy = Math.sin(radians) * currentTower.launchSpeed; } currentBullet.oX = currentBullet.oX + currentBullet.dx; currentBullet.oY = currentBullet.oY + currentBullet.dy; } i++; } }; menu.onRelease = function () { gotoAndStop ("menu"); }; currentAlpha = 100; faderbox._alpha = currentAlpha; fadeOut = function () { if (loading == true) { faderbox.gotoAndStop("blue"); } if (loading == false) { faderbox.gotoAndStop("red"); } currentAlpha = currentAlpha + speed; if (currentAlpha >= 100) { currentAlpha = 100; if (loading == true) { gotoAndStop ("loading"); } if (loading == false) { gotoAndStop ("lose"); } } faderbox._x = 0; faderbox._y = 0; faderbox._alpha = currentAlpha; }; fadeIn = function () { faderbox.gotoAndStop("blue"); currentAlpha = currentAlpha - speed; if (currentAlpha <= 0) { currentAlpha = 0; faderbox._x = -10000; faderbox._y = -10000; } faderbox._alpha = currentAlpha; if (health < topHealth) { faderbox.gotoAndStop("red"); faderbox._x = 0; faderbox._y = 0; faderbox._alpha = (100 - (health * healthMultiplier)) - 20; if (faderbox._alpha < 0) { faderbox._alpha = 0; } currentAlpha = faderbox._alpha; } };
Frame 102
lands = 12; total = 0; rocks = 6; objects = 5; buttons = 3; enemies = 8; notputdown = -1; health = topHealth; healthMultiplier = 100 / health; flightJuice = topFlightJuice; flightMultiplier = 100 / flightJuice; mouse.maxWidth = 62.1; landWidth = 188; onLandNum = 0; globalX = 0; globalY = 0; win = false; mousehitsbuttons = false; topsmoke = 5; smoke = 0; thrustsoundpauser = 0; totalforthruster = 4; fadein = true; loading = true; stop(); mouse = eval (type); mouse._x = startX._x; mouse._y = startX._y; startX._x = -100; startX._y = -100; mouse.dy = 0; mouse.dx = 0; mouse.oX = mouse._x; mouse.oY = mouse._y; explosion.oX = -10000; explosion.oY = -10000; leftbarrier.oX = leftbarrier._x; leftbarrier.oY = leftbarrier._y; rightbarrier.oX = rightbarrier._x; rightbarrier.oY = rightbarrier._y; topbarrier.oX = topbarrier._x; topbarrier.oY = topbarrier._y; bottombarrier.oX = bottombarrier._x; bottombarrier.oY = bottombarrier._y; end.oX = end._x; end.oY = end._y; enemy1.tower = false; enemy2.tower = false; enemy3.tower = false; enemy4.tower = false; enemy5.tower = true; enemy6.tower = true; enemy7.tower = true; enemy8.tower = true; enemy2._xscale = enemy2._xscale * -1; i = 0; while (i <= objects) { currentObject = eval ("object" + i); currentObject.oX = currentObject._x; currentObject.oY = currentObject._y; i++; } enemy1.gotoLeft = true; i = 1; while (i <= enemies) { currentEnemy = eval ("enemy" + i); currentEnemy.health = 8; currentEnemy.speed = 2; firstFlag = eval ("firstPatrolMarker" + i); secondFlag = eval ("secondPatrolMarker" + i); currentEnemy.patrolLength = secondFlag._x - firstFlag._x; currentEnemy.patrolPoint = currentEnemy._x - firstFlag._x; firstFlag._x = -100; secondFlag._x = -100; currentEnemy.damage = 1; currentEnemy.oX = currentEnemy._x; currentEnemy.oY = currentEnemy._y; currentEnemy.dead = false; currentEnemy.gotoLeft = true; i++; } enemy2.gotoLeft = false; enemy1.speed = 4.5; enemy2.speed = 4.5; i = 0; while (i <= enemies) { currentEnemy = eval ("enemy" + i); if (currentEnemy.tower == true) { currentEnemy.counter = 0; currentEnemy.counterLimit = 60; currentEnemy.launchSpeed = 2; currentEnemy.health = 20; } i++; } i = 0; while (i <= buttons) { currentButton = eval ("button" + i); currentButton.pressed = false; currentButton.oX = currentButton._x; currentButton.oY = currentButton._y; currentResponder = eval ("responder" + i); currentResponder.oX = currentResponder._x; currentResponder.oY = currentResponder._y; currentResponder.fadeOut = false; currentResponder.alpha = 100; currentResponder.speed = 6; i++; } i = 0; while (i <= rocks) { currentRock = eval ("rock" + i); currentRock.oX = currentRock._x; currentRock.oY = currentRock._y; currentRock.dx = 0; currentRock.dy = 0; currentRock.originX = currentRock._x; currentRock.originY = currentRock._y; i++; } i = 0; while (i <= lands) { currentLand = eval ("land" + i); currentLand.oX = currentLand._x; currentLand.oY = currentLand._y; i++; } mouse.onEnterFrame = function () { if (fadein == true) { fadeIn(); } else { fadeOut(); } mouse.dy = mouse.dy + gravity; mouse._y = mouse._y + mouse.dy; mouse._x = mouse._x + mouse.dx; healthbar._xscale = health * healthMultiplier; if (flightJuice > 0) { flightbar._xscale = flightJuice * flightMultiplier; } if (health <= 0) { fadein = false; loading = false; } if (health < topHealth) { health = health + (regenerateRate / 5); } if (flightJuice < topFlightJuice) { flightJuice = flightJuice + regenerateRate; } dx = (Stage.width / 2) - mouse._x; dy = (Stage.width / 2) - mouse._y; dx = dx / 4; dy = dy / 4; if (mouse.dx > topspeed) { mouse.dx = topspeed; } if (mouse.dx < (-topspeed)) { mouse.dx = -topspeed; } if (mouse.dy > topspeed) { mouse.dy = topspeed; } if (mouse.dy < (-topspeed)) { mouse.dy = -topspeed; } globalX = globalX + dx; globalY = globalY + dy; i = 1; while (i <= lands) { currentLand = eval ("land" + i); currentLand._x = currentLand.oX + globalX; currentLand._y = currentLand.oY + globalY; i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); currentRock._x = currentRock.oX + globalX; currentRock._y = currentRock.oY + globalY; i++; } i = 1; while (i <= enemies) { currentEnemy = eval ("enemy" + i); currentEnemy._x = currentEnemy.oX + globalX; currentEnemy._y = currentEnemy.oY + globalY; if (currentEnemy.tower) { currentBullet = eval ("bullet" + i); currentBullet._x = currentBullet.oX + globalX; currentBullet._y = currentBullet.oY + globalY; } i++; } explosion._x = explosion.oX + globalX; explosion._y = explosion.oY + globalY; i = 0; while (i <= buttons) { currentButton = eval ("button" + i); currentResponder = eval ("responder" + i); currentButton._x = currentButton.oX + globalX; currentButton._y = currentButton.oY + globalY; currentResponder._x = currentResponder.oX + globalX; currentResponder._y = currentResponder.oY + globalY; i++; } i = 0; while (i <= objects) { currentObject = eval ("object" + i); currentObject._x = currentObject.oX + globalX; currentObject._y = currentObject.oY + globalY; i++; } leftbarrier._x = leftbarrier.oX + globalX; leftbarrier._y = leftbarrier.oY + globalY; rightbarrier._x = rightbarrier.oX + globalX; rightbarrier._y = rightbarrier.oY + globalY; topbarrier._x = topbarrier.oX + globalX; topbarrier._y = topbarrier.oY + globalY; bottombarrier._x = bottombarrier.oX + globalX; bottombarrier._y = bottombarrier.oY + globalY; end._x = end.oX + globalX; end._y = end.oY + globalY; mouse.oX = mouse.oX + dx; mouse.oY = mouse.oY + dy; mouse._y = mouse._y + dy; mouse._x = mouse._x + dx; bg._x = bg._x + (dx / 3); bg._y = bg._y + (dy / 3); if (notputdown != -1) { currentRock = eval ("rock" + notputdown); currentRock._x = mouse._x; currentRock._y = mouse._y + 25; currentRock.dx = mouse.dx; currentRock.dy = mouse.dy; } onLand = false; i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (mouse._y < (currentLand._y + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = currentLand._y; onLand = true; onLandNum = i; } else if (mouse._y > (((currentLand._y + 35.5) + 25.4) + (mouse.dy * 1.2))) { mouse.dy = mouse.dy * -1; mouse._y = mouse._y + (mouse.dy * 1.5); } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } i++; } if (notputdown != -1) { currentRock = eval ("rock" + notputdown); i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (currentRock.hitTest(currentLand)) { if (currentRock._y < (currentLand._y + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = currentLand._y - 25; onLand = true; onLandNum = i; } else if (currentRock._y > (((currentLand._y + 35) + 27) + (mouse.dy * 1.2))) { mouse.dy = mouse.dy * -1; mouse._y = mouse._y + (mouse.dy * 1.5); } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } i++; } notDropRock = eval ("rock" + notputdown); i = 1; while (i <= rocks) { if (i != notputdown) { currentRock = eval ("rock" + i); if (notDropRock.hitTest(currentRock)) { if (notDropRock._y < ((currentRock._y - 25) + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = currentRock._y - 54; onLand = true; } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } } i++; } } if (mouse.hitTest(leftbarrier)) { mouse.dx = mouse.dx * -1; mouse.oX = mouse.oX + (mouse.dx * 6); } if (mouse.hitTest(rightbarrier)) { mouse.dx = mouse.dx * -1; mouse.oX = mouse.oX + (mouse.dx * 6); } if (mouse.hitTest(topbarrier)) { mouse.dy = mouse.dy * -1; mouse.oY = mouse.oY + (mouse.dy * 6); } if (mouse.hitTest(bottombarrier)) { mouse.dy = mouse.dy * -1; mouse.oY = mouse.oY + (mouse.dy * 6); } i = 0; while (i <= rocks) { currentRock = eval ("rock" + i); if (currentRock.hitTest(leftbarrier)) { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 6); } if (currentRock.hitTest(rightbarrier)) { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 6); } if (currentRock.hitTest(topbarrier)) { currentRock.dy = currentRock.dy * -1; currentRock.oY = currentRock.oY + (currentRock.dy * 6); } if (currentRock.hitTest(bottombarrier)) { currentRock.dy = currentRock.dy * -1; currentRock.oX = currentRock.oX + (currentRock.dy * 6); } i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); e = 1; while (e <= enemies) { currentEnemy = eval ("enemy" + e); if (currentRock.hitTest(currentEnemy)) { if (currentRock._y < currentEnemy._y) { if (currentRock.dy > 0) { if (playsounds) { } currentEnemy.health = currentEnemy.health - currentRock.dy; if (currentEnemy.tower == false) { currentEnemy._yscale = currentEnemy.health * 10; } else { currentEnemy._yscale = currentEnemy.health * 5; } currentEnemy.speed = 0; currentRock.dy = 0; currentRock.dx = 0; if (notputdown == i) { mouse._y = mouse._y - 5; mouse.dy = mouse.dy - 1; currentX = currentRock.oX + globalX; currentY = currentRock.oY + globalY; dx = mouse._x - currentX; dy = mouse._y - currentY; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); notputdown = -1; } if (currentEnemy.health <= 1) { if (i != notputdown) { if (playsounds) { explosionS.start(0, 1); } explosion.oX = currentEnemy.oX; explosion.oY = currentEnemy.oY; if (currentEnemy.tower == true) { explosion._yscale = 200; explosion._xscale = 100; } else { explosion._yscale = 65; explosion._xscale = 65; } explosion.gotoAndPlay(1); currentEnemy.oX = -1000; currentEnemy.oY = -1000; } else { if (playsounds) { explosionS.start(0, 1); } if (currentEnemy.tower == true) { explosion._yscale = 200; explosion._xscale = 100; } else { explosion._yscale = 65; explosion._xscale = 65; } explosion.gotoAndPlay(1); currentEnemy.oX = -1000; currentEnemy.oY = -1000; mouse._y = mouse._y - 5; mouse.dy = mouse.dy - 1; currentX = currentRock.oX + globalX; currentY = currentRock.oY + globalY; dx = mouse._x - currentX; dy = mouse._y - currentY; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); notputdown = -1; } currentEnemy.dead = true; } } } } e++; } i++; } i = 1; while (i <= rocks) { if (i != notputdown) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (mouse._y < ((currentRock._y - 25) + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = (currentRock.oY + globalY) - 26; onLand = true; } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } } i++; } i = 0; while (i <= buttons) { currentResponder = eval ("responder" + i); if (mouse.hitTest(currentResponder)) { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } i++; } pressed = false; if (Key.isDown(38)) { if (onLand) { mouse.dy = -2; mouse._y = mouse._y + mouse.dy; } else if (flightJuice > 0) { pressed = true; mouse.gotoAndStop("up"); mouse.dy = mouse.dy - thrust; flightJuice = flightJuice - 1; } } if (Key.isDown(40)) { if (onLand) { } else if (flightJuice > 0) { pressed = true; mouse.gotoAndStop("down"); mouse.dy = mouse.dy + thrust; flightJuice = flightJuice - 1; } if (mouse.hitTest(topbarrier)) { mouse._y = mouse._y + 7; } i = 0; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (currentLand._y < (mouse._y - 5)) { mouse._y = mouse._y + 7; } } i++; } } if (Key.isDown(37)) { pressed = true; if (onLand) { mouse.dx = mouse.dx - thrust; mouse.gotoAndStop("left"); } else if (flightJuice > 0) { pressed = true; mouse.dx = mouse.dx - thrust; mouse.gotoAndStop("left"); flightJuice = flightJuice - 1; } i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (i != onLandNum) { if (mouse._y > currentLand._y) { mouse._x = mouse._x - 7; } } } i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (mouse._y > (currentRock._y - 26)) { if (i != notputdown) { mouse._x = mouse._x - 7; } } } i++; } i = 0; while (i <= buttons) { currentResponder = eval ("responder" + i); if (mouse.hitTest(currentResponder)) { mouse._x = mouse._x - 7; } i++; } if (mouse.hitTest(rightbarrier)) { mouse._x = mouse._x - 7; } } else if (Key.isDown(39)) { pressed = true; if (onLand) { mouse.dx = mouse.dx + thrust; mouse.gotoAndStop("left"); } else if (flightJuice > 0) { pressed = true; mouse.dx = mouse.dx + thrust; mouse.gotoAndStop("left"); flightJuice = flightJuice - 1; } mouse.gotoAndStop("right"); i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (i != onLandNum) { if (mouse._y > currentLand._y) { mouse._x = mouse._x + 7; } } } i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (mouse._y > (currentRock._y - 26)) { if (i != notputdown) { mouse._x = mouse._x + 7; } } } i++; } i = 0; while (i <= buttons) { currentResponder = eval ("responder" + i); if (mouse.hitTest(currentResponder)) { mouse._x = mouse._x + 7; } i++; } if (mouse.hitTest(leftbarrier)) { mouse._x = mouse._x + 7; } } else if (mouse.dx < 0) { mouse.dx = mouse.dx + thrust; } else if (mouse.dx > 0) { mouse.dx = mouse.dx - thrust; } if (mouse.dx < 0.1) { if (mouse.dx > 0) { mouse.dx = 0; } } if (mouse.dx > -0.1) { if (mouse.dx < 0) { mouse.dx = 0; } } if (pressed == false) { mouse.gotoAndStop("center"); } if (pressed == true) { if (playsounds) { thrustsoundpauser++; if (thrustsoundpauser == totalforthruster) { thruster.start(0, 1); thrustsoundpauser = 0; } } } if (Key.isDown(32)) { if (donePressSpace) { donePressSpace = false; if (notputdown == -1) { i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (playsounds) { pickup.start(0, 1); } notputdown = i; dx = mouse._x - currentRock._x; dy = mouse._y - currentRock._y; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); } i++; } } else { mouse._y = mouse._y - 5; mouse.dy = mouse.dy - 1; if (playsounds) { pickup.start(0, 1); } currentRock = eval ("rock" + notputdown); currentX = currentRock.oX + globalX; currentY = currentRock.oY + globalY; dx = mouse._x - currentX; dy = mouse._y - currentY; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); notputdown = -1; } } } else { donePressSpace = true; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (i != notputdown) { currentRock.dy = currentRock.dy + gravity; currentRock.oX = currentRock.oX + currentRock.dx; currentRock.oY = currentRock.oY + currentRock.dy; } l = 1; while (l <= lands) { currentLand = eval ("land" + l); if (currentRock.hitTest(currentLand)) { if (currentRock._y < ((currentLand._y + currentRock.dy) + 0.5)) { currentRock.oY = currentLand.oY; currentRock.dy = 0; currentRock.dx = 0; } else if (currentRock._y > (currentLand._y + 25.5)) { currentRock.dy = currentRock.dy * -1; currentRock.oY = currentRock.oY + (currentRock.dy * 2); } else { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 4); } } l++; } b = 1; while (b <= rocks) { otherRock = eval ("rock" + b); if (b != i) { if (currentRock.hitTest(otherRock)) { if (currentRock.oY < otherRock.oY) { currentRock.oY = otherRock.oY - 29; currentRock.dy = 0; currentRock.dx = 0; } } } b++; } b = 0; while (b <= buttons) { currentResponder = eval ("responder" + b); if (currentRock.hitTest(currentResponder)) { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 6); } b++; } i++; } i = 1; while (i <= enemies) { currentEnemy = eval ("enemy" + i); if (currentEnemy.tower == false) { if (currentEnemy.gotoLeft == true) { if (currentEnemy.patrolPoint < currentEnemy.patrolLength) { currentEnemy.oX = currentEnemy.oX + currentEnemy.speed; currentEnemy.patrolPoint = currentEnemy.patrolPoint + currentEnemy.speed; } else { currentEnemy.speed = 0; currentEnemy.gotoAndPlay("turn"); } } else if (currentEnemy.patrolPoint > 0) { currentEnemy.oX = currentEnemy.oX - currentEnemy.speed; currentEnemy.patrolPoint = currentEnemy.patrolPoint - currentEnemy.speed; } else { currentEnemy.speed = 0; currentEnemy.gotoAndPlay("turn"); } } i++; } i = 0; while (i <= enemies) { currentEnemy = eval ("enemy" + i); if (mouse.hitTest(currentEnemy)) { if (currentEnemy.tower == false) { health = health - currentEnemy.damage; } } if (currentEnemy.tower == true) { currentBullet = eval ("bullet" + i); if (mouse.hitTest(currentBullet)) { health = health - currentEnemy.damage; } } i++; } i = 0; while (i <= buttons) { currentButton = eval ("button" + i); currentResponder = eval ("responder" + i); hit = false; r = 0; while (r <= rocks) { currentRock = eval ("rock" + r); if (currentButton.hitTest(currentRock)) { hit = true; if (currentButton.pressed == false) { currentButton.pressed = true; currentResponder.oX = currentResponder.oX + 10000; } } r++; } if (mousehitsbuttons == true) { if (mouse.hitTest(currentButton)) { hit = true; if (currentButton.pressed == false) { currentButton.pressed = true; currentResponder.oX = currentResponder.oX + 10000; } } } if (hit == false) { if (currentButton.pressed == true) { currentButton.pressed = false; currentResponder.oX = currentResponder.oX - 10000; currentResponder.alpha = 0; } } i++; } currentResponder.fadeOut = false; currentResponder.alpha = 100; currentResponder.speed = 6; if (mouse.hitTest(end)) { if (win == false) { level++; winS.start(0, 1); end.gotoAndPlay("win"); win = true; } } i = 0; while (i <= enemies) { currentTower = eval ("enemy" + i); if (currentTower.tower == true) { currentTop = eval ("towertop" + i); currentBullet = eval ("bullet" + i); currentTop._x = currentTower._x; currentTop._y = currentTower._y - (95 * (currentTower._yscale / 100)); currentTop._yscale = currentTower._yscale; dx = currentTop._x - mouse._x; dy = currentTop._y - mouse._y; radians = Math.atan(dy / dx); degrees = (radians * 180) / Math.PI; if (dx > 0) { degrees = degrees + 180; } radians = (degrees / 180) * Math.PI; degrees = degrees + 90; currentTop._rotation = degrees; distance = Math.sqrt((dx * dx) + (dy * dy)); currentTower.counter++; if (currentTower.counter >= currentTower.counterLimit) { currentTower.counter = 0; currentBullet.oX = currentTower.oX; currentBullet.oY = currentTower.oY - (95 * (currentTower._yscale / 100)); currentBullet.dx = Math.cos(radians) * currentTower.launchSpeed; currentBullet.dy = Math.sin(radians) * currentTower.launchSpeed; } currentBullet.oX = currentBullet.oX + currentBullet.dx; currentBullet.oY = currentBullet.oY + currentBullet.dy; } i++; } }; menu.onRelease = function () { gotoAndStop ("menu"); }; currentAlpha = 100; faderbox._alpha = currentAlpha; fadeOut = function () { if (loading == true) { faderbox.gotoAndStop("blue"); } if (loading == false) { faderbox.gotoAndStop("red"); } currentAlpha = currentAlpha + speed; if (currentAlpha >= 100) { currentAlpha = 100; if (loading == true) { gotoAndStop ("loading"); } if (loading == false) { gotoAndStop ("lose"); } } faderbox._x = 0; faderbox._y = 0; faderbox._alpha = currentAlpha; }; fadeIn = function () { faderbox.gotoAndStop("blue"); currentAlpha = currentAlpha - speed; if (currentAlpha <= 0) { currentAlpha = 0; faderbox._x = -10000; faderbox._y = -10000; } faderbox._alpha = currentAlpha; if (health < topHealth) { faderbox.gotoAndStop("red"); faderbox._x = 0; faderbox._y = 0; faderbox._alpha = (100 - (health * healthMultiplier)) - 20; if (faderbox._alpha < 0) { faderbox._alpha = 0; } currentAlpha = faderbox._alpha; } };
Frame 103
lands = 12; total = 0; rocks = 6; objects = 1; buttons = 0; enemies = 1; notputdown = -1; health = topHealth; healthMultiplier = 100 / health; flightJuice = topFlightJuice; flightMultiplier = 100 / flightJuice; mouse.maxWidth = 62.1; landWidth = 188; onLandNum = 0; globalX = 0; globalY = 0; win = false; mousehitsbuttons = false; topsmoke = 5; smoke = 1; smokedelay = 2; smokepauser = 0; thrustsoundpauser = 0; totalforthruster = 4; fadein = true; loading = true; stop(); mouse = eval (type); mouse._x = startX._x; mouse._y = startX._y; startX._x = -100; startX._y = -100; mouse.dy = 0; mouse.dx = 0; mouse.oX = mouse._x; mouse.oY = mouse._y; explosion.oX = -10000; explosion.oY = -10000; leftbarrier.oX = leftbarrier._x; leftbarrier.oY = leftbarrier._y; rightbarrier.oX = rightbarrier._x; rightbarrier.oY = rightbarrier._y; topbarrier.oX = topbarrier._x; topbarrier.oY = topbarrier._y; bottombarrier.oX = bottombarrier._x; bottombarrier.oY = bottombarrier._y; end.oX = end._x; end.oY = end._y; enemy1.tower = true; i = 0; while (i <= objects) { currentObject = eval ("object" + i); currentObject.oX = currentObject._x; currentObject.oY = currentObject._y; i++; } i = 0; while (i <= enemies) { currentEnemy = eval ("enemy" + i); if (currentEnemy.tower == true) { currentEnemy.counter = 0; currentEnemy.counterLimit = 60; currentEnemy.launchSpeed = 5; currentEnemy.health = 15; currentEnemy.divisor = 100 / currentEnemy.health; currentBullet = eval ("bullet" + i); currentBullet.oX = -1000; currentBullet.oY = -1000; } currentEnemy.damage = 2; currentEnemy.oX = currentEnemy._x; currentEnemy.oY = currentEnemy._y; currentEnemy.dead = false; currentEnemy.movespeed = 2; i++; } i = 0; while (i <= buttons) { currentButton = eval ("button" + i); currentButton.pressed = false; currentButton.oX = currentButton._x; currentButton.oY = currentButton._y; currentResponder = eval ("responder" + i); currentResponder.oX = currentResponder._x; currentResponder.oY = currentResponder._y; currentResponder.fadeOut = false; currentResponder.alpha = 100; currentResponder.speed = 6; i++; } i = 0; while (i <= rocks) { currentRock = eval ("rock" + i); currentRock.oX = currentRock._x; currentRock.oY = currentRock._y; currentRock.dx = 0; currentRock.dy = 0; currentRock.originX = currentRock._x; currentRock.originY = currentRock._y; i++; } i = 0; while (i <= lands) { currentLand = eval ("land" + i); currentLand.oX = currentLand._x; currentLand.oY = currentLand._y; i++; } mouse.onEnterFrame = function () { if (smoke < topsmoke) { if (smokepauser == smokedelay) { smoke++; duplicateMovieClip (smokeS, "smoke" + smoke, smoke); cSmoke = eval ("smoke" + smoke); cSmoke.oX = enemy1.oX; cSmoke.oY = enemy1.oY - 30; goX = Math.cos(radians) * -50; goY = Math.sin(radians) * -50; cSmoke.oX = cSmoke.oX + goX; cSmoke.oY = cSmoke.oY + goY; cSmoke.dx = goX / 3; cSmoke.dy = goY / 3; smokepauser = 0; } else { smokepauser++; } } else { smoke = 1; } walrushealth._xscale = enemy1.health * enemy1.divisor; if (fadein == true) { fadeIn(); } else { fadeOut(); } mouse.dy = mouse.dy + gravity; mouse._y = mouse._y + mouse.dy; mouse._x = mouse._x + mouse.dx; healthbar._xscale = health * healthMultiplier; if (flightJuice > 0) { flightbar._xscale = flightJuice * flightMultiplier; } if (health <= 0) { fadein = false; loading = false; } if (health < topHealth) { health = health + (regenerateRate / 5); } if (flightJuice < topFlightJuice) { flightJuice = flightJuice + regenerateRate; } dx = (Stage.width / 2) - mouse._x; dy = (Stage.width / 2) - mouse._y; dx = dx / 4; dy = dy / 4; if (mouse.dx > topspeed) { mouse.dx = topspeed; } if (mouse.dx < (-topspeed)) { mouse.dx = -topspeed; } if (mouse.dy > topspeed) { mouse.dy = topspeed; } if (mouse.dy < (-topspeed)) { mouse.dy = -topspeed; } globalX = globalX + dx; globalY = globalY + dy; i = 1; while (i <= lands) { currentLand = eval ("land" + i); currentLand._x = currentLand.oX + globalX; currentLand._y = currentLand.oY + globalY; i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); currentRock._x = currentRock.oX + globalX; currentRock._y = currentRock.oY + globalY; i++; } i = 1; while (i <= topsmoke) { cSmoke = eval ("smoke" + i); cSmoke.oX = cSmoke.oX + cSmoke.dx; cSmoke.oY = cSmoke.oY + cSmoke.dy; cSmoke._x = cSmoke.oX + globalX; cSmoke._y = cSmoke.oY + globalY; i++; } i = 1; while (i <= enemies) { currentEnemy = eval ("enemy" + i); currentEnemy._x = currentEnemy.oX + globalX; currentEnemy._y = currentEnemy.oY + globalY; if (currentEnemy.tower) { currentBullet = eval ("bullet" + i); currentBullet._x = currentBullet.oX + globalX; currentBullet._y = currentBullet.oY + globalY; } i++; } explosion._x = explosion.oX + globalX; explosion._y = explosion.oY + globalY; i = 0; while (i <= buttons) { currentButton = eval ("button" + i); currentResponder = eval ("responder" + i); currentButton._x = currentButton.oX + globalX; currentButton._y = currentButton.oY + globalY; currentResponder._x = currentResponder.oX + globalX; currentResponder._y = currentResponder.oY + globalY; i++; } i = 0; while (i <= objects) { currentObject = eval ("object" + i); currentObject._x = currentObject.oX + globalX; currentObject._y = currentObject.oY + globalY; i++; } leftbarrier._x = leftbarrier.oX + globalX; leftbarrier._y = leftbarrier.oY + globalY; rightbarrier._x = rightbarrier.oX + globalX; rightbarrier._y = rightbarrier.oY + globalY; topbarrier._x = topbarrier.oX + globalX; topbarrier._y = topbarrier.oY + globalY; bottombarrier._x = bottombarrier.oX + globalX; bottombarrier._y = bottombarrier.oY + globalY; end._x = end.oX + globalX; end._y = end.oY + globalY; mouse.oX = mouse.oX + dx; mouse.oY = mouse.oY + dy; mouse._y = mouse._y + dy; mouse._x = mouse._x + dx; bg._x = bg._x + (dx / 3); bg._y = bg._y + (dy / 3); if (notputdown != -1) { currentRock = eval ("rock" + notputdown); currentRock._x = mouse._x; currentRock._y = mouse._y + 25; currentRock.dx = mouse.dx; currentRock.dy = mouse.dy; } onLand = false; i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (mouse._y < (currentLand._y + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = currentLand._y; onLand = true; onLandNum = i; } else if (mouse._y > (((currentLand._y + 35.5) + 25.4) + (mouse.dy * 1.2))) { mouse.dy = mouse.dy * -1; mouse._y = mouse._y + (mouse.dy * 1.5); } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } i++; } if (notputdown != -1) { currentRock = eval ("rock" + notputdown); i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (currentRock.hitTest(currentLand)) { if (currentRock._y < (currentLand._y + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = currentLand._y - 25; onLand = true; onLandNum = i; } else if (currentRock._y > (((currentLand._y + 35) + 27) + (mouse.dy * 1.2))) { mouse.dy = mouse.dy * -1; mouse._y = mouse._y + (mouse.dy * 1.5); } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } i++; } notDropRock = eval ("rock" + notputdown); i = 1; while (i <= rocks) { if (i != notputdown) { currentRock = eval ("rock" + i); if (notDropRock.hitTest(currentRock)) { if (notDropRock._y < ((currentRock._y - 25) + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = currentRock._y - 54; onLand = true; } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } } i++; } } if (mouse.hitTest(leftbarrier)) { mouse.dx = mouse.dx * -1; mouse.oX = mouse.oX + (mouse.dx * 6); } if (mouse.hitTest(rightbarrier)) { mouse.dx = mouse.dx * -1; mouse.oX = mouse.oX + (mouse.dx * 6); } if (mouse.hitTest(topbarrier)) { mouse.dy = mouse.dy * -1; mouse.oY = mouse.oY + (mouse.dy * 6); } if (mouse.hitTest(bottombarrier)) { mouse.dy = mouse.dy * -1; mouse.oY = mouse.oY + (mouse.dy * 6); } i = 0; while (i <= rocks) { currentRock = eval ("rock" + i); if (currentRock.hitTest(leftbarrier)) { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 6); } if (currentRock.hitTest(rightbarrier)) { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 6); } if (currentRock.hitTest(topbarrier)) { currentRock.dy = currentRock.dy * -1; currentRock.oY = currentRock.oY + (currentRock.dy * 6); } if (currentRock.hitTest(bottombarrier)) { currentRock.dy = currentRock.dy * -1; currentRock.oX = currentRock.oX + (currentRock.dy * 6); } i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); e = 1; while (e <= enemies) { currentEnemy = eval ("enemy" + e); if (currentRock.hitTest(currentEnemy)) { if (currentRock._y < currentEnemy._y) { if (currentRock.dy > 0) { if (playsounds) { } currentEnemy.health = currentEnemy.health - currentRock.dy; if (currentEnemy.tower == false) { } currentEnemy.speed = 0; currentRock.dy = 0; currentRock.dx = 0; if (notputdown == i) { mouse._y = mouse._y - 5; mouse.dy = mouse.dy - 1; currentX = currentRock.oX + globalX; currentY = currentRock.oY + globalY; dx = mouse._x - currentX; dy = mouse._y - currentY; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); notputdown = -1; } if (currentEnemy.health <= 1) { if (i != notputdown) { if (playsounds) { bossexplosion.start(0, 1); } explosion.oX = currentEnemy.oX; explosion.oY = currentEnemy.oY; if (currentEnemy.tower == true) { explosion._yscale = 500; explosion._xscale = 500; } else { explosion._yscale = 65; explosion._xscale = 65; } explosion.gotoAndPlay(1); currentEnemy.oX = -1000; currentEnemy.oY = -1000; currentEnemy.dead = true; speed = 1.5; fadein = false; healthbar._xscale = 0; } else { if (playsounds) { explosionS.start(0, 1); } if (currentEnemy.tower == true) { explosion._yscale = 200; explosion._xscale = 100; } else { explosion._yscale = 65; explosion._xscale = 65; } explosion.gotoAndPlay(1); currentEnemy.oX = -1000; currentEnemy.oY = -1000; mouse._y = mouse._y - 5; mouse.dy = mouse.dy - 1; currentX = currentRock.oX + globalX; currentY = currentRock.oY + globalY; dx = mouse._x - currentX; dy = mouse._y - currentY; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); notputdown = -1; } currentEnemy.dead = true; } } } } e++; } i++; } i = 1; while (i <= rocks) { if (i != notputdown) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (mouse._y < ((currentRock._y - 25) + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = (currentRock.oY + globalY) - 26; onLand = true; } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } } i++; } i = 0; while (i <= buttons) { currentResponder = eval ("responder" + i); if (mouse.hitTest(currentResponder)) { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } i++; } pressed = false; if (Key.isDown(38)) { if (onLand) { mouse.dy = -2; mouse._y = mouse._y + mouse.dy; } else if (flightJuice > 0) { pressed = true; mouse.gotoAndStop("up"); mouse.dy = mouse.dy - thrust; flightJuice = flightJuice - 1; } } if (Key.isDown(40)) { if (onLand) { } else if (flightJuice > 0) { pressed = true; mouse.gotoAndStop("down"); mouse.dy = mouse.dy + thrust; flightJuice = flightJuice - 1; } if (mouse.hitTest(topbarrier)) { mouse._y = mouse._y + 7; } i = 0; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (currentLand._y < (mouse._y - 5)) { mouse._y = mouse._y + 7; } } i++; } } if (Key.isDown(37)) { pressed = true; if (onLand) { mouse.dx = mouse.dx - thrust; mouse.gotoAndStop("left"); } else if (flightJuice > 0) { pressed = true; mouse.dx = mouse.dx - thrust; mouse.gotoAndStop("left"); flightJuice = flightJuice - 1; } i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (i != onLandNum) { if (mouse._y > currentLand._y) { mouse._x = mouse._x - 7; } } } i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (mouse._y > (currentRock._y - 26)) { if (i != notputdown) { mouse._x = mouse._x - 7; } } } i++; } i = 0; while (i <= buttons) { currentResponder = eval ("responder" + i); if (mouse.hitTest(currentResponder)) { mouse._x = mouse._x - 7; } i++; } if (mouse.hitTest(rightbarrier)) { mouse._x = mouse._x - 7; } } else if (Key.isDown(39)) { pressed = true; if (onLand) { mouse.dx = mouse.dx + thrust; mouse.gotoAndStop("left"); } else if (flightJuice > 0) { pressed = true; mouse.dx = mouse.dx + thrust; mouse.gotoAndStop("left"); flightJuice = flightJuice - 1; } mouse.gotoAndStop("right"); i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (i != onLandNum) { if (mouse._y > currentLand._y) { mouse._x = mouse._x + 7; } } } i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (mouse._y > (currentRock._y - 26)) { if (i != notputdown) { mouse._x = mouse._x + 7; } } } i++; } i = 0; while (i <= buttons) { currentResponder = eval ("responder" + i); if (mouse.hitTest(currentResponder)) { mouse._x = mouse._x + 7; } i++; } if (mouse.hitTest(leftbarrier)) { mouse._x = mouse._x + 7; } } else if (mouse.dx < 0) { mouse.dx = mouse.dx + thrust; } else if (mouse.dx > 0) { mouse.dx = mouse.dx - thrust; } if (mouse.dx < 0.1) { if (mouse.dx > 0) { mouse.dx = 0; } } if (mouse.dx > -0.1) { if (mouse.dx < 0) { mouse.dx = 0; } } if (pressed == false) { mouse.gotoAndStop("center"); } if (pressed == true) { if (playsounds) { thrustsoundpauser++; if (thrustsoundpauser == totalforthruster) { thruster.start(0, 1); thrustsoundpauser = 0; } } } if (Key.isDown(32)) { if (donePressSpace) { donePressSpace = false; if (notputdown == -1) { i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (playsounds) { pickup.start(0, 1); } notputdown = i; dx = mouse._x - currentRock._x; dy = mouse._y - currentRock._y; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); } i++; } } else { mouse._y = mouse._y - 5; mouse.dy = mouse.dy - 1; if (playsounds) { pickup.start(0, 1); } currentRock = eval ("rock" + notputdown); currentX = currentRock.oX + globalX; currentY = currentRock.oY + globalY; dx = mouse._x - currentX; dy = mouse._y - currentY; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); notputdown = -1; } } } else { donePressSpace = true; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (i != notputdown) { currentRock.dy = currentRock.dy + gravity; currentRock.oX = currentRock.oX + currentRock.dx; currentRock.oY = currentRock.oY + currentRock.dy; } l = 1; while (l <= lands) { currentLand = eval ("land" + l); if (currentRock.hitTest(currentLand)) { if (currentRock._y < ((currentLand._y + currentRock.dy) + 0.5)) { currentRock.oY = currentLand.oY; currentRock.dy = 0; currentRock.dx = 0; } else if (currentRock._y > (currentLand._y + 25.5)) { currentRock.dy = currentRock.dy * -1; currentRock.oY = currentRock.oY + (currentRock.dy * 2); } else { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 4); } } l++; } b = 1; while (b <= rocks) { otherRock = eval ("rock" + b); if (b != i) { if (currentRock.hitTest(otherRock)) { if (currentRock.oY < otherRock.oY) { currentRock.oY = otherRock.oY - 29; currentRock.dy = 0; currentRock.dx = 0; } } } b++; } b = 0; while (b <= buttons) { currentResponder = eval ("responder" + b); if (currentRock.hitTest(currentResponder)) { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 6); } b++; } i++; } i = 1; while (i <= enemies) { currentEnemy = eval ("enemy" + i); if (currentEnemy.tower == false) { if (currentEnemy.gotoLeft == true) { if (currentEnemy.patrolPoint < currentEnemy.patrolLength) { currentEnemy.oX = currentEnemy.oX + currentEnemy.speed; currentEnemy.patrolPoint = currentEnemy.patrolPoint + currentEnemy.speed; } else { currentEnemy.speed = 0; currentEnemy.gotoAndPlay("turn"); } } else if (currentEnemy.patrolPoint > 0) { currentEnemy.oX = currentEnemy.oX - currentEnemy.speed; currentEnemy.patrolPoint = currentEnemy.patrolPoint - currentEnemy.speed; } else { currentEnemy.speed = 0; currentEnemy.gotoAndPlay("turn"); } } else if (currentEnemy.dead != true) { dx = currentEnemy._x - mouse._x; dy = currentEnemy._y - mouse._y; radians = Math.atan(dy / dx); degrees = (radians * 180) / Math.PI; if (dx > 0) { degrees = degrees + 180; } radians = (degrees / 180) * Math.PI; moveX = Math.cos(radians); moveY = Math.sin(radians); moveX = moveX * currentEnemy.movespeed; moveY = moveY * currentEnemy.movespeed; currentEnemy.oX = currentEnemy.oX + moveX; currentEnemy.oY = currentEnemy.oY + moveY; } i++; } i = 0; while (i <= enemies) { currentEnemy = eval ("enemy" + i); if (mouse.hitTest(currentEnemy)) { health = health - currentEnemy.damage; } if (currentEnemy.tower == true) { currentBullet = eval ("bullet" + i); if (mouse.hitTest(currentBullet)) { health = health - currentEnemy.damage; } } i++; } i = 0; while (i <= buttons) { currentButton = eval ("button" + i); currentResponder = eval ("responder" + i); hit = false; r = 0; while (r <= rocks) { currentRock = eval ("rock" + r); if (currentButton.hitTest(currentRock)) { hit = true; if (currentButton.pressed == false) { currentButton.pressed = true; currentResponder.oX = currentResponder.oX + 10000; } } r++; } if (mousehitsbuttons == true) { if (mouse.hitTest(currentButton)) { hit = true; if (currentButton.pressed == false) { currentButton.pressed = true; currentResponder.oX = currentResponder.oX + 10000; } } } if (hit == false) { if (currentButton.pressed == true) { currentButton.pressed = false; currentResponder.oX = currentResponder.oX - 10000; currentResponder.alpha = 0; } } i++; } currentResponder.fadeOut = false; currentResponder.alpha = 100; currentResponder.speed = 6; if (mouse.hitTest(end)) { if (win == false) { level++; winS.start(0, 1); end.gotoAndPlay("win"); win = true; } } i = 0; while (i <= enemies) { currentTower = eval ("enemy" + i); if (currentTower.tower == true) { currentTop = eval ("towertop" + i); currentBullet = eval ("bullet" + i); currentTop._x = currentTower._x; currentTop._y = currentTower._y; currentTop._yscale = currentTower._yscale; dx = currentTower._x - mouse._x; dy = currentTower._y - mouse._y; radians = Math.atan(dy / dx); degrees = (radians * 180) / Math.PI; if (dx > 0) { degrees = degrees + 180; } radians = (degrees / 180) * Math.PI; degrees = degrees + 90; currentTop._rotation = degrees; distance = Math.sqrt((dx * dx) + (dy * dy)); currentTower.counter++; if (currentTower.counter >= currentTower.counterLimit) { currentTower.counter = 0; currentBullet.oX = currentTower.oX; currentBullet.oY = currentTower.oY; currentBullet.dx = Math.cos(radians) * currentTower.launchSpeed; currentBullet.dy = Math.sin(radians) * currentTower.launchSpeed; } currentBullet.oX = currentBullet.oX + currentBullet.dx; currentBullet.oY = currentBullet.oY + currentBullet.dy; } i++; } }; menu.onRelease = function () { gotoAndStop ("menu"); }; currentAlpha = 100; faderbox._alpha = currentAlpha; fadeOut = function () { if (loading == true) { faderbox.gotoAndStop("blue"); } if (loading == false) { faderbox.gotoAndStop("red"); } currentAlpha = currentAlpha + speed; if (currentAlpha >= 100) { currentAlpha = 100; if (loading == true) { gotoAndStop ("win"); } if (loading == false) { gotoAndStop ("lose"); } } faderbox._x = 0; faderbox._y = 0; faderbox._alpha = currentAlpha; }; fadeIn = function () { faderbox.gotoAndStop("blue"); currentAlpha = currentAlpha - speed; if (currentAlpha <= 0) { currentAlpha = 0; faderbox._x = -10000; faderbox._y = -10000; } faderbox._alpha = currentAlpha; if (health < topHealth) { faderbox.gotoAndStop("red"); faderbox._x = 0; faderbox._y = 0; faderbox._alpha = (100 - (health * healthMultiplier)) - 20; if (faderbox._alpha < 0) { faderbox._alpha = 0; } currentAlpha = faderbox._alpha; } };
Frame 106
lands = 12; total = 0; rocks = 6; objects = 5; buttons = 3; enemies = 8; notputdown = -1; health = topHealth; healthMultiplier = 100 / health; flightJuice = topFlightJuice; flightMultiplier = 100 / flightJuice; mouse.maxWidth = 62.1; landWidth = 188; onLandNum = 0; globalX = 0; globalY = 0; win = false; mousehitsbuttons = false; topsmoke = 5; smoke = 0; thrustsoundpauser = 0; totalforthruster = 4; fadein = true; loading = true; stop(); mouse = eval (type); mouse._x = startX._x; mouse._y = startX._y; startX._x = -100; startX._y = -100; mouse.dy = 0; mouse.dx = 0; mouse.oX = mouse._x; mouse.oY = mouse._y; explosion.oX = -10000; explosion.oY = -10000; leftbarrier.oX = leftbarrier._x; leftbarrier.oY = leftbarrier._y; rightbarrier.oX = rightbarrier._x; rightbarrier.oY = rightbarrier._y; topbarrier.oX = topbarrier._x; topbarrier.oY = topbarrier._y; bottombarrier.oX = bottombarrier._x; bottombarrier.oY = bottombarrier._y; end.oX = end._x; end.oY = end._y; enemy1.tower = false; enemy2.tower = false; enemy3.tower = false; enemy4.tower = false; enemy5.tower = true; enemy6.tower = true; enemy7.tower = true; enemy8.tower = true; i = 0; while (i <= objects) { currentObject = eval ("object" + i); currentObject.oX = currentObject._x; currentObject.oY = currentObject._y; i++; } enemy1.gotoLeft = true; i = 1; while (i <= enemies) { currentEnemy = eval ("enemy" + i); currentEnemy.health = 8; currentEnemy.speed = 2; firstFlag = eval ("firstPatrolMarker" + i); secondFlag = eval ("secondPatrolMarker" + i); currentEnemy.patrolLength = secondFlag._x - firstFlag._x; currentEnemy.patrolPoint = currentEnemy._x - firstFlag._x; firstFlag._x = -100; secondFlag._x = -100; currentEnemy.damage = 1; currentEnemy.oX = currentEnemy._x; currentEnemy.oY = currentEnemy._y; currentEnemy.dead = false; currentEnemy.gotoLeft = true; i++; } i = 0; while (i <= enemies) { currentEnemy = eval ("enemy" + i); if (currentEnemy.tower == true) { currentEnemy.counter = 0; currentEnemy.counterLimit = 60; currentEnemy.launchSpeed = 2; currentEnemy.health = 20; } i++; } i = 0; while (i <= buttons) { currentButton = eval ("button" + i); currentButton.pressed = false; currentButton.oX = currentButton._x; currentButton.oY = currentButton._y; currentResponder = eval ("responder" + i); currentResponder.oX = currentResponder._x; currentResponder.oY = currentResponder._y; currentResponder.fadeOut = false; currentResponder.alpha = 100; currentResponder.speed = 6; i++; } i = 0; while (i <= rocks) { currentRock = eval ("rock" + i); currentRock.oX = currentRock._x; currentRock.oY = currentRock._y; currentRock.dx = 0; currentRock.dy = 0; currentRock.originX = currentRock._x; currentRock.originY = currentRock._y; i++; } i = 0; while (i <= lands) { currentLand = eval ("land" + i); currentLand.oX = currentLand._x; currentLand.oY = currentLand._y; i++; } mouse.onEnterFrame = function () { if (fadein == true) { fadeIn(); } else { fadeOut(); } mouse.dy = mouse.dy + gravity; mouse._y = mouse._y + mouse.dy; mouse._x = mouse._x + mouse.dx; healthbar._xscale = health * healthMultiplier; if (flightJuice > 0) { flightbar._xscale = flightJuice * flightMultiplier; } if (health <= 0) { fadein = false; loading = false; } if (health < topHealth) { health = health + (regenerateRate / 5); } if (flightJuice < topFlightJuice) { flightJuice = flightJuice + regenerateRate; } dx = (Stage.width / 2) - mouse._x; dy = (Stage.width / 2) - mouse._y; dx = dx / 4; dy = dy / 4; if (mouse.dx > topspeed) { mouse.dx = topspeed; } if (mouse.dx < (-topspeed)) { mouse.dx = -topspeed; } if (mouse.dy > topspeed) { mouse.dy = topspeed; } if (mouse.dy < (-topspeed)) { mouse.dy = -topspeed; } globalX = globalX + dx; globalY = globalY + dy; i = 1; while (i <= lands) { currentLand = eval ("land" + i); currentLand._x = currentLand.oX + globalX; currentLand._y = currentLand.oY + globalY; i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); currentRock._x = currentRock.oX + globalX; currentRock._y = currentRock.oY + globalY; i++; } i = 1; while (i <= enemies) { currentEnemy = eval ("enemy" + i); currentEnemy._x = currentEnemy.oX + globalX; currentEnemy._y = currentEnemy.oY + globalY; if (currentEnemy.tower) { currentBullet = eval ("bullet" + i); currentBullet._x = currentBullet.oX + globalX; currentBullet._y = currentBullet.oY + globalY; } i++; } explosion._x = explosion.oX + globalX; explosion._y = explosion.oY + globalY; i = 0; while (i <= buttons) { currentButton = eval ("button" + i); currentResponder = eval ("responder" + i); currentButton._x = currentButton.oX + globalX; currentButton._y = currentButton.oY + globalY; currentResponder._x = currentResponder.oX + globalX; currentResponder._y = currentResponder.oY + globalY; i++; } i = 0; while (i <= objects) { currentObject = eval ("object" + i); currentObject._x = currentObject.oX + globalX; currentObject._y = currentObject.oY + globalY; i++; } leftbarrier._x = leftbarrier.oX + globalX; leftbarrier._y = leftbarrier.oY + globalY; rightbarrier._x = rightbarrier.oX + globalX; rightbarrier._y = rightbarrier.oY + globalY; topbarrier._x = topbarrier.oX + globalX; topbarrier._y = topbarrier.oY + globalY; bottombarrier._x = bottombarrier.oX + globalX; bottombarrier._y = bottombarrier.oY + globalY; end._x = end.oX + globalX; end._y = end.oY + globalY; mouse.oX = mouse.oX + dx; mouse.oY = mouse.oY + dy; mouse._y = mouse._y + dy; mouse._x = mouse._x + dx; bg._x = bg._x + (dx / 3); bg._y = bg._y + (dy / 3); if (notputdown != -1) { currentRock = eval ("rock" + notputdown); currentRock._x = mouse._x; currentRock._y = mouse._y + 25; currentRock.dx = mouse.dx; currentRock.dy = mouse.dy; } onLand = false; i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (mouse._y < (currentLand._y + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = currentLand._y; onLand = true; onLandNum = i; } else if (mouse._y > (((currentLand._y + 35.5) + 25.4) + (mouse.dy * 1.2))) { mouse.dy = mouse.dy * -1; mouse._y = mouse._y + (mouse.dy * 1.5); } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } i++; } if (notputdown != -1) { currentRock = eval ("rock" + notputdown); i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (currentRock.hitTest(currentLand)) { if (currentRock._y < (currentLand._y + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = currentLand._y - 25; onLand = true; onLandNum = i; } else if (currentRock._y > (((currentLand._y + 35) + 27) + (mouse.dy * 1.2))) { mouse.dy = mouse.dy * -1; mouse._y = mouse._y + (mouse.dy * 1.5); } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } i++; } notDropRock = eval ("rock" + notputdown); i = 1; while (i <= rocks) { if (i != notputdown) { currentRock = eval ("rock" + i); if (notDropRock.hitTest(currentRock)) { if (notDropRock._y < ((currentRock._y - 25) + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = currentRock._y - 54; onLand = true; } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } } i++; } } if (mouse.hitTest(leftbarrier)) { mouse.dx = mouse.dx * -1; mouse.oX = mouse.oX + (mouse.dx * 6); } if (mouse.hitTest(rightbarrier)) { mouse.dx = mouse.dx * -1; mouse.oX = mouse.oX + (mouse.dx * 6); } if (mouse.hitTest(topbarrier)) { mouse.dy = mouse.dy * -1; mouse.oY = mouse.oY + (mouse.dy * 6); } if (mouse.hitTest(bottombarrier)) { mouse.dy = mouse.dy * -1; mouse.oY = mouse.oY + (mouse.dy * 6); } i = 0; while (i <= rocks) { currentRock = eval ("rock" + i); if (currentRock.hitTest(leftbarrier)) { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 6); } if (currentRock.hitTest(rightbarrier)) { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 6); } if (currentRock.hitTest(topbarrier)) { currentRock.dy = currentRock.dy * -1; currentRock.oY = currentRock.oY + (currentRock.dy * 6); } if (currentRock.hitTest(bottombarrier)) { currentRock.dy = currentRock.dy * -1; currentRock.oX = currentRock.oX + (currentRock.dy * 6); } i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); e = 1; while (e <= enemies) { currentEnemy = eval ("enemy" + e); if (currentRock.hitTest(currentEnemy)) { if (currentRock._y < currentEnemy._y) { if (currentRock.dy > 0) { if (playsounds) { } currentEnemy.health = currentEnemy.health - currentRock.dy; if (currentEnemy.tower == false) { currentEnemy._yscale = currentEnemy.health * 10; } else { currentEnemy._yscale = currentEnemy.health * 5; } currentEnemy.speed = 0; currentRock.dy = 0; currentRock.dx = 0; if (notputdown == i) { mouse._y = mouse._y - 5; mouse.dy = mouse.dy - 1; currentX = currentRock.oX + globalX; currentY = currentRock.oY + globalY; dx = mouse._x - currentX; dy = mouse._y - currentY; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); notputdown = -1; } if (currentEnemy.health <= 1) { if (i != notputdown) { if (playsounds) { explosionS.start(0, 1); } explosion.oX = currentEnemy.oX; explosion.oY = currentEnemy.oY; if (currentEnemy.tower == true) { explosion._yscale = 200; explosion._xscale = 100; } else { explosion._yscale = 65; explosion._xscale = 65; } explosion.gotoAndPlay(1); currentEnemy.oX = -1000; currentEnemy.oY = -1000; } else { if (playsounds) { explosionS.start(0, 1); } if (currentEnemy.tower == true) { explosion._yscale = 200; explosion._xscale = 100; } else { explosion._yscale = 65; explosion._xscale = 65; } explosion.gotoAndPlay(1); currentEnemy.oX = -1000; currentEnemy.oY = -1000; mouse._y = mouse._y - 5; mouse.dy = mouse.dy - 1; currentX = currentRock.oX + globalX; currentY = currentRock.oY + globalY; dx = mouse._x - currentX; dy = mouse._y - currentY; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); notputdown = -1; } currentEnemy.dead = true; } } } } e++; } i++; } i = 1; while (i <= rocks) { if (i != notputdown) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (mouse._y < ((currentRock._y - 25) + (mouse.dy * 1.2))) { mouse.dy = 0; mouse._y = (currentRock.oY + globalY) - 26; onLand = true; } else { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } } } i++; } i = 0; while (i <= buttons) { currentResponder = eval ("responder" + i); if (mouse.hitTest(currentResponder)) { mouse.dx = mouse.dx * -1; mouse._x = mouse._x + (mouse.dx * 2); } i++; } pressed = false; if (Key.isDown(38)) { if (onLand) { mouse.dy = -2; mouse._y = mouse._y + mouse.dy; } else if (flightJuice > 0) { pressed = true; mouse.gotoAndStop("up"); mouse.dy = mouse.dy - thrust; flightJuice = flightJuice - 1; } } if (Key.isDown(40)) { if (onLand) { } else if (flightJuice > 0) { pressed = true; mouse.gotoAndStop("down"); mouse.dy = mouse.dy + thrust; flightJuice = flightJuice - 1; } if (mouse.hitTest(topbarrier)) { mouse._y = mouse._y + 7; } i = 0; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (currentLand._y < (mouse._y - 5)) { mouse._y = mouse._y + 7; } } i++; } } if (Key.isDown(37)) { pressed = true; if (onLand) { mouse.dx = mouse.dx - thrust; mouse.gotoAndStop("left"); } else if (flightJuice > 0) { pressed = true; mouse.dx = mouse.dx - thrust; mouse.gotoAndStop("left"); flightJuice = flightJuice - 1; } i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (i != onLandNum) { if (mouse._y > currentLand._y) { mouse._x = mouse._x - 7; } } } i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (mouse._y > (currentRock._y - 26)) { if (i != notputdown) { mouse._x = mouse._x - 7; } } } i++; } i = 0; while (i <= buttons) { currentResponder = eval ("responder" + i); if (mouse.hitTest(currentResponder)) { mouse._x = mouse._x - 7; } i++; } if (mouse.hitTest(rightbarrier)) { mouse._x = mouse._x - 7; } } else if (Key.isDown(39)) { pressed = true; if (onLand) { mouse.dx = mouse.dx + thrust; mouse.gotoAndStop("left"); } else if (flightJuice > 0) { pressed = true; mouse.dx = mouse.dx + thrust; mouse.gotoAndStop("left"); flightJuice = flightJuice - 1; } mouse.gotoAndStop("right"); i = 1; while (i <= lands) { currentLand = eval ("land" + i); if (mouse.hitTest(currentLand)) { if (i != onLandNum) { if (mouse._y > currentLand._y) { mouse._x = mouse._x + 7; } } } i++; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (mouse._y > (currentRock._y - 26)) { if (i != notputdown) { mouse._x = mouse._x + 7; } } } i++; } i = 0; while (i <= buttons) { currentResponder = eval ("responder" + i); if (mouse.hitTest(currentResponder)) { mouse._x = mouse._x + 7; } i++; } if (mouse.hitTest(leftbarrier)) { mouse._x = mouse._x + 7; } } else if (mouse.dx < 0) { mouse.dx = mouse.dx + thrust; } else if (mouse.dx > 0) { mouse.dx = mouse.dx - thrust; } if (mouse.dx < 0.1) { if (mouse.dx > 0) { mouse.dx = 0; } } if (mouse.dx > -0.1) { if (mouse.dx < 0) { mouse.dx = 0; } } if (pressed == false) { mouse.gotoAndStop("center"); } if (pressed == true) { if (playsounds) { thrustsoundpauser++; if (thrustsoundpauser == totalforthruster) { thruster.start(0, 1); thrustsoundpauser = 0; } } } if (Key.isDown(32)) { if (donePressSpace) { donePressSpace = false; if (notputdown == -1) { i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (mouse.hitTest(currentRock)) { if (playsounds) { pickup.start(0, 1); } notputdown = i; dx = mouse._x - currentRock._x; dy = mouse._y - currentRock._y; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); } i++; } } else { mouse._y = mouse._y - 5; mouse.dy = mouse.dy - 1; if (playsounds) { pickup.start(0, 1); } currentRock = eval ("rock" + notputdown); currentX = currentRock.oX + globalX; currentY = currentRock.oY + globalY; dx = mouse._x - currentX; dy = mouse._y - currentY; currentRock.oX = currentRock.oX + dx; currentRock.oY = currentRock.oY + (dy + 27); notputdown = -1; } } } else { donePressSpace = true; } i = 1; while (i <= rocks) { currentRock = eval ("rock" + i); if (i != notputdown) { currentRock.dy = currentRock.dy + gravity; currentRock.oX = currentRock.oX + currentRock.dx; currentRock.oY = currentRock.oY + currentRock.dy; } l = 1; while (l <= lands) { currentLand = eval ("land" + l); if (currentRock.hitTest(currentLand)) { if (currentRock._y < ((currentLand._y + currentRock.dy) + 0.5)) { currentRock.oY = currentLand.oY; currentRock.dy = 0; currentRock.dx = 0; } else if (currentRock._y > (currentLand._y + 25.5)) { currentRock.dy = currentRock.dy * -1; currentRock.oY = currentRock.oY + (currentRock.dy * 2); } else { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 4); } } l++; } b = 1; while (b <= rocks) { otherRock = eval ("rock" + b); if (b != i) { if (currentRock.hitTest(otherRock)) { if (currentRock.oY < otherRock.oY) { currentRock.oY = otherRock.oY - 29; currentRock.dy = 0; currentRock.dx = 0; } } } b++; } b = 0; while (b <= buttons) { currentResponder = eval ("responder" + b); if (currentRock.hitTest(currentResponder)) { currentRock.dx = currentRock.dx * -1; currentRock.oX = currentRock.oX + (currentRock.dx * 6); } b++; } i++; } i = 1; while (i <= enemies) { currentEnemy = eval ("enemy" + i); if (currentEnemy.tower == false) { if (currentEnemy.gotoLeft == true) { if (currentEnemy.patrolPoint < currentEnemy.patrolLength) { currentEnemy.oX = currentEnemy.oX + currentEnemy.speed; currentEnemy.patrolPoint = currentEnemy.patrolPoint + currentEnemy.speed; } else { currentEnemy.gotoLeft = false; currentEnemy.gotoAndPlay("turn"); } } else if (currentEnemy.patrolPoint > 0) { currentEnemy.oX = currentEnemy.oX - currentEnemy.speed; currentEnemy.patrolPoint = currentEnemy.patrolPoint - currentEnemy.speed; } else { currentEnemy.gotoLeft = true; currentEnemy.gotoAndPlay("turn"); } } i++; } i = 0; while (i <= enemies) { currentEnemy = eval ("enemy" + i); if (mouse.hitTest(currentEnemy)) { if (currentEnemy.tower == false) { health = health - currentEnemy.damage; } } if (currentEnemy.tower == true) { currentBullet = eval ("bullet" + i); if (mouse.hitTest(currentBullet)) { health = health - currentEnemy.damage; } } i++; } i = 0; while (i <= buttons) { currentButton = eval ("button" + i); currentResponder = eval ("responder" + i); hit = false; r = 0; while (r <= rocks) { currentRock = eval ("rock" + r); if (currentButton.hitTest(currentRock)) { hit = true; if (currentButton.pressed == false) { currentButton.pressed = true; currentResponder.oX = currentResponder.oX + 10000; } } r++; } if (mousehitsbuttons == true) { if (mouse.hitTest(currentButton)) { hit = true; if (currentButton.pressed == false) { currentButton.pressed = true; currentResponder.oX = currentResponder.oX + 10000; } } } if (hit == false) { if (currentButton.pressed == true) { currentButton.pressed = false; currentResponder.oX = currentResponder.oX - 10000; currentResponder.alpha = 0; } } i++; } currentResponder.fadeOut = false; currentResponder.alpha = 100; currentResponder.speed = 6; if (mouse.hitTest(end)) { if (win == false) { level++; winS.start(0, 1); end.gotoAndPlay("win"); win = true; } } i = 0; while (i <= enemies) { currentTower = eval ("enemy" + i); if (currentTower.tower == true) { currentTop = eval ("towertop" + i); currentBullet = eval ("bullet" + i); currentTop._x = currentTower._x; currentTop._y = currentTower._y - (95 * (currentTower._yscale / 100)); currentTop._yscale = currentTower._yscale; dx = currentTop._x - mouse._x; dy = currentTop._y - mouse._y; radians = Math.atan(dy / dx); degrees = (radians * 180) / Math.PI; if (dx > 0) { degrees = degrees + 180; } radians = (degrees / 180) * Math.PI; degrees = degrees + 90; currentTop._rotation = degrees; distance = Math.sqrt((dx * dx) + (dy * dy)); currentTower.counter++; if (currentTower.counter >= currentTower.counterLimit) { currentTower.counter = 0; currentBullet.oX = currentTower.oX; currentBullet.oY = currentTower.oY - (95 * (currentTower._yscale / 100)); currentBullet.dx = Math.cos(radians) * currentTower.launchSpeed; currentBullet.dy = Math.sin(radians) * currentTower.launchSpeed; } currentBullet.oX = currentBullet.oX + currentBullet.dx; currentBullet.oY = currentBullet.oY + currentBullet.dy; } i++; } }; menu.onRelease = function () { gotoAndStop ("menu"); }; currentAlpha = 100; faderbox._alpha = currentAlpha; fadeOut = function () { if (loading == true) { faderbox.gotoAndStop("blue"); } if (loading == false) { faderbox.gotoAndStop("red"); } currentAlpha = currentAlpha + speed; if (currentAlpha >= 100) { currentAlpha = 100; if (loading == true) { gotoAndStop ("loading"); } if (loading == false) { gotoAndStop ("lose"); } } faderbox._x = 0; faderbox._y = 0; faderbox._alpha = currentAlpha; }; fadeIn = function () { faderbox.gotoAndStop("blue"); currentAlpha = currentAlpha - speed; if (currentAlpha <= 0) { currentAlpha = 0; faderbox._x = -10000; faderbox._y = -10000; } faderbox._alpha = currentAlpha; if (health < topHealth) { faderbox.gotoAndStop("red"); faderbox._x = 0; faderbox._y = 0; faderbox._alpha = (100 - (health * healthMultiplier)) - 20; if (faderbox._alpha < 0) { faderbox._alpha = 0; } currentAlpha = faderbox._alpha; } };
Frame 143
faderbox.gotoAndStop("red"); bg.gotoAndStop("red"); bg._x = 0; bg._y = 0; fadein = true; alpha = 100; menu.onRelease = function () { fadein = false; }; faderbox.onEnterFrame = function () { if (fadein) { fadeIn(); } else { fadeOut(); } }; fadeIn = function () { faderbox._x = 0; faderbox._y = 0; alpha = alpha - speed; if (alpha <= 0) { alpha = 0; faderbox._y = -500; } else { faderbox._alpha = alpha; } }; fadeOut = function () { faderbox.gotoAndStop("blue"); faderbox._x = 0; faderbox._y = 0; alpha = alpha + speed; if (alpha >= 100) { faderbox._y = -500; gotoAndStop ("menu"); } else { faderbox._alpha = alpha; } };
Frame 147
winnumber = 15; if (level == 2) { code = "hogwash"; } if (level == 3) { code = "diesel"; } if (level == 4) { code = "dwarfer"; } if (level == 5) { code = "penguins"; } if (level == 6) { code = "partridge"; } if (level == 7) { code = "bearmeat"; } if (level == 8) { code = "blondie"; } if (level == 9) { code = "deathcab"; } if (level == 10) { code = "stillalive"; } if (level == 11) { code = "suicide"; } if (level == 12) { code = "bonkers"; } if (level == 13) { code = "lucky13"; } if (level == 14) { code = "theboss"; } fadein = true; codeinput = code; faderbox.gotoAndStop("blue"); codebox.onEnterFrame = function () { if (Key.isDown(32)) { fadein = false; } if (fadein) { fadeIn(); } else { fadeOut(); } }; menu.onRelease = function () { gotoAndStop ("menu"); }; currentAlpha = 100; faderbox._alpha = currentAlpha; fadeOut = function () { currentAlpha = currentAlpha + speed; if (currentAlpha >= 100) { currentAlpha = 100; if (level < winnumber) { gotoAndStop("level" + level); } else { gotoAndStop ("win"); } } faderbox._x = 0; faderbox._y = 0; faderbox._alpha = currentAlpha; }; fadeIn = function () { currentAlpha = currentAlpha - speed; if (currentAlpha <= 0) { currentAlpha = 0; faderbox._x = -10000; faderbox._y = -10000; } faderbox._x = 0; faderbox._y = 0; faderbox._alpha = currentAlpha; };
Frame 149
winnumber = 12; fadein = true; codeinput = code; codebox.onEnterFrame = function () { if (Key.isDown(32)) { fadein = false; } if (fadein) { fadeIn(); } else { fadeOut(); } }; menu.onRelease = function () { gotoAndStop ("menu"); }; speed = 6; currentAlpha = 100; faderbox._alpha = currentAlpha; faderbox.gotoAndStop("blue"); fadeOut = function () { currentAlpha = currentAlpha + speed; if (currentAlpha >= 100) { currentAlpha = 100; if (level < winnumber) { gotoAndStop("level" + level); } else { gotoAndStop ("win"); } } faderbox._x = 0; faderbox._y = 0; faderbox._alpha = currentAlpha; }; fadeIn = function () { currentAlpha = currentAlpha - speed; if (currentAlpha <= 0) { currentAlpha = 0; faderbox._x = -10000; faderbox._y = -10000; } faderbox._alpha = currentAlpha; };
Frame 151
fadein = true; codeinput = code; currentAlpha = 100; faderbox._alpha = currentAlpha; faderbox.gotoAndStop("blue"); soundefx.onRelease = function () { if (playsounds == true) { playsounds = false; soundfx = "Off"; } else { playsounds = true; soundfx = "On"; } }; cryingSoulB.onRelease = function () { cryingSoul.stop(); fallIntoTheBlazingCold.stop(); roseAtDawn.stop(); cryingSoul.start(0, 9999); }; fall.onRelease = function () { cryingSoul.stop(); fallIntoTheBlazingCold.stop(); roseAtDawn.stop(); fallIntoTheBlazingCold.start(0, 9999); }; rose.onRelease = function () { cryingSoul.stop(); fallIntoTheBlazingCold.stop(); roseAtDawn.stop(); roseAtDawn.start(0, 9999); }; none.onRelease = function () { cryingSoul.stop(); fallIntoTheBlazingCold.stop(); roseAtDawn.stop(); }; menu.onRelease = function () { fadein = false; }; faderbox.onEnterFrame = function () { if (fadein) { fadeIn(); } else { fadeOut(); } }; fadeOut = function () { currentAlpha = currentAlpha + speed; if (currentAlpha >= 100) { currentAlpha = 100; gotoAndStop ("menu"); } faderbox._x = 0; faderbox._y = 0; faderbox._alpha = currentAlpha; }; fadeIn = function () { currentAlpha = currentAlpha - speed; faderbox._x = 0; faderbox._y = 0; if (currentAlpha <= 0) { currentAlpha = 0; faderbox._x = -1000; faderbox._y = -1000; } faderbox._alpha = currentAlpha; };
Frame 157
skipbutton.onRelease = function () { gotoAndStop ("menu"); };
Frame 674
gotoAndStop ("menu");
Frame 1191
gotoAndStop ("menu");
Symbol 300 MovieClip [__Packages.MochiAd] Frame 0
class MochiAd { function MochiAd () { } static function getVersion() { return("2.2"); } static function showPreGameAd(options) { var _local27 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, ad_started:function () { this.clip.stop(); }, ad_finished:function () { this.clip.play(); }}; options = _parseOptions(options, _local27); var clip = options.clip; var _local23 = 11000; var _local26 = options.ad_timeout; delete options.ad_timeout; var fadeout_time = options.fadeout_time; delete options.fadeout_time; if (!load(options)) { options.ad_finished(); return(undefined); } options.ad_started(); var mc = clip._mochiad; mc.onUnload = function () { options.ad_finished(); }; var _local14 = _getRes(options); var _local4 = _local14[0]; var _local13 = _local14[1]; mc._x = _local4 * 0.5; mc._y = _local13 * 0.5; var chk = mc.createEmptyMovieClip("_mochiad_wait", 3); chk._x = _local4 * -0.5; chk._y = _local13 * -0.5; var _local7 = chk.createEmptyMovieClip("_mochiad_bar", 4); _local7._x = 10; _local7._y = _local13 - 20; var _local22 = options.color; delete options.color; var _local19 = options.background; delete options.background; var _local24 = options.outline; delete options.outline; var _local5 = _local7.createEmptyMovieClip("_outline", 1); _local5.beginFill(_local19); _local5.moveTo(0, 0); _local5.lineTo(_local4 - 20, 0); _local5.lineTo(_local4 - 20, 10); _local5.lineTo(0, 10); _local5.lineTo(0, 0); _local5.endFill(); var _local3 = _local7.createEmptyMovieClip("_inside", 2); _local3.beginFill(_local22); _local3.moveTo(0, 0); _local3.lineTo(_local4 - 20, 0); _local3.lineTo(_local4 - 20, 10); _local3.lineTo(0, 10); _local3.lineTo(0, 0); _local3.endFill(); _local3._xscale = 0; var _local6 = _local7.createEmptyMovieClip("_outline", 3); _local6.lineStyle(0, _local24, 100); _local6.moveTo(0, 0); _local6.lineTo(_local4 - 20, 0); _local6.lineTo(_local4 - 20, 10); _local6.lineTo(0, 10); _local6.lineTo(0, 0); chk.ad_msec = _local23; chk.ad_timeout = _local26; chk.started = getTimer(); chk.showing = false; chk.last_pcnt = 0; chk.fadeout_time = fadeout_time; chk.fadeFunction = function () { var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)); if (_local2 > 0) { this._parent._alpha = _local2; } else { var _local3 = this._parent._parent; MochiAd.unload(_local3); delete this.onEnterFrame; } }; mc.lc.adLoaded = function (width, height) { }; mc.lc.adjustProgress = function (msec) { var _local2 = this.mc._mochiad_wait; _local2.server_control = true; _local2.started = getTimer(); _local2.ad_msec = msec; }; chk.onEnterFrame = function () { var _local6 = this._parent._parent; var _local12 = this._parent._mochiad_ctr; var _local5 = getTimer() - this.started; var _local3 = false; var _local4 = _local6.getBytesTotal(); var _local8 = _local6.getBytesLoaded(); var _local10 = (100 * _local8) / _local4; var _local11 = (100 * _local5) / chk.ad_msec; var _local9 = this._mochiad_bar._inside; var _local2 = Math.min(100, Math.min(_local10 || 0, _local11)); _local2 = Math.max(this.last_pcnt, _local2); this.last_pcnt = _local2; _local9._xscale = _local2; if (!chk.showing) { var _local7 = _local12.getBytesTotal(); if ((_local7 > 0) || (typeof(_local7) == "undefined")) { chk.showing = true; chk.started = getTimer(); } else if (_local5 > chk.ad_timeout) { _local3 = true; } } if (_local5 > chk.ad_msec) { _local3 = true; } if (((_local4 > 0) && (_local8 >= _local4)) && (_local3)) { if (this.server_control) { delete this.onEnterFrame; } else { this.fadeout_start = getTimer(); this.onEnterFrame = chk.fadeFunction; } } }; } static function showInterLevelAd(options) { var _local13 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function () { this.clip.stop(); }, ad_finished:function () { this.clip.play(); }}; options = _parseOptions(options, _local13); var clip = options.clip; var _local10 = 11000; var _local12 = options.ad_timeout; delete options.ad_timeout; var fadeout_time = options.fadeout_time; delete options.fadeout_time; if (!load(options)) { options.ad_finished(); return(undefined); } options.ad_started(); var mc = clip._mochiad; mc.onUnload = function () { options.ad_finished(); }; var _local5 = _getRes(options); var _local14 = _local5[0]; var _local11 = _local5[1]; mc._x = _local14 * 0.5; mc._y = _local11 * 0.5; var chk = mc.createEmptyMovieClip("_mochiad_wait", 3); chk.ad_msec = _local10; chk.ad_timeout = _local12; chk.started = getTimer(); chk.showing = false; chk.fadeout_time = fadeout_time; chk.fadeFunction = function () { var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)); if (_local2 > 0) { this._parent._alpha = _local2; } else { var _local3 = this._parent._parent; MochiAd.unload(_local3); delete this.onEnterFrame; } }; mc.lc.adLoaded = function (width, height) { }; mc.lc.adjustProgress = function (msec) { var _local2 = this.mc._mochiad_wait; _local2.server_control = true; _local2.started = getTimer(); _local2.ad_msec = msec - 250; }; chk.onEnterFrame = function () { var _local5 = this._parent._mochiad_ctr; var _local4 = getTimer() - this.started; var _local2 = false; if (!chk.showing) { var _local3 = _local5.getBytesTotal(); if ((_local3 > 0) || (typeof(_local3) == "undefined")) { chk.showing = true; chk.started = getTimer(); } else if (_local4 > chk.ad_timeout) { _local2 = true; } } if (_local4 > chk.ad_msec) { _local2 = true; } if (_local2) { if (this.server_control) { delete this.onEnterFrame; } else { this.fadeout_start = getTimer(); this.onEnterFrame = this.fadeFunction; } } }; } static function showTimedAd(options) { showInterLevelAd(options); } static function showPreloaderAd(options) { showPreGameAd(options); } static function _allowDomains(server) { var _local1 = server.split("/")[2].split(":")[0]; if (System.security) { if (System.security.allowDomain) { System.security.allowDomain("*"); System.security.allowDomain(_local1); } if (System.security.allowInsecureDomain) { System.security.allowInsecureDomain("*"); System.security.allowInsecureDomain(_local1); } } return(_local1); } static function _loadCommunicator(options) { var _local26 = {clip:_root, com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"}; options = _parseOptions(options, _local26); options.swfv = options.clip.getSWFVersion() || 6; options.mav = getVersion(); var _local18 = options.clip; var _local20 = "_mochiad_com_" + options.id; if (!_isNetworkAvailable()) { return(null); } if (_local18[_local20]) { return(_local18[_local20].lc); } var _local21 = options.com_server + options.id; _allowDomains(_local21); delete options.id; delete options.com_server; var _local25 = options.depth; delete options.depth; var _local17 = _local18.createEmptyMovieClip(_local20, _local25); var _local11 = _local17.createEmptyMovieClip("_mochiad_com", 1); for (var _local15 in options) { _local11[_local15] = options[_local15]; } var _local6 = new LocalConnection(); var _local16 = ["", Math.floor(new Date().getTime()), random(999999)].join("_"); _local6.mc = _local17; _local6.name = _local16; _local6.allowDomain = function (d) { return(true); }; _local6.allowInsecureDomain = _local6.allowDomain; _local6.connect(_local16); _local17.lc = _local6; _local11.lc = _local16; _local6._id = 0; _local6._queue = []; _local6.rpcResult = function (cb_arg) { var _local8 = parseInt(cb_arg); var _local4 = this._callbacks[_local8]; if (!_local4) { return(undefined); } delete this._callbacks[_local8]; var _local5 = []; var _local3 = 2; while (_local3 < _local4.length) { _local5.push(_local4[_local3]); _local3++; } _local3 = 1; while (_local3 < arguments.length) { _local5.push(arguments[_local3]); _local3++; } var _local6 = _local4[1]; var _local7 = _local4[0]; if (_local7 && (typeof(_local6) == "string")) { _local6 = _local7[_local6]; } if (_local6) { _local6.apply(_local7, _local5); } }; _local6._didConnect = function (endpoint) { this._endpoint = endpoint; var _local4 = this._queue; delete this._queue; var _local5 = this.doSend; var _local2 = 0; while (_local2 < _local4.length) { var _local3 = _local4[_local2]; _local5.apply(this, _local3); _local2++; } }; _local6.doSend = function (args, cbobj, cbfn) { if (this._endpoint == null) { var _local4 = []; var _local3 = 0; while (_local3 < arguments.length) { _local4.push(arguments[_local3]); _local3++; } this._queue.push(_local4); return(undefined); } this._id = this._id + 1; var _local5 = this._id; if ((cbfn === undefined) || (cbfn === null)) { cbfn = cbobj; } this._callbacks[_local5] = [cbobj, cbfn]; var _local7 = new LocalConnection(); var _local9 = _local7.send(this._endpoint, "rpc", _local5, args); }; _local6._callbacks = {}; _local6._callbacks[0] = [_local6, "_didConnect"]; _local11.st = getTimer(); _local11.loadMovie(_local21 + ".swf", "POST"); return(_local6); } static function fetchHighScores(options, callbackObj, callbackMethod) { var _local1 = _loadCommunicator({id:options.id}); if (!_local1) { return(false); } var _local4 = ["fetchHighScores", options]; _local1.doSend(["fetchHighScores", options], callbackObj, callbackMethod); return(true); } static function sendHighScore(options, callbackObj, callbackMethod) { var _local1 = _loadCommunicator({id:options.id}); if (!_local1) { return(false); } var _local4 = ["sendHighScore", options]; _local1.doSend(["sendHighScore", options], callbackObj, callbackMethod); return(true); } static function load(options) { var _local13 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"}; options = _parseOptions(options, _local13); options.swfv = options.clip.getSWFVersion() || 6; options.mav = getVersion(); var _local9 = options.clip; if (!_isNetworkAvailable()) { return(null); } if (_local9._mochiad_loaded) { return(null); } var _local12 = options.depth; delete options.depth; var _local6 = _local9.createEmptyMovieClip("_mochiad", _local12); var _local11 = _getRes(options); options.res = (_local11[0] + "x") + _local11[1]; options.server = options.server + options.id; delete options.id; _local9._mochiad_loaded = true; var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1); for (var _local7 in options) { _local4[_local7] = options[_local7]; } var _local10 = _local4.server; delete _local4.server; var _local14 = _allowDomains(_local10); _local6.onEnterFrame = function () { if (this._mochiad_ctr._url != this._url) { this.onEnterFrame = function () { if (!this._mochiad_ctr) { delete this.onEnterFrame; MochiAd.unload(this._parent); } }; } }; var _local5 = new LocalConnection(); var _local8 = ["", Math.floor(new Date().getTime()), random(999999)].join("_"); _local5.mc = _local6; _local5.name = _local8; _local5.hostname = _local14; _local5.allowDomain = function (d) { return(true); }; _local5.allowInsecureDomain = _local5.allowDomain; _local5.connect(_local8); _local6.lc = _local5; _local4.lc = _local8; _local4.st = getTimer(); _local4.loadMovie(_local10 + ".swf", "POST"); return(_local6); } static function unload(clip) { if (typeof(clip) == "undefined") { clip = _root; } if (clip.clip && (clip.clip._mochiad)) { clip = clip.clip; } if (!clip._mochiad) { return(false); } clip._mochiad.removeMovieClip(); delete clip._mochiad_loaded; delete clip._mochiad; return(true); } static function _isNetworkAvailable() { if (System.security) { var _local1 = System.security; if (_local1.sandboxType == "localWithFile") { return(false); } } return(true); } static function _getRes(options) { var _local3 = options.clip.getBounds(); var _local2 = 0; var _local1 = 0; if (typeof(options.res) != "undefined") { var _local4 = options.res.split("x"); _local2 = parseFloat(_local4[0]); _local1 = parseFloat(_local4[1]); } else { _local2 = _local3.xMax - _local3.xMin; _local1 = _local3.yMax - _local3.yMin; } if ((_local2 == 0) || (_local1 == 0)) { _local2 = Stage.width; _local1 = Stage.height; } return([_local2, _local1]); } static function _parseOptions(options, defaults) { var _local4 = {}; for (var _local8 in defaults) { _local4[_local8] = defaults[_local8]; } if (options) { for (var _local8 in options) { _local4[_local8] = options[_local8]; } } if (_root.mochiad_options) { var _local5 = _root.mochiad_options.split("&"); var _local2 = 0; while (_local2 < _local5.length) { var _local3 = _local5[_local2].split("="); _local4[unescape(_local3[0])] = unescape(_local3[1]); _local2++; } } if (_local4.id == "test") { trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!"); } return(_local4); } }
Symbol 71 MovieClip Frame 1
Symbol 71 MovieClip Frame 7
gotoAndPlay (1);
Symbol 106 MovieClip Frame 1
stop();
Symbol 106 MovieClip Frame 22
_root.fadein = false; stop();
Symbol 111 MovieClip Frame 1
stop();
Symbol 112 MovieClip Frame 1
stop();
Symbol 122 MovieClip Frame 31
gotoAndPlay ("main");
Symbol 122 MovieClip Frame 56
this._xscale = this._xscale * -1; this.gotoAndPlay("main");
Symbol 133 MovieClip Frame 9
this.oX = -1000; this.oY = -1000;
Symbol 138 MovieClip Frame 10
stop();
Symbol 142 MovieClip Frame 1
stop();
Symbol 143 MovieClip Frame 1
stop();
Symbol 174 MovieClip Frame 22
this.gotoAndPlay("go");
Symbol 174 MovieClip Frame 36
this._xscale = this._xscale * -1; this.gotoAndPlay("go");
Symbol 182 MovieClip Frame 1
this.invincible = true;
Symbol 196 MovieClip Frame 1
this.invincible = true;
Symbol 290 MovieClip Frame 29
stop();

Library Items

Symbol 1 Sound [thruster-long]
Symbol 2 Sound [thruster]
Symbol 3 Sound [pickup]
Symbol 4 Sound [hit]
Symbol 5 Sound [explosion]
Symbol 6 Sound [bossexplosion]
Symbol 7 Sound [fallIntoTheBlazingCold]
Symbol 8 Sound [rose]
Symbol 9 Sound [BGKICK]
Symbol 10 GraphicUsed by:11
Symbol 11 MovieClipUses:10Used by:12
Symbol 12 MovieClipUses:11Used by:Timeline
Symbol 300 MovieClip [__Packages.MochiAd]
Symbol 13 FontUsed by:14 15 20 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 145
Symbol 14 TextUses:13Used by:Timeline
Symbol 15 TextUses:13Used by:Timeline
Symbol 16 GraphicUsed by:17
Symbol 17 ButtonUses:16Used by:Timeline
Symbol 18 GraphicUsed by:19
Symbol 19 ButtonUses:18Used by:Timeline
Symbol 20 TextUses:13Used by:Timeline
Symbol 21 GraphicUsed by:22
Symbol 22 ButtonUses:21Used by:Timeline
Symbol 23 TextUses:13Used by:Timeline
Symbol 24 TextUses:13Used by:Timeline
Symbol 25 TextUses:13Used by:Timeline
Symbol 26 TextUses:13Used by:Timeline
Symbol 27 TextUses:13Used by:Timeline
Symbol 28 TextUses:13Used by:Timeline
Symbol 29 TextUses:13Used by:Timeline
Symbol 30 TextUses:13Used by:Timeline
Symbol 31 TextUses:13Used by:Timeline
Symbol 32 TextUses:13Used by:Timeline
Symbol 33 TextUses:13Used by:Timeline
Symbol 34 TextUses:13Used by:Timeline
Symbol 35 TextUses:13Used by:Timeline
Symbol 36 TextUses:13Used by:Timeline
Symbol 37 TextUses:13Used by:Timeline
Symbol 38 TextUses:13Used by:Timeline
Symbol 39 TextUses:13Used by:Timeline
Symbol 40 TextUses:13Used by:Timeline
Symbol 41 GraphicUsed by:42
Symbol 42 MovieClipUses:41Used by:43
Symbol 43 MovieClipUses:42Used by:Timeline
Symbol 44 GraphicUsed by:Timeline
Symbol 45 BitmapUsed by:46
Symbol 46 GraphicUses:45Used by:47
Symbol 47 MovieClipUses:46Used by:Timeline
Symbol 48 GraphicUsed by:49 52 56
Symbol 49 MovieClipUses:48Used by:52 56  Timeline
Symbol 50 FontUsed by:51 140 166 167 168 169 171 175 176 177 178 179 184 185 186 187 188 190 191 192 193 194 198 199 200 201 204 206 207 208 217 226 227 228 244 246 250 252 253 258 261 278
Symbol 51 TextUses:50Used by:52
Symbol 52 ButtonUses:49 51 48Used by:Timeline
Symbol 53 FontUsed by:54 55 57 60 63 64 65 66 157 158 205 229 245 260 264 273 274 276 279 299
Symbol 54 TextUses:53Used by:Timeline
Symbol 55 TextUses:53Used by:56
Symbol 56 ButtonUses:49 55 48Used by:Timeline
Symbol 57 TextUses:53Used by:Timeline
Symbol 58 GraphicUsed by:59 237
Symbol 59 MovieClipUses:58Used by:Timeline
Symbol 60 EditableTextUses:53Used by:Timeline
Symbol 61 GraphicUsed by:62
Symbol 62 ButtonUses:61Used by:Timeline
Symbol 63 TextUses:53Used by:Timeline
Symbol 64 TextUses:53Used by:Timeline
Symbol 65 TextUses:53Used by:Timeline
Symbol 66 TextUses:53Used by:Timeline
Symbol 67 ShapeTweeningUsed by:71
Symbol 68 ShapeTweeningUsed by:71
Symbol 69 ShapeTweeningUsed by:71
Symbol 70 GraphicUsed by:71
Symbol 71 MovieClipUses:67 68 69 70Used by:76 79 82 112 142 143 150 154 173
Symbol 72 GraphicUsed by:73
Symbol 73 MovieClipUses:72Used by:76 79 82 112 142 143  Timeline
Symbol 74 GraphicUsed by:75
Symbol 75 MovieClipUses:74Used by:76 112
Symbol 76 MovieClipUses:71 73 75Used by:Timeline
Symbol 77 GraphicUsed by:78
Symbol 78 MovieClipUses:77Used by:79 142
Symbol 79 MovieClipUses:71 73 78Used by:Timeline
Symbol 80 GraphicUsed by:81
Symbol 81 MovieClipUses:80Used by:82 143
Symbol 82 MovieClipUses:71 73 81Used by:Timeline
Symbol 83 GraphicUsed by:84
Symbol 84 MovieClipUses:83Used by:Timeline
Symbol 85 FontUsed by:86 94 95 96 97 170 183 189 197 202 203 218 240 241 242 243 255 256 257 259 262 291 292
Symbol 86 EditableTextUses:85Used by:Timeline
Symbol 87 GraphicUsed by:93
Symbol 88 GraphicUsed by:93
Symbol 89 GraphicUsed by:93
Symbol 90 GraphicUsed by:93
Symbol 91 GraphicUsed by:93
Symbol 92 GraphicUsed by:93
Symbol 93 MovieClipUses:87 88 89 90 91 92Used by:Timeline
Symbol 94 EditableTextUses:85Used by:Timeline
Symbol 95 EditableTextUses:85Used by:Timeline
Symbol 96 EditableTextUses:85Used by:Timeline
Symbol 97 EditableTextUses:85Used by:Timeline
Symbol 98 GraphicUsed by:99
Symbol 99 MovieClipUses:98Used by:Timeline
Symbol 100 GraphicUsed by:106
Symbol 101 GraphicUsed by:106
Symbol 102 GraphicUsed by:103
Symbol 103 MovieClipUses:102Used by:106
Symbol 104 GraphicUsed by:106
Symbol 105 GraphicUsed by:106
Symbol 106 MovieClipUses:100 101 103 104 105Used by:Timeline
Symbol 107 GraphicUsed by:108
Symbol 108 MovieClipUses:107Used by:Timeline
Symbol 109 MovieClipUsed by:146  Timeline
Symbol 110 GraphicUsed by:111
Symbol 111 MovieClipUses:110Used by:Timeline
Symbol 112 MovieClipUses:73 75 71Used by:Timeline
Symbol 113 GraphicUsed by:114
Symbol 114 MovieClipUses:113Used by:122 174  Timeline
Symbol 115 GraphicUsed by:119
Symbol 116 GraphicUsed by:117
Symbol 117 MovieClipUses:116Used by:119
Symbol 118 GraphicUsed by:119
Symbol 119 MovieClipUses:115 117 118Used by:122 174 212  Timeline
Symbol 120 GraphicUsed by:121
Symbol 121 MovieClipUses:120Used by:122
Symbol 122 MovieClipUses:114 119 121Used by:277 290  Timeline
Symbol 123 MovieClipUsed by:Timeline
Symbol 124 GraphicUsed by:133
Symbol 125 GraphicUsed by:133
Symbol 126 GraphicUsed by:133
Symbol 127 GraphicUsed by:133
Symbol 128 GraphicUsed by:133
Symbol 129 GraphicUsed by:133
Symbol 130 GraphicUsed by:133
Symbol 131 GraphicUsed by:133
Symbol 132 GraphicUsed by:133
Symbol 133 MovieClipUses:124 125 126 127 128 129 130 131 132Used by:Timeline
Symbol 134 GraphicUsed by:138
Symbol 135 GraphicUsed by:138
Symbol 136 GraphicUsed by:138
Symbol 137 GraphicUsed by:138
Symbol 138 MovieClipUses:134 135 136 137Used by:Timeline
Symbol 139 GraphicUsed by:141
Symbol 140 TextUses:50Used by:141
Symbol 141 MovieClipUses:139 140Used by:Timeline
Symbol 142 MovieClipUses:73 78 71Used by:Timeline
Symbol 143 MovieClipUses:73 81 71Used by:Timeline
Symbol 144 GraphicUsed by:146
Symbol 145 TextUses:13Used by:146
Symbol 146 ButtonUses:144 109 145Used by:Timeline
Symbol 147 GraphicUsed by:155
Symbol 148 GraphicUsed by:155
Symbol 149 GraphicUsed by:150
Symbol 150 MovieClipUses:149 71Used by:153
Symbol 151 GraphicUsed by:152
Symbol 152 MovieClipUses:151Used by:153
Symbol 153 MovieClipUses:150 152Used by:154
Symbol 154 MovieClipUses:71 153Used by:155
Symbol 155 MovieClipUses:147 148 154Used by:Timeline
Symbol 156 MovieClipUsed by:Timeline
Symbol 157 EditableTextUses:53Used by:Timeline
Symbol 158 EditableTextUses:53Used by:Timeline
Symbol 159 GraphicUsed by:160
Symbol 160 MovieClipUses:159Used by:Timeline
Symbol 161 GraphicUsed by:162
Symbol 162 MovieClipUses:161Used by:Timeline
Symbol 163 GraphicUsed by:164
Symbol 164 MovieClipUses:163Used by:165
Symbol 165 MovieClipUses:164Used by:Timeline
Symbol 166 EditableTextUses:50Used by:Timeline
Symbol 167 EditableTextUses:50Used by:Timeline
Symbol 168 EditableTextUses:50Used by:Timeline
Symbol 169 EditableTextUses:50Used by:Timeline
Symbol 170 EditableTextUses:85Used by:Timeline
Symbol 171 EditableTextUses:50Used by:Timeline
Symbol 172 GraphicUsed by:173
Symbol 173 MovieClipUses:172 71Used by:174
Symbol 174 MovieClipUses:173 114 119Used by:Timeline
Symbol 175 EditableTextUses:50Used by:Timeline
Symbol 176 EditableTextUses:50Used by:Timeline
Symbol 177 EditableTextUses:50Used by:Timeline
Symbol 178 EditableTextUses:50Used by:Timeline
Symbol 179 EditableTextUses:50Used by:Timeline
Symbol 180 GraphicUsed by:181
Symbol 181 MovieClipUses:180Used by:182
Symbol 182 MovieClipUses:181Used by:Timeline
Symbol 183 EditableTextUses:85Used by:Timeline
Symbol 184 EditableTextUses:50Used by:Timeline
Symbol 185 EditableTextUses:50Used by:Timeline
Symbol 186 EditableTextUses:50Used by:Timeline
Symbol 187 EditableTextUses:50Used by:Timeline
Symbol 188 EditableTextUses:50Used by:Timeline
Symbol 189 EditableTextUses:85Used by:Timeline
Symbol 190 EditableTextUses:50Used by:Timeline
Symbol 191 EditableTextUses:50Used by:Timeline
Symbol 192 EditableTextUses:50Used by:Timeline
Symbol 193 EditableTextUses:50Used by:Timeline
Symbol 194 EditableTextUses:50Used by:Timeline
Symbol 195 GraphicUsed by:196
Symbol 196 MovieClipUses:195Used by:Timeline
Symbol 197 EditableTextUses:85Used by:Timeline
Symbol 198 EditableTextUses:50Used by:Timeline
Symbol 199 EditableTextUses:50Used by:Timeline
Symbol 200 EditableTextUses:50Used by:Timeline
Symbol 201 EditableTextUses:50Used by:Timeline
Symbol 202 EditableTextUses:85Used by:Timeline
Symbol 203 EditableTextUses:85Used by:Timeline
Symbol 204 EditableTextUses:50Used by:Timeline
Symbol 205 EditableTextUses:53Used by:Timeline
Symbol 206 EditableTextUses:50Used by:Timeline
Symbol 207 EditableTextUses:50Used by:Timeline
Symbol 208 EditableTextUses:50Used by:Timeline
Symbol 209 GraphicUsed by:216
Symbol 210 GraphicUsed by:211
Symbol 211 MovieClipUses:210Used by:212
Symbol 212 MovieClipUses:119 211Used by:216  Timeline
Symbol 213 GraphicUsed by:216
Symbol 214 FontUsed by:215 225
Symbol 215 TextUses:214Used by:216
Symbol 216 MovieClipUses:209 212 213 215Used by:Timeline
Symbol 217 EditableTextUses:50Used by:Timeline
Symbol 218 EditableTextUses:85Used by:Timeline
Symbol 219 GraphicUsed by:220
Symbol 220 MovieClipUses:219Used by:Timeline
Symbol 221 GraphicUsed by:222 272
Symbol 222 MovieClipUses:221Used by:Timeline
Symbol 223 GraphicUsed by:224
Symbol 224 MovieClipUses:223Used by:Timeline
Symbol 225 TextUses:214Used by:Timeline
Symbol 226 EditableTextUses:50Used by:Timeline
Symbol 227 EditableTextUses:50Used by:Timeline
Symbol 228 EditableTextUses:50Used by:Timeline
Symbol 229 TextUses:53Used by:Timeline
Symbol 230 GraphicUsed by:231
Symbol 231 MovieClipUses:230Used by:Timeline
Symbol 232 GraphicUsed by:233
Symbol 233 MovieClipUses:232Used by:Timeline
Symbol 234 FontUsed by:235 236
Symbol 235 TextUses:234Used by:237
Symbol 236 TextUses:234Used by:237
Symbol 237 ButtonUses:58 235 236Used by:Timeline
Symbol 238 BitmapUsed by:239
Symbol 239 GraphicUses:238Used by:Timeline
Symbol 240 TextUses:85Used by:Timeline
Symbol 241 EditableTextUses:85Used by:Timeline
Symbol 242 TextUses:85Used by:Timeline
Symbol 243 EditableTextUses:85Used by:Timeline
Symbol 244 TextUses:50Used by:Timeline
Symbol 245 TextUses:53Used by:Timeline
Symbol 246 TextUses:50Used by:247
Symbol 247 MovieClipUses:246Used by:Timeline
Symbol 248 BitmapUsed by:249
Symbol 249 GraphicUses:248Used by:Timeline
Symbol 250 TextUses:50Used by:251
Symbol 251 MovieClipUses:250Used by:Timeline
Symbol 252 TextUses:50Used by:Timeline
Symbol 253 TextUses:50Used by:254
Symbol 254 MovieClipUses:253Used by:Timeline
Symbol 255 TextUses:85Used by:Timeline
Symbol 256 TextUses:85Used by:Timeline
Symbol 257 TextUses:85Used by:Timeline
Symbol 258 TextUses:50Used by:Timeline
Symbol 259 TextUses:85Used by:Timeline
Symbol 260 EditableTextUses:53Used by:Timeline
Symbol 261 TextUses:50Used by:Timeline
Symbol 262 TextUses:85Used by:Timeline
Symbol 263 GraphicUsed by:265
Symbol 264 TextUses:53Used by:265
Symbol 265 MovieClipUses:263 264Used by:Timeline
Symbol 266 GraphicUsed by:269
Symbol 267 GraphicUsed by:269
Symbol 268 GraphicUsed by:269
Symbol 269 MovieClipUses:266 267 268Used by:Timeline
Symbol 270 FontUsed by:271
Symbol 271 TextUses:270Used by:272
Symbol 272 ButtonUses:221 271Used by:Timeline
Symbol 273 TextUses:53Used by:Timeline
Symbol 274 TextUses:53Used by:275
Symbol 275 MovieClipUses:274Used by:Timeline
Symbol 276 TextUses:53Used by:Timeline
Symbol 277 MovieClipUses:122Used by:Timeline
Symbol 278 TextUses:50Used by:Timeline
Symbol 279 TextUses:53Used by:Timeline
Symbol 280 GraphicUsed by:281
Symbol 281 MovieClipUses:280Used by:Timeline
Symbol 282 GraphicUsed by:290
Symbol 283 GraphicUsed by:290
Symbol 284 GraphicUsed by:290
Symbol 285 GraphicUsed by:290
Symbol 286 GraphicUsed by:290
Symbol 287 GraphicUsed by:290
Symbol 288 GraphicUsed by:290
Symbol 289 GraphicUsed by:290
Symbol 290 MovieClipUses:282 122 283 284 285 286 287 288 289Used by:Timeline
Symbol 291 TextUses:85Used by:Timeline
Symbol 292 TextUses:85Used by:Timeline
Symbol 293 GraphicUsed by:296
Symbol 294 GraphicUsed by:296
Symbol 295 GraphicUsed by:296
Symbol 296 MovieClipUses:293 294 295Used by:Timeline
Symbol 297 GraphicUsed by:298
Symbol 298 MovieClipUses:297Used by:Timeline
Symbol 299 TextUses:53Used by:Timeline

Instance Names

"mute"Frame 3Symbol 17 Button
"unMute"Frame 3Symbol 19 Button
"medVolume"Frame 3Symbol 22 Button
"play"Frame 84Symbol 52 Button
"intro"Frame 84Symbol 56 Button
"box"Frame 84Symbol 60 EditableText
"penB"Frame 84Symbol 62 Button
"birdB"Frame 84Symbol 62 Button
"bearB"Frame 84Symbol 62 Button
"optionsB"Frame 84Symbol 62 Button
"penguin"Frame 84Symbol 76 MovieClip
"bird"Frame 84Symbol 79 MovieClip
"bear"Frame 84Symbol 82 MovieClip
"bg"Frame 90Symbol 84 MovieClip
"object1"Frame 90Symbol 86 EditableText
"button2"Frame 90Symbol 93 MovieClip
"object4"Frame 90Symbol 94 EditableText
"button1"Frame 90Symbol 93 MovieClip
"object2"Frame 90Symbol 95 EditableText
"object3"Frame 90Symbol 96 EditableText
"object5"Frame 90Symbol 97 EditableText
"land1"Frame 90Symbol 49 MovieClip
"land2"Frame 90Symbol 49 MovieClip
"rock1"Frame 90Symbol 99 MovieClip
"rock2"Frame 90Symbol 99 MovieClip
"rock3"Frame 90Symbol 99 MovieClip
"land4"Frame 90Symbol 49 MovieClip
"firstPatrolMarker1"Frame 90Symbol 106 MovieClip
"secondPatrolMarker1"Frame 90Symbol 106 MovieClip
"leftbarrier"Frame 90Symbol 108 MovieClip
"rightbarrier"Frame 90Symbol 108 MovieClip
"bottombarrier"Frame 90Symbol 108 MovieClip
"topbarrier"Frame 90Symbol 108 MovieClip
"health"Frame 90Symbol 109 MovieClip
"responder1"Frame 90Symbol 111 MovieClip
"responder2"Frame 90Symbol 111 MovieClip
"end"Frame 90Symbol 106 MovieClip
"penguin"Frame 90Symbol 112 MovieClip
"enemy1"Frame 90Symbol 122 MovieClip
"flightbar"Frame 90Symbol 123 MovieClip
"explosion"Frame 90Symbol 133 MovieClip
"startX"Frame 90Symbol 141 MovieClip
"bird"Frame 90Symbol 142 MovieClip
"bear"Frame 90Symbol 143 MovieClip
"menu"Frame 90Symbol 146 Button
"faderbox"Frame 90Symbol 155 MovieClip
"leftbarrier"Frame 91Symbol 108 MovieClip
"rightbarrier"Frame 91Symbol 108 MovieClip
"bottombarrier"Frame 91Symbol 108 MovieClip
"topbarrier"Frame 91Symbol 108 MovieClip
"object2"Frame 91Symbol 157 EditableText
"object1"Frame 91Symbol 158 EditableText
"button1"Frame 91Symbol 93 MovieClip
"land1"Frame 91Symbol 49 MovieClip
"rock1"Frame 91Symbol 99 MovieClip
"rock2"Frame 91Symbol 99 MovieClip
"rock3"Frame 91Symbol 99 MovieClip
"firstPatrolMarker1"Frame 91Symbol 106 MovieClip
"secondPatrolMarker1"Frame 91Symbol 106 MovieClip
"health"Frame 91Symbol 109 MovieClip
"responder1"Frame 91Symbol 111 MovieClip
"end"Frame 91Symbol 106 MovieClip
"enemy5"Frame 91Symbol 160 MovieClip
"enemy1"Frame 91Symbol 122 MovieClip
"towertop5"Frame 91Symbol 162 MovieClip
"bullet6"Frame 91Symbol 165 MovieClip
"enemy2"Frame 91Symbol 122 MovieClip
"firstPatrolMarker2"Frame 91Symbol 106 MovieClip
"secondPatrolMarker2"Frame 91Symbol 106 MovieClip
"bullet5"Frame 91Symbol 165 MovieClip
"bullet7"Frame 91Symbol 165 MovieClip
"bullet8"Frame 91Symbol 165 MovieClip
"rock4"Frame 91Symbol 99 MovieClip
"rock5"Frame 91Symbol 99 MovieClip
"rock6"Frame 91Symbol 99 MovieClip
"firstPatrolMarker3"Frame 91Symbol 106 MovieClip
"secondPatrolMarker3"Frame 91Symbol 106 MovieClip
"enemy3"Frame 91Symbol 122 MovieClip
"enemy4"Frame 91Symbol 122 MovieClip
"firstPatrolMarker4"Frame 91Symbol 106 MovieClip
"secondPatrolMarker4"Frame 91Symbol 106 MovieClip
"responder2"Frame 91Symbol 111 MovieClip
"button3"Frame 91Symbol 93 MovieClip
"responder3"Frame 91Symbol 111 MovieClip
"land3"Frame 91Symbol 49 MovieClip
"land5"Frame 91Symbol 49 MovieClip
"land6"Frame 91Symbol 49 MovieClip
"land7"Frame 91Symbol 49 MovieClip
"land8"Frame 91Symbol 49 MovieClip
"land9"Frame 91Symbol 49 MovieClip
"land10"Frame 91Symbol 49 MovieClip
"land11"Frame 91Symbol 49 MovieClip
"land12"Frame 91Symbol 49 MovieClip
"object3"Frame 91Symbol 166 EditableText
"enemy6"Frame 91Symbol 160 MovieClip
"towertop6"Frame 91Symbol 162 MovieClip
"enemy7"Frame 91Symbol 160 MovieClip
"towertop7"Frame 91Symbol 162 MovieClip
"enemy8"Frame 91Symbol 160 MovieClip
"towertop8"Frame 91Symbol 162 MovieClip
"flightbar"Frame 91Symbol 123 MovieClip
"explosion"Frame 91Symbol 133 MovieClip
"object2"Frame 92Symbol 167 EditableText
"responder1"Frame 92Symbol 111 MovieClip
"end"Frame 92Symbol 106 MovieClip
"enemy5"Frame 92Symbol 160 MovieClip
"enemy1"Frame 92Symbol 122 MovieClip
"towertop5"Frame 92Symbol 162 MovieClip
"bullet6"Frame 92Symbol 165 MovieClip
"enemy2"Frame 92Symbol 122 MovieClip
"firstPatrolMarker2"Frame 92Symbol 106 MovieClip
"secondPatrolMarker2"Frame 92Symbol 106 MovieClip
"bullet5"Frame 92Symbol 165 MovieClip
"bullet7"Frame 92Symbol 165 MovieClip
"bullet8"Frame 92Symbol 165 MovieClip
"rock4"Frame 92Symbol 99 MovieClip
"rock5"Frame 92Symbol 99 MovieClip
"rock6"Frame 92Symbol 99 MovieClip
"firstPatrolMarker3"Frame 92Symbol 106 MovieClip
"secondPatrolMarker3"Frame 92Symbol 106 MovieClip
"enemy3"Frame 92Symbol 122 MovieClip
"enemy4"Frame 92Symbol 122 MovieClip
"firstPatrolMarker4"Frame 92Symbol 106 MovieClip
"secondPatrolMarker4"Frame 92Symbol 106 MovieClip
"button2"Frame 92Symbol 93 MovieClip
"responder2"Frame 92Symbol 111 MovieClip
"button3"Frame 92Symbol 93 MovieClip
"responder3"Frame 92Symbol 111 MovieClip
"land2"Frame 92Symbol 49 MovieClip
"land3"Frame 92Symbol 49 MovieClip
"land4"Frame 92Symbol 49 MovieClip
"land5"Frame 92Symbol 49 MovieClip
"land6"Frame 92Symbol 49 MovieClip
"land7"Frame 92Symbol 49 MovieClip
"land8"Frame 92Symbol 49 MovieClip
"land9"Frame 92Symbol 49 MovieClip
"land10"Frame 92Symbol 49 MovieClip
"land11"Frame 92Symbol 49 MovieClip
"land12"Frame 92Symbol 49 MovieClip
"object1"Frame 92Symbol 168 EditableText
"object3"Frame 92Symbol 169 EditableText
"enemy6"Frame 92Symbol 160 MovieClip
"towertop6"Frame 92Symbol 162 MovieClip
"enemy7"Frame 92Symbol 160 MovieClip
"towertop7"Frame 92Symbol 162 MovieClip
"enemy8"Frame 92Symbol 160 MovieClip
"towertop8"Frame 92Symbol 162 MovieClip
"explosion"Frame 92Symbol 133 MovieClip
"penguin"Frame 92Symbol 112 MovieClip
"startX"Frame 92Symbol 141 MovieClip
"bird"Frame 92Symbol 142 MovieClip
"bear"Frame 92Symbol 143 MovieClip
"menu"Frame 92Symbol 146 Button
"faderbox"Frame 92Symbol 155 MovieClip
"button2"Frame 93Symbol 93 MovieClip
"button1"Frame 93Symbol 93 MovieClip
"object1"Frame 93Symbol 170 EditableText
"object2"Frame 93Symbol 171 EditableText
"enemy2"Frame 93Symbol 174 MovieClip
"enemy3"Frame 93Symbol 174 MovieClip
"object3"Frame 93Symbol 175 EditableText
"button1"Frame 94Symbol 93 MovieClip
"topbarrier"Frame 94Symbol 108 MovieClip
"leftbarrier"Frame 94Symbol 108 MovieClip
"rightbarrier"Frame 94Symbol 108 MovieClip
"bottombarrier"Frame 94Symbol 108 MovieClip
"object2"Frame 94Symbol 176 EditableText
"land1"Frame 94Symbol 49 MovieClip
"rock1"Frame 94Symbol 99 MovieClip
"rock2"Frame 94Symbol 99 MovieClip
"rock3"Frame 94Symbol 99 MovieClip
"firstPatrolMarker1"Frame 94Symbol 106 MovieClip
"secondPatrolMarker1"Frame 94Symbol 106 MovieClip
"responder1"Frame 94Symbol 111 MovieClip
"end"Frame 94Symbol 106 MovieClip
"enemy5"Frame 94Symbol 160 MovieClip
"enemy1"Frame 94Symbol 174 MovieClip
"towertop5"Frame 94Symbol 162 MovieClip
"bullet6"Frame 94Symbol 165 MovieClip
"enemy2"Frame 94Symbol 122 MovieClip
"firstPatrolMarker2"Frame 94Symbol 106 MovieClip
"secondPatrolMarker2"Frame 94Symbol 106 MovieClip
"bullet5"Frame 94Symbol 165 MovieClip
"bullet7"Frame 94Symbol 165 MovieClip
"bullet8"Frame 94Symbol 165 MovieClip
"rock4"Frame 94Symbol 99 MovieClip
"rock5"Frame 94Symbol 99 MovieClip
"rock6"Frame 94Symbol 99 MovieClip
"firstPatrolMarker3"Frame 94Symbol 106 MovieClip
"secondPatrolMarker3"Frame 94Symbol 106 MovieClip
"enemy3"Frame 94Symbol 174 MovieClip
"enemy4"Frame 94Symbol 122 MovieClip
"firstPatrolMarker4"Frame 94Symbol 106 MovieClip
"secondPatrolMarker4"Frame 94Symbol 106 MovieClip
"object1"Frame 94Symbol 177 EditableText
"object3"Frame 94Symbol 178 EditableText
"object2"Frame 95Symbol 179 EditableText
"enemy1"Frame 95Symbol 122 MovieClip
"enemy4"Frame 95Symbol 182 MovieClip
"object1"Frame 95Symbol 183 EditableText
"object3"Frame 95Symbol 184 EditableText
"button2"Frame 96Symbol 93 MovieClip
"object2"Frame 96Symbol 185 EditableText
"bullet6"Frame 96Symbol 165 MovieClip
"enemy2"Frame 96Symbol 174 MovieClip
"firstPatrolMarker2"Frame 96Symbol 106 MovieClip
"secondPatrolMarker2"Frame 96Symbol 106 MovieClip
"bullet5"Frame 96Symbol 165 MovieClip
"bullet7"Frame 96Symbol 165 MovieClip
"bullet8"Frame 96Symbol 165 MovieClip
"rock4"Frame 96Symbol 99 MovieClip
"rock5"Frame 96Symbol 99 MovieClip
"rock6"Frame 96Symbol 99 MovieClip
"firstPatrolMarker3"Frame 96Symbol 106 MovieClip
"secondPatrolMarker3"Frame 96Symbol 106 MovieClip
"enemy3"Frame 96Symbol 182 MovieClip
"enemy4"Frame 96Symbol 122 MovieClip
"firstPatrolMarker4"Frame 96Symbol 106 MovieClip
"secondPatrolMarker4"Frame 96Symbol 106 MovieClip
"responder2"Frame 96Symbol 111 MovieClip
"button3"Frame 96Symbol 93 MovieClip
"responder3"Frame 96Symbol 111 MovieClip
"land2"Frame 96Symbol 49 MovieClip
"enemy1"Frame 96Symbol 122 MovieClip
"land3"Frame 96Symbol 49 MovieClip
"object1"Frame 96Symbol 186 EditableText
"object3"Frame 96Symbol 187 EditableText
"topbarrier"Frame 97Symbol 108 MovieClip
"leftbarrier"Frame 97Symbol 108 MovieClip
"rightbarrier"Frame 97Symbol 108 MovieClip
"bottombarrier"Frame 97Symbol 108 MovieClip
"object2"Frame 97Symbol 188 EditableText
"land1"Frame 97Symbol 49 MovieClip
"rock1"Frame 97Symbol 99 MovieClip
"rock2"Frame 97Symbol 99 MovieClip
"rock3"Frame 97Symbol 99 MovieClip
"firstPatrolMarker1"Frame 97Symbol 106 MovieClip
"secondPatrolMarker1"Frame 97Symbol 106 MovieClip
"responder1"Frame 97Symbol 111 MovieClip
"end"Frame 97Symbol 106 MovieClip
"enemy1"Frame 97Symbol 182 MovieClip
"bullet6"Frame 97Symbol 165 MovieClip
"firstPatrolMarker2"Frame 97Symbol 106 MovieClip
"secondPatrolMarker2"Frame 97Symbol 106 MovieClip
"bullet5"Frame 97Symbol 165 MovieClip
"bullet7"Frame 97Symbol 165 MovieClip
"bullet8"Frame 97Symbol 165 MovieClip
"rock4"Frame 97Symbol 99 MovieClip
"rock5"Frame 97Symbol 99 MovieClip
"rock6"Frame 97Symbol 99 MovieClip
"firstPatrolMarker3"Frame 97Symbol 106 MovieClip
"secondPatrolMarker3"Frame 97Symbol 106 MovieClip
"enemy3"Frame 97Symbol 182 MovieClip
"enemy4"Frame 97Symbol 182 MovieClip
"firstPatrolMarker4"Frame 97Symbol 106 MovieClip
"secondPatrolMarker4"Frame 97Symbol 106 MovieClip
"object1"Frame 97Symbol 189 EditableText
"object3"Frame 97Symbol 190 EditableText
"enemy2"Frame 97Symbol 182 MovieClip
"button2"Frame 98Symbol 93 MovieClip
"button3"Frame 98Symbol 93 MovieClip
"object2"Frame 98Symbol 191 EditableText
"enemy5"Frame 98Symbol 160 MovieClip
"enemy1"Frame 98Symbol 174 MovieClip
"towertop5"Frame 98Symbol 162 MovieClip
"enemy2"Frame 98Symbol 182 MovieClip
"enemy3"Frame 98Symbol 174 MovieClip
"enemy4"Frame 98Symbol 122 MovieClip
"object1"Frame 98Symbol 192 EditableText
"object3"Frame 98Symbol 193 EditableText
"rock1"Frame 99Symbol 99 MovieClip
"rock2"Frame 99Symbol 99 MovieClip
"rock3"Frame 99Symbol 99 MovieClip
"object2"Frame 99Symbol 194 EditableText
"enemy3"Frame 99Symbol 122 MovieClip
"enemy1"Frame 99Symbol 196 MovieClip
"enemy2"Frame 99Symbol 122 MovieClip
"object1"Frame 99Symbol 197 EditableText
"object3"Frame 99Symbol 198 EditableText
"startX"Frame 99Symbol 141 MovieClip
"menu"Frame 99Symbol 146 Button
"leftbarrier"Frame 100Symbol 108 MovieClip
"rightbarrier"Frame 100Symbol 108 MovieClip
"bottombarrier"Frame 100Symbol 108 MovieClip
"topbarrier"Frame 100Symbol 108 MovieClip
"object2"Frame 100Symbol 199 EditableText
"land1"Frame 100Symbol 49 MovieClip
"rock1"Frame 100Symbol 99 MovieClip
"rock2"Frame 100Symbol 99 MovieClip
"rock3"Frame 100Symbol 99 MovieClip
"firstPatrolMarker1"Frame 100Symbol 106 MovieClip
"secondPatrolMarker1"Frame 100Symbol 106 MovieClip
"responder1"Frame 100Symbol 111 MovieClip
"end"Frame 100Symbol 106 MovieClip
"enemy5"Frame 100Symbol 160 MovieClip
"towertop5"Frame 100Symbol 162 MovieClip
"bullet6"Frame 100Symbol 165 MovieClip
"enemy2"Frame 100Symbol 182 MovieClip
"firstPatrolMarker2"Frame 100Symbol 106 MovieClip
"secondPatrolMarker2"Frame 100Symbol 106 MovieClip
"bullet5"Frame 100Symbol 165 MovieClip
"bullet7"Frame 100Symbol 165 MovieClip
"bullet8"Frame 100Symbol 165 MovieClip
"rock4"Frame 100Symbol 99 MovieClip
"rock5"Frame 100Symbol 99 MovieClip
"rock6"Frame 100Symbol 99 MovieClip
"firstPatrolMarker3"Frame 100Symbol 106 MovieClip
"secondPatrolMarker3"Frame 100Symbol 106 MovieClip
"enemy3"Frame 100Symbol 182 MovieClip
"enemy4"Frame 100Symbol 182 MovieClip
"firstPatrolMarker4"Frame 100Symbol 106 MovieClip
"secondPatrolMarker4"Frame 100Symbol 106 MovieClip
"responder2"Frame 100Symbol 111 MovieClip
"enemy1"Frame 100Symbol 182 MovieClip
"object1"Frame 100Symbol 200 EditableText
"object3"Frame 100Symbol 201 EditableText
"penguin"Frame 100Symbol 112 MovieClip
"bird"Frame 100Symbol 142 MovieClip
"bear"Frame 100Symbol 143 MovieClip
"object2"Frame 101Symbol 202 EditableText
"enemy1"Frame 101Symbol 122 MovieClip
"enemy4"Frame 101Symbol 196 MovieClip
"enemy2"Frame 101Symbol 122 MovieClip
"enemy3"Frame 101Symbol 122 MovieClip
"object1"Frame 101Symbol 203 EditableText
"object3"Frame 101Symbol 204 EditableText
"object1"Frame 102Symbol 205 EditableText
"enemy3"Frame 102Symbol 182 MovieClip
"enemy4"Frame 102Symbol 182 MovieClip
"object2"Frame 102Symbol 206 EditableText
"button1"Frame 102Symbol 93 MovieClip
"land1"Frame 102Symbol 49 MovieClip
"rock1"Frame 102Symbol 99 MovieClip
"rock2"Frame 102Symbol 99 MovieClip
"rock3"Frame 102Symbol 99 MovieClip
"firstPatrolMarker1"Frame 102Symbol 106 MovieClip
"secondPatrolMarker1"Frame 102Symbol 106 MovieClip
"enemy1"Frame 102Symbol 196 MovieClip
"enemy2"Frame 102Symbol 196 MovieClip
"object3"Frame 102Symbol 207 EditableText
"enemy5"Frame 102Symbol 182 MovieClip
"firstPatrolMarker5"Frame 102Symbol 106 MovieClip
"secondPatrolMarker5"Frame 102Symbol 106 MovieClip
"object2"Frame 103Symbol 208 EditableText
"button1"Frame 103Symbol 93 MovieClip
"land1"Frame 103Symbol 49 MovieClip
"rock1"Frame 103Symbol 99 MovieClip
"rock2"Frame 103Symbol 99 MovieClip
"rock3"Frame 103Symbol 99 MovieClip
"firstPatrolMarker1"Frame 103Symbol 106 MovieClip
"secondPatrolMarker1"Frame 103Symbol 106 MovieClip
"enemy2"Frame 103Symbol 122 MovieClip
"enemy3"Frame 103Symbol 122 MovieClip
"enemy4"Frame 103Symbol 122 MovieClip
"enemy1"Frame 103Symbol 216 MovieClip
"object3"Frame 103Symbol 217 EditableText
"object1"Frame 103Symbol 218 EditableText
"bullet1"Frame 103Symbol 165 MovieClip
"bullet2"Frame 103Symbol 165 MovieClip
"towertop1"Frame 103Symbol 220 MovieClip
"smokeS"Frame 103Symbol 138 MovieClip
"walrushealth"Frame 103Symbol 224 MovieClip
"object2"Frame 106Symbol 226 EditableText
"enemy1"Frame 106Symbol 122 MovieClip
"object1"Frame 106Symbol 227 EditableText
"object3"Frame 106Symbol 228 EditableText
"bg"Frame 143Symbol 155 MovieClip
"menu"Frame 143Symbol 237 Button
"menu"Frame 147Symbol 62 Button
"codebox"Frame 147Symbol 247 MovieClip
"codebox"Frame 149Symbol 251 MovieClip
"box"Frame 151Symbol 254 MovieClip
"soundefx"Frame 151Symbol 62 Button
"cryingSoulB"Frame 151Symbol 62 Button
"rose"Frame 151Symbol 62 Button
"fall"Frame 151Symbol 62 Button
"none"Frame 151Symbol 62 Button
"skipbutton"Frame 157Symbol 272 Button
"snowflake"Symbol 12 MovieClip Frame 1Symbol 11 MovieClip
"snowflake"Symbol 12 MovieClip Frame 1Symbol 11 MovieClip
"snowflake"Symbol 12 MovieClip Frame 1Symbol 11 MovieClip
"snowflake"Symbol 12 MovieClip Frame 1Symbol 11 MovieClip
"snowflake"Symbol 12 MovieClip Frame 1Symbol 11 MovieClip
"snowflake"Symbol 12 MovieClip Frame 1Symbol 11 MovieClip
"snowflake"Symbol 12 MovieClip Frame 1Symbol 11 MovieClip
"snowflake"Symbol 12 MovieClip Frame 1Symbol 11 MovieClip
"snowflake"Symbol 12 MovieClip Frame 1Symbol 11 MovieClip
"snowflake"Symbol 12 MovieClip Frame 1Symbol 11 MovieClip
"snowflake"Symbol 12 MovieClip Frame 1Symbol 11 MovieClip
"snowflake"Symbol 12 MovieClip Frame 1Symbol 11 MovieClip
"snowflake"Symbol 12 MovieClip Frame 1Symbol 11 MovieClip
"snowflake"Symbol 12 MovieClip Frame 120Symbol 11 MovieClip

Special Tags

FileAttributes (69)Timeline Frame 1Access local files only, Metadata not present, AS1/AS2.
ExportAssets (56)Timeline Frame 1Symbol 1 as "thruster-long"
ExportAssets (56)Timeline Frame 1Symbol 2 as "thruster"
ExportAssets (56)Timeline Frame 1Symbol 3 as "pickup"
ExportAssets (56)Timeline Frame 1Symbol 4 as "hit"
ExportAssets (56)Timeline Frame 1Symbol 5 as "explosion"
ExportAssets (56)Timeline Frame 1Symbol 6 as "bossexplosion"
ExportAssets (56)Timeline Frame 1Symbol 7 as "fallIntoTheBlazingCold"
ExportAssets (56)Timeline Frame 1Symbol 8 as "rose"
ExportAssets (56)Timeline Frame 1Symbol 9 as "BGKICK"
ExportAssets (56)Timeline Frame 1Symbol 300 as "__Packages.MochiAd"

Labels

"menu"Frame 84
"level1"Frame 90
"level2"Frame 91
"level3"Frame 92
"level4"Frame 93
"level5"Frame 94
"level6"Frame 95
"level7"Frame 96
"level8"Frame 97
"level9"Frame 98
"level10"Frame 99
"level11"Frame 100
"level12"Frame 101
"level13"Frame 102
"level14"Frame 103
"basicgame"Frame 106
"lose"Frame 143
"loading"Frame 147
"win"Frame 149
"options"Frame 151
"skipbutton"Frame 157
"intro"Frame 157
"win"Symbol 106 MovieClip Frame 3
"normal"Symbol 111 MovieClip Frame 1
"center"Symbol 112 MovieClip Frame 1
"up"Symbol 112 MovieClip Frame 2
"left"Symbol 112 MovieClip Frame 3
"right"Symbol 112 MovieClip Frame 4
"down"Symbol 112 MovieClip Frame 5
"main"Symbol 122 MovieClip Frame 1
"turn"Symbol 122 MovieClip Frame 32
"center"Symbol 142 MovieClip Frame 1
"up"Symbol 142 MovieClip Frame 2
"left"Symbol 142 MovieClip Frame 3
"right"Symbol 142 MovieClip Frame 4
"down"Symbol 142 MovieClip Frame 5
"center"Symbol 143 MovieClip Frame 1
"up"Symbol 143 MovieClip Frame 2
"left"Symbol 143 MovieClip Frame 3
"right"Symbol 143 MovieClip Frame 4
"down"Symbol 143 MovieClip Frame 5
"blue"Symbol 155 MovieClip Frame 1
"red"Symbol 155 MovieClip Frame 5
"go"Symbol 174 MovieClip Frame 1
"turn"Symbol 174 MovieClip Frame 25
"main"Symbol 216 MovieClip Frame 1

Dynamic Text Variables

codeinputSymbol 60 EditableText"tutorial"
levelSymbol 241 EditableText"1"
codeSymbol 243 EditableText"tutorial"
soundfxSymbol 260 EditableText"On"




http://swfchan.com/10/46576/info.shtml
Created: 3/5 -2019 10:18:09 Last modified: 3/5 -2019 10:18:09 Server time: 02/05 -2024 03:53:15