Frame 101
best = 0;
stop();
Frame 160
gotoAndPlay (161);
Frame 161
if (_root.sessionstarted != 1) {
_root.arcade = new LoadVars();
_root.sessionvars = new LoadVars();
_root.arcade.gamename = "chopper";
_root.arcade.sessdo = "sessionstart";
_root.arcade.sendAndLoad("arcade.php", sessionvars, "POST");
_root.sessionstarted = 1;
}
stop();
colour = "0xffffff";
height = 35;
gap = 300;
_root.speed = 8;
_root.collision = 0;
crashSound = new Sound();
crashSound.attachSound("crash");
flySound = new Sound();
flySound.attachSound("flying");
fallSound = new Sound();
fallSound.attachSound("falling");
flySound.setVolume(50);
fallSound.setVolume(100);
crashSound.setVolume(50);
_root.distance = 0;
this.createEmptyMovieClip("ampgen", 99);
ampgen.onEnterFrame = function () {
var _local1 = _root;
_local1.timel = _local1.timel + 25;
_local1.timer = Math.floor(_local1.timel / 1000);
if (_local1.timer > 33) {
_local1.timer = 33;
}
_local1.wavelength = (Math.random() * _local1.timer) + 5;
_local1.wavelength2 = Math.random() * _local1.timer;
};
MovieClip.prototype.drawSineCurves = function (x0, y0, col, ampl, ppc) {
var _local1 = y0;
var _local2 = x0;
var _local3 = ppc;
var f1 = 0.42;
var f2 = 0.703;
this.beginFill(_root.colour, 100);
this.lineStyle(0, col, 100);
this.moveTo(_local2, _local1 - 60);
this.lineTo(_local2, _local1);
this.curveTo(_local2 + (0.0625 * _local3), _local1 + (f1 * ampl), _local2 + (0.125 * _local3), _local1 + (f2 * ampl));
this.curveTo(_local2 + (0.1875 * _local3), _local1 + ampl, _local2 + (_local3 / 4), _local1 + ampl);
this.curveTo(_local2 + (0.3125 * _local3), _local1 + ampl, _local2 + (0.375 * _local3), _local1 + (f2 * ampl));
this.curveTo(_local2 + (0.4375 * _local3), _local1 + (f1 * ampl), _local2 + (_local3 / 2), _local1);
this.curveTo(_local2 + (0.5625 * _local3), _local1 - (f1 * ampl), _local2 + (0.625 * _local3), _local1 - (f2 * ampl));
this.curveTo(_local2 + (0.6875 * _local3), _local1 - ampl, _local2 + (0.75 * _local3), _local1 - ampl);
this.curveTo(_local2 + (0.8125 * _local3), _local1 - ampl, _local2 + (0.875 * _local3), _local1 - (f2 * ampl));
this.curveTo(_local2 + (0.9375 * _local3), _local1 - (f1 * ampl), _local2 + _local3, _local1);
this.lineTo(_local2 + _local3, _local1 - 60);
this.endFill();
};
this.createEmptyMovieClip("spect", 100);
this.createEmptyMovieClip("sine1", 3);
this.createEmptyMovieClip("sine2", 4);
sine1.drawSineCurves(0, _root.height, _root.colour, _root.wavelength, 400);
sine2.drawSineCurves(0, _root.height, _root.colour, _root.wavelength, 400);
sine1._x = 0;
sine2._x = 400;
duplicateMovieClip ("sine1", "sine3", 5);
duplicateMovieClip ("sine2", "sine4", 6);
sine3._yscale = -100;
sine4._yscale = -100;
sine3._y = sine3._y + _root.gap;
sine4._y = sine4._y + _root.gap;
spect.onEnterFrame = function () {
var _local1 = _root;
if (_local1.collision != 1) {
sine1._x = sine1._x - _local1.speed;
sine2._x = sine2._x - _local1.speed;
sine3._x = sine3._x - _local1.speed;
sine4._x = sine4._x - _local1.speed;
spect._x = spect._x - _local1.speed;
_local1.distance = Math.floor((spect._x - spect._x) - (spect._x / 10));
}
if (sine1._x <= -400) {
removeMovieClip("sine1");
_local1.createEmptyMovieClip("sine1", 3);
sine1.drawSineCurves(0, _local1.height, _local1.colour, _local1.wavelength, 400);
sine1._x = 400;
}
if (sine2._x <= -400) {
removeMovieClip("sine2");
_local1.createEmptyMovieClip("sine2", 4);
sine2.drawSineCurves(0, _local1.height, _local1.colour, _local1.wavelength, 400);
sine2._x = 400;
}
if (sine3._x <= -400) {
removeMovieClip("sine3");
_local1.createEmptyMovieClip("sine3", 5);
sine3.drawSineCurves(0, _local1.height, _local1.colour, _local1.wavelength2, 400);
sine3._yscale = -100;
sine3._y = sine3._y + _local1.gap;
sine3._x = 400;
}
if (sine4._x <= -400) {
removeMovieClip("sine4");
_local1.createEmptyMovieClip("sine4", 6);
sine4.drawSineCurves(0, _local1.height, _local1.colour, _local1.wavelength2, 400);
sine4._yscale = -100;
sine4._y = sine4._y + _local1.gap;
sine4._x = 400;
}
};
this.onEnterFrame = function () {
var _local1 = this;
var _local2 = _root;
if (sine1.hitTest(helicopter._x, helicopter._y, true)) {
_local2.collision = 1;
}
if (sine2.hitTest(helicopter._x, helicopter._y, true)) {
_local2.collision = 1;
}
if (sine3.hitTest(helicopter._x, helicopter._y + 15, true)) {
_local2.collision = 1;
}
if (sine4.hitTest(helicopter._x, helicopter._y + 15, true)) {
_local2.collision = 1;
}
if (_local2.collision != 0) {
_local2.counting++;
if (_local2.counting > 80) {
gotoAndPlay (162);
if (_local2.submitscore == 1) {
if ((_local1.askpermission != 1) && (_local2.sessionvars.connStatus == 1)) {
_local1.prequestvars = new LoadVars();
_local1.pranswer = new LoadVars();
_local1.prequestvars.gametime = _local2.sessionvars.gametime;
_local1.prequestvars.fakekey = _local2.sessionvars.initbar;
if (_local2.score == 0) {
_local1.prequestvars.score = -1;
} else {
_local1.prequestvars.score = _local2.score;
}
_local1.prequestvars.id = _local2.sessionvars.lastid;
_local1.prequestvars.sessdo = "permrequest";
_local1.prequestvars.note = (_local1.prequestvars.id * _local1.prequestvars.score) * _local1.prequestvars.fakekey;
_local1.prequestvars.sendAndLoad("./arcade.php", _local1.pranswer, "POST");
_local1.askpermission = 1;
}
if ((_local1.pranswer.validate == 1) && (_local1.finalsent != 1)) {
_local1.burnscore = new LoadVars();
_local1.burnscore.microone = _local1.pranswer.microone;
_local1.burnscore.gametime = _local1.prequestvars.gametime;
_local1.burnscore.id = _local1.prequestvars.id;
if (_local2.score == 0) {
_local1.burnscore.noscore = 1;
}
_local1.burnscore.sessdo = "burn";
_local1.burnscore.send("./arcade.php", "_self", "POST");
_local1.finalsent = 1;
}
}
}
flySound.stop();
fallSound.stop();
if (_local2.distance > _local2.best) {
_local2.best = _local2.distance;
}
}
};
MovieClip.prototype.createBarrier = function (starty) {
this.beginFill(_root.colour, 100);
this.lineStyle(0.25, _root.colour, 100);
if (_root.distance > 1000) {
x = 0;
y = 0;
sides = Math.ceil(Math.random() * 6) + 2;
innerRadius = (Math.random() * 15) + 5;
outerRadius = (Math.random() * 25) + 40;
if (sides > 2) {
var _local3;
var qtrStep;
var _local2;
var _local1;
var dx;
var dy;
_local3 = (Math.PI*2) / sides;
qtrStep = _local3 / 4;
_local2 = (angle / 180) * Math.PI;
this.moveTo(x + (Math.cos(_local2) * outerRadius), y - (Math.sin(_local2) * outerRadius));
_local1 = 1;
while (_local1 <= sides) {
dx = x + (Math.cos((_local2 + (_local3 * _local1)) - (qtrStep * 3)) * innerRadius);
dy = y - (Math.sin((_local2 + (_local3 * _local1)) - (qtrStep * 3)) * innerRadius);
this.lineTo(dx, dy);
dx = x + (Math.cos((_local2 + (_local3 * _local1)) - (qtrStep * 2)) * innerRadius);
dy = y - (Math.sin((_local2 + (_local3 * _local1)) - (qtrStep * 2)) * innerRadius);
this.lineTo(dx, dy);
dx = x + (Math.cos((_local2 + (_local3 * _local1)) - qtrStep) * outerRadius);
dy = y - (Math.sin((_local2 + (_local3 * _local1)) - qtrStep) * outerRadius);
this.lineTo(dx, dy);
dx = x + (Math.cos(_local2 + (_local3 * _local1)) * outerRadius);
dy = y - (Math.sin(_local2 + (_local3 * _local1)) * outerRadius);
this.lineTo(dx, dy);
_local1++;
}
if (holeSides > 2) {
if (holeRadius == undefined) {
holeRadius = innerRadius / 3;
}
_local3 = (Math.PI*2) / holeSides;
this.moveTo(x + (Math.cos(_local2) * holeRadius), y - (Math.sin(_local2) * holeRadius));
_local1 = 1;
while (_local1 <= holeSides) {
dx = x + (Math.cos(_local2 + (_local3 * _local1)) * holeRadius);
dy = y - (Math.sin(_local2 + (_local3 * _local1)) * holeRadius);
this.lineTo(dx, dy);
_local1++;
}
}
}
} else {
this.moveTo(0, 0);
this.lineTo(0, 80);
this.lineTo(25, 80);
this.lineTo(25, 0);
this.lineTo(0, 0);
}
this.endFill();
this._y = starty;
this._x = 400;
};
inity = Math.round(Math.random() * 150) + 50;
_root.createEmptyMovieClip("barriers", 9);
_root.createEmptyMovieClip("barrier1", 10);
barrier1.createBarrier(inity);
barriers.onEnterFrame = function () {
var _local1 = _root;
if (_local1.collision != 1) {
barrier1._x = barrier1._x - _local1.speed;
barrier2._x = barrier2._x - _local1.speed;
if ((_local1.distance > 500) && (_local1.distance < 1000)) {
rotrandom = Math.ceil(_local1.distance / 1000);
rotamount = (Math.random() * 3) + rotrandom;
barrier1._rotation = barrier1._rotation + ((Math.random * rotamount) ^ 2);
barrier2._rotation = barrier2._rotation - rotamount;
}
if ((_local1.distance > 1000) && (_local1.distance < 1500)) {
rotamount = Math.random() * 5;
barrier1._rotation = barrier1._rotation + rotamount;
barrier2._rotation = barrier2._rotation - rotamount;
}
inity = Math.round(Math.random() * 150) + 50;
if (barrier1._x == 80) {
removeMovieClip("barrier2");
_local1.createEmptyMovieClip("barrier2", 11);
barrier2.createBarrier(inity);
if ((_local1.distance > 0) && (_local1.distance < 1000)) {
barrier2._yscale = (Math.random() * 70) + 100;
}
}
if (barrier2._x == 80) {
removeMovieClip("barrier1");
_local1.createEmptyMovieClip("barrier1", 10);
barrier1.createBarrier(inity);
if ((_local1.distance > 0) && (_local1.distance < 1000)) {
barrier1._yscale = (Math.random() * 70) + 100;
}
}
}
if (barrier1.hitTest(helicopter._x + 10, helicopter._y - 4, true)) {
_local1.collision = 1;
}
if (barrier2.hitTest(helicopter._x + 10, helicopter._y - 4, true)) {
_local1.collision = 1;
}
if (barrier1.hitTest(helicopter._x - 10, helicopter._y + 16, true)) {
_local1.collision = 1;
}
if (barrier2.hitTest(helicopter._x - 10, helicopter._y + 16, true)) {
_local1.collision = 1;
}
};
Instance of Symbol 24 MovieClip "helicopter" in Frame 161
onClipEvent (load) {
_root.buttonStatus = 0;
this.timer = 0;
}
onClipEvent (enterFrame) {
if ((_root.collision == 1) && (_root.smokeOn != 1)) {
_root.smokeOn = 1;
i = 0;
while (i < 6) {
this.attachMovie("smoke", "smoke" + i, 2000 + i);
this["smoke" + i]._rotation = Math.floor(Math.random() * 360);
i++;
}
}
if (_root.smokeOn == 1) {
i = 0;
while (i < 6) {
this["smoke" + i]._y = this["smoke" + i]._y - (Math.random() * 3);
this["smoke" + i]._x = this["smoke" + i]._x - (Math.sin(this["smoke" + i]._y) + (Math.random() * 3));
if (this["smoke" + i]._alpha > 0) {
this["smoke" + i]._alpha = this["smoke" + i]._alpha - Math.floor((Math.random() * 3) + 0.5);
} else {
removeMovieClip(this["smoke" + i]);
this.attachMovie("smoke", "smoke" + i, 2000 + i);
this["smoke" + i]._rotation = Math.floor(Math.random() * 360);
}
i++;
}
}
this.timer = this.timer + 0.05;
if (_root.buttonStatus == 0) {
heliFall = heliFly + (-9.8 * timer);
if (heliFall > 5) {
heliFall = 5;
}
if (_root.collision != 1) {
this._y = this._y - heliFall;
}
} else {
heliFly = heliFall + (timer * 25);
if (heliFly >= 4) {
heliFly = 4;
}
if (_root.collision != 1) {
this._y = this._y - heliFly;
}
}
}
Instance of Symbol 31 MovieClip in Frame 161
onClipEvent (enterFrame) {
this.swapDepths(5120);
}
Instance of Symbol 34 MovieClip in Frame 161
onClipEvent (enterFrame) {
this.swapDepths(5130);
}
Frame 162
removeMovieClip("sine1");
removeMovieClip("sine2");
removeMovieClip("sine3");
removeMovieClip("sine4");
removeMovieClip("barrier1");
removeMovieClip("barrier2");
removeMovieClip("barriers");
removeMovieClip("ampgen");
Symbol 8 MovieClip Frame 57
removeMovieClip(_target);
Symbol 9 MovieClip Frame 1
i = 2;
Symbol 9 MovieClip Frame 2
duplicateMovieClip ("line1", "line" + i, 16384 + i);
setProperty("line" + i, _rotation , i * 10);
i = Number(i) + 1;
setProperty("line1", _visible , false);
Symbol 9 MovieClip Frame 3
gotoAndPlay (2);
Symbol 18 Button
on (press) {
gotoAndPlay (102);
}
Symbol 24 MovieClip Frame 1
stop();
Symbol 26 Button
on (rollOver) {
if (_root.collision != 1) {
_root.fallSound.start(0.15, 999);
}
}
on (press) {
_root.buttonStatus = 1;
helicopter.timer = 0;
if (_root.collision != 1) {
helicopter._rotation = -10;
}
if (_root.collision != 1) {
_root.fallSound.stop();
_root.flySound.start(0.15, 999);
} else {
_root.fallSound.stop();
_root.flySound.stop();
}
}
on (release) {
helicopter._rotation = 0;
_root.buttonStatus = 0;
helicopter.timer = 0;
if (_root.collision != 1) {
_root.flySound.stop();
_root.fallSound.start(0.15, 999);
} else {
_root.fallSound.stop();
_root.flySound.stop();
}
}
Symbol 39 Button
on (press) {
_root.collision = 0;
_root.speed = 8;
_root.smokeOn = 0;
_root.counting = 0;
_root.timel = 0;
_root.timer = 0;
_root.wavelength = 0;
_root.wavelength2 = 0;
gotoAndPlay (161);
}
Symbol 42 Button
on (press) {
_root.score = _root.best;
_root.submitscore = 1;
}