Frame 1
stop();
bush = new Sound();
bush.attachSound("IMPACT");
bush2 = new Sound();
bush2.attachSound("IMPACT2");
i = 500;
while (i < 525) {
_root.attachMovie("snow", i, i);
i++;
}
z = 550;
_root.onEnterFrame = function () {
if (_root._currentframe > 1) {
delete _root.onEnterFrame;
}
if ((Math.random() * 500) < 5) {
man = _root.attachMovie("stick", "s" + z, z);
man._x = -25;
man._y = (Stage.height / 4) + ((Math.random() * Stage.height) / 2);
man.torque = 1 + (Math.random() * 3);
var _local3 = (Math.random() * 45) * (Math.PI/180);
man.vx = Math.cos(_local3) * 20;
man.vy = (-Math.sin(_local3)) * 20;
man.gotoAndStop(2);
man.onEnterFrame = function () {
this._x = this._x + this.vx;
this._y = this._y + this.vy;
this._rotation = this._rotation + this.torque;
this.vy = this.vy + 0.5;
if (this._y > Stage.height) {
if ((Math.random() * 2) < 1) {
bush.start();
} else {
bush2.start();
}
this.removeMovieClip();
}
};
z++;
if (z > 575) {
z = 550;
}
}
};
Frame 2
stop();
w = _root.attachMovie("Warning", "Warning", 5005);
w._x = Stage.width / 2;
w._y = (Stage.height / 2) + 25;
w.onEnterFrame = function () {
w._visible = !w._visible;
};
Instance of Symbol 63 MovieClip "display" in Frame 2
onClipEvent (load) {
moveIt = false;
distance = 0;
}
onClipEvent (enterFrame) {
if (moveIt) {
_x = (_x - _root.stick.vx);
if (_x < (-(this._width / 2))) {
distance = distance + 100;
_x = (_x + (Stage.width + this._width));
}
}
}
Instance of Symbol 69 MovieClip "swing" in Frame 2
onClipEvent (load) {
gravity = 1;
resistance = 0.08;
drag = false;
}
onClipEvent (enterFrame) {
_x = _root.hinge._x;
_y = _root.hinge._y;
oldx = mx;
oldy = my;
mx = _root._xmouse;
my = _root._ymouse;
vectorx = mx - oldx;
vectory = my - oldy;
mvector = Math.sqrt((vectorx * vectorx) + (vectory * vectory));
if (!drag) {
if (!((_rotation < 2) && (_rotation > -2))) {
if ((_rotation > 0) && (_rotation < 179)) {
vector = vector + gravity;
} else if ((_rotation < 0) && (_rotation > -179)) {
vector = vector - gravity;
}
}
if (((vector < 2) && (vector > -2)) && ((_rotation < 2) && (_rotation > -2))) {
_rotation = 0;
}
vector = vector - (vector * resistance);
_rotation = (_rotation - vector);
} else {
vector = mvector;
x = _x;
y = _y;
mx = _root._xmouse;
my = _root._ymouse;
obj_x = _root._xmouse - _x;
obj_y = _root._ymouse - _y;
_rotation = (Math.atan2(-obj_x, obj_y) * 57.2957795130823);
}
}
on (press) {
drag = true;
}
on (release, releaseOutside) {
drag = false;
}
Instance of Symbol 38 MovieClip [stick] "stick" in Frame 2
onClipEvent (load) {
gravity = 0.4;
resistance = 0.01;
bounce = 0.7;
soundplaying = true;
bush = new Sound();
bush.attachSound("SMASH");
pop = new Sound();
pop.attachSound("IMPACT");
pop2 = new Sound();
pop2.attachSound("IMPACT2");
vx = 0;
vy = 0;
c = 0;
this.swapDepths(888);
}
onClipEvent (enterFrame) {
if (this._x > 191) {
this.vy = this.vy + gravity;
_rotation = (_rotation + this.vx);
}
if (!this.dead) {
this._x = this._x + 1;
}
this._y = this._y + this.vy;
if (this._x > 275) {
_x = 275;
_root.stuff._x = _root.stuff._x - vx;
_root.hinge._x = _root.hinge._x - vx;
_root.swing._x = _root.swing._x - vx;
_root.display.moveIt = true;
rdistance = rdistance + this.vx;
sdistance = rdistance / 275;
if (vx == 0) {
this.gotoAndStop(4);
}
} else {
this._x = this._x + this.vx;
}
if (this.hitTest(_root.swing)) {
bush.setVolume(100);
bush.start();
this.vy = _root.swing._rotation / 5;
this.vx = _root.swing.vector - (this.vy * 2);
_root.hit = true;
this.gotoAndStop(2);
}
this.vx = this.vx - (this.vx * this.resistance);
if (this._y > 350) {
this._y = 350;
if ((!_root.hit) && (!this.dead)) {
this.gotoAndStop("splat");
this.vx = 0;
this.vy = 0;
_rotation = 0;
bush.setVolume(100);
bush.start();
this.dead = true;
} else {
if (this.vy > 6) {
var i = 400;
while (i <= 405) {
s = _root.attachMovie("snowball", "s" + i, i);
s._x = this._x;
s._y = this._y;
var angle = ((45 + (Math.random() * 90)) * (Math.PI/180));
var v = ((this.vy / 2) + (Math.random() * 5));
s.vx = Math.cos(angle) * v;
s.vy = (-Math.sin(angle)) * v;
s.onEnterFrame = function () {
this._x = this._x + (this.vx - vx);
this._y = this._y + this.vy;
this.vy = this.vy + 1;
if (this._y > Stage.height) {
this.removeMovieClip();
}
};
i++;
}
}
this.vy = this.vy * (-bounce);
this.vx = this.vx * bounce;
if (soundplaying && (!this.dead)) {
if ((Math.random() * 2) < 1) {
pop.setVolume((this.vy / -10) * 100);
pop.start();
} else {
pop2.setVolume((this.vy / -10) * 100);
pop2.start();
}
soundplaying = false;
}
}
} else {
soundplaying = true;
}
if (_root.hit && (this.vx > 0.1)) {
_root.attachMovie("blood", "blood" + c, c);
c++;
if (c > 300) {
c = 0;
}
}
if (_root.hit) {
if (this.vx <= 0.01) {
if (this._currentframe != 3) {
d = _root.attachMovie("DistanceMarker", "DMark", 1050);
d._x = this._x;
d._y = this._y;
d._xscale = (d._yscale = 20);
d.onEnterFrame = function () {
if (d._xscale < 100) {
d._xscale = d._xscale + 2;
d._yscale = d._yscale + 2;
}
if (d._y > (Stage.height / 2.5)) {
d._y = d._y + (((Stage.height / 2.5) - d._y) * 0.1);
}
};
var dist = Number(_root.display.distance);
dist = dist + (100 * ((this._x - _root.display._x) / (Stage.width + _root.display._width)));
d.txtdistance.text = String(Math.round(dist)) + " ft";
var comment;
if (dist >= 15000) {
comment = "I Love You!";
} else if (dist >= 10000) {
comment = "Incredible!";
} else if (dist >= 7500) {
comment = "Amazing!";
} else if (dist >= 5000) {
comment = "Wow!";
} else if (dist >= 2500) {
comment = "Not Bad.";
} else if (dist >= 1000) {
comment = "Crap.";
} else {
comment = "Terrible!";
}
d.txtcomment.text = comment;
}
_rotation = 0;
this.gotoAndStop(3);
}
}
}
Symbol 5 MovieClip [snow] Frame 1
width = 550;
height = 400;
vy = random(2) + 3;
vx = random(4) - 2;
_y = random(height);
_x = random(width);
_yscale = (random(80) + 20);
_xscale = (random(80) + 20);
_alpha = (random(50) + 50);
this.onEnterFrame = function () {
_y = (_y + vy);
_x = (_x - _root.stick.vx);
if (_y > height) {
_y = (random(10) * -10);
_x = random(width);
}
if (_x < 0) {
_x = (random(200) + width);
_y = random(height);
}
};
Symbol 7 MovieClip [blood] Frame 1
this._xscale = random(50) + 50;
this._yscale = random(50) + 50;
this._x = _root.stick._x;
this._y = _root.stick._y;
this.dir = (Math.random() * 360) * (Math.PI/180);
this.vx = Math.cos(dir) * (Math.random() * 10);
this.vy = Math.sin(dir) * (Math.random() * 10);
this.onEnterFrame = function () {
if (this._name != "blood") {
if (_y < 360) {
this.vy = this.vy + _root.stick.gravity;
this._y = this._y + vy;
} else {
this.vx = 0;
this._xscale = this._xscale + 5;
this._alpha = this._alpha - 0.5;
}
if (_x < 0) {
this.removeMovieClip();
}
this._x = this._x + (this.vx - _root.stick.vx);
}
};
Symbol 25 MovieClip [Warning] Frame 40
stop();
this.removeMovieClip();
Symbol 38 MovieClip [stick] Frame 1
stop();
Symbol 38 MovieClip [stick] Frame 2
stop();
Symbol 38 MovieClip [stick] Frame 3
stop();
Symbol 38 MovieClip [stick] Frame 4
stop();
Symbol 45 Button
on (release) {
_root.attachMovie("InstructPanel", "Instructions", 600);
_root.Instructions._x = Stage.width / 2;
_root.Instructions._y = (-Stage.height) / 2;
_root.Instructions.vy = 0;
_root.Instructions.onEnterFrame = function () {
this.vy = this.vy + 1;
this._y = this._y + this.vy;
if (this._y > (Stage.height / 2)) {
this._y = Stage.height / 2;
this.vy = this.vy * -0.5;
}
if (_root._currentframe != 1) {
this.removeMovieClip();
}
};
instruct.enabled = false;
instruct._visible = false;
_root.loader.onEnterFrame = function () {
this._y = this._y + 1;
if (this._y > 360) {
delete _root.loader.onEnterFrame;
}
};
}
Symbol 53 Button
on (release) {
var i = 550;
while (i <= 575) {
m = _root.getInstanceAtDepth(i);
if (m != null) {
m.removeMovieClip();
}
i++;
}
_root.Instructions.removeMovieClip();
_root.play();
}
Symbol 54 MovieClip Frame 1
_root.stop();
PercentLoaded = (_root.getBytesLoaded() / _root.getBytesTotal()) * 100;
if (PercentLoaded != 100) {
setProperty(bar, _xscale , PercentLoaded);
} else {
gotoAndStop ("loaded");
}
Symbol 54 MovieClip Frame 2
gotoAndPlay (1);
Symbol 58 Button
on (release) {
getURL ("mailto:xtremeskater45@hotmail.com?subject=Death By Hinge Feedback", "", "GET");
}
Symbol 75 Button
on (release) {
_root.display._x = 275;
_root.display.distance = 0;
_root.stuff._x = 93.45;
_root.hinge._x = 147.05;
_root.stick._x = 35;
_root.stick._y = 48.5;
_root.hit = false;
_root.display.moveIt = false;
_root.stick._rotation = (_root.stick.vx = (_root.stick.vy = 0));
_root.stick.gotoAndStop(1);
_root.stick.dead = false;
_root.DMark.removeMovieClip();
i = 0;
while (i <= 300) {
_root["blood" + i].removeMovieClip();
i++;
}
}