Frame 1
function init_level(sss, cameh) {
this.attachMovie("Eggshell", "eggshell", 1000);
eggshell._x = start._x;
eggshell._y = start._y;
eggshell._xscale = 75;
eggshell._yscale = 75;
trace(start._x);
this.scale = sss;
_xscale = (100 * scale);
_yscale = (100 * scale);
this.field = this;
field._x = ((-start._x) * scale) + (Stage.width / 2);
field._y = (((-start._y) * scale) + (Stage.height / 2)) - cameh;
this.egg;
this.goal = 0;
this.bust_count = 0;
this.mouseListener = {};
Mouse.addListener(mouseListener);
this.keyListener = {};
Key.addListener(keyListener);
mouseListener.onMouseDown = function () {
var _local1 = 0;
while (_local1 < bars.length) {
bars[_local1].start();
_local1++;
}
field.attachMovie("Pen", "pen", 100000);
Mouse.hide();
keyListener.onKeyDown = function () {
if (Key.isDown(32)) {
delete keyListener.onKeyDown;
field.uninit(2, "restart");
}
};
mouseListener.onMouseDown = function () {
line_on = true;
pxmouse = _xmouse;
pymouse = _ymouse;
};
mouseListener.onMouseUp = function () {
line_on = false;
};
field.createEmptyMovieClip("egg_mc", 100);
egg = new Egg(egg_mc, start._x, start._y);
eggshell.start();
field.onEnterFrame = function () {
pen._x = _xmouse;
pen._y = _ymouse;
count++;
if ((count % 3) == 0) {
line_count++;
var _local2 = lines[line_count % lines.length];
_local2.clear();
if (line_on) {
_local2.lineStyle(10, 16777215);
_local2.moveTo(pxmouse, pymouse);
_local2.lineTo(pxmouse, pymouse);
_local2.lineTo(_xmouse, _ymouse);
_local2._alpha = 100;
pxmouse = _xmouse;
pymouse = _ymouse;
}
}
egg.update();
var _local1 = 0;
while (_local1 < lines.length) {
lines[_local1]._alpha = lines[_local1]._alpha * 0.95;
egg.hitTest(lines[_local1], false);
_local1++;
}
_local1 = 0;
while (_local1 < bars.length) {
egg.hitTest(bars[_local1], false);
_local1++;
}
goal = goal + ((egg.hitTest(pan.hit, true) > 0) ? 1 : 0);
egg.hitTest(pan.inner, false);
var _local3 = egg.midpoint();
field._x = ((-_local3.x) * scale) + (Stage.width / 2);
field._y = (((-_local3.y) * scale) + (Stage.height / 2)) - cameh;
if (goal > 50) {
field.uninit(((!egg.broken()) ? 0 : 1));
}
if (egg.broken()) {
bust_count++;
if (bust_count > 60) {
field.uninit(2);
}
}
if (egg.midpoint().y > (pan._y + 200)) {
field.uninit(2);
}
};
};
this.game_result;
this.uninit = function (n, next) {
var _local2 = 0;
while (_local2 < lines.length) {
lines[_local2].removeMovieClip();
_local2++;
}
this.onEnterFrame = undefined;
eggshell.removeMovieClip();
egg_mc.removeMovieClip();
pen.removeMovieClip();
Mouse.removeListener(mouseListener);
Key.removeListener(keyListener);
if (next == undefined) {
this.gotoAndPlay("result");
} else {
this.gotoAndPlay(next);
}
Mouse.show();
game_result = n;
delete egg;
_x = 0;
_y = 0;
_xscale = 100;
_yscale = 100;
};
this.bars = [];
this.addBar = function (bar) {
bars.push(bar);
};
this.lines = [];
this.line_count = 0;
this.line_on = false;
this.pxmouse;
this.count = 0;
var _local2 = 0;
while (_local2 < 10) {
field.createEmptyMovieClip("b" + _local2, 10000 + _local2);
field["b" + _local2].lineStyle(10, 16777215);
lines.push(field["b" + _local2]);
_local2++;
}
stop();
}
_global.level = 1;
this.mouseListener = {};
mouseListener.onMouseDown = function () {
gotoAndPlay ("man");
Mouse.removeListener(mouseListener);
};
Mouse.addListener(mouseListener);
stop();
Frame 4
this.mouseListener = {};
mouseListener.onMouseDown = function () {
gotoAndPlay("level" + _global.level);
Mouse.removeListener(mouseListener);
};
Mouse.addListener(mouseListener);
stop();
Frame 8
init_level(2, 0);
Frame 14
init_level(1, 100);
Frame 20
init_level(0.5, 100);
Frame 26
init_level(0.5, 100);
Frame 32
init_level(0.5, 100);
Frame 37
init_level(0.5, 100);
Frame 43
init_level(0.5, 100);
Frame 49
init_level(0.5, 100);
Frame 55
init_level(0.5, 100);
Frame 61
init_level(0.6, 100);
Frame 96
regg.gotoAndStop(game_result + 1);
this.mouseListener = {};
mouseListener.onMouseDown = function () {
if (game_result == 0) {
_global.level++;
}
gotoAndPlay("level" + _global.level);
Mouse.removeListener(mouseListener);
};
Mouse.addListener(mouseListener);
stop();
Instance of Symbol 39 MovieClip "regg" in Frame 96
/* no clip actions */
Frame 98
gotoAndPlay("level" + _global.level);
Frame 102
e.gotoAndStop(1);
stop();
Instance of Symbol 39 MovieClip "e" in Frame 102
on (press) {
_parent.gotoAndPlay("title");
}
Symbol 7 MovieClip [Eggshell] Frame 1
function start() {
lv = "level " + _global.level;
this.onEnterFrame = function () {
r._rotation = r._rotation - 10;
l._rotation = l._rotation + 10;
if (l._rotation > 50) {
delete this.onEnterFrame;
}
};
}
lv = "level " + _global.level;
Symbol 42 MovieClip [__Packages.Egg] Frame 0
class Egg
{
var mc, white, yellow;
function Egg (nmc, offsetx, offsety) {
mc = nmc;
white = new Soft(nmc, offsetx, offsety, 25, 16777215, 5);
yellow = new Soft(nmc, offsetx, offsety, 10, 16776960, 10);
var _local2 = 0;
while (_local2 < white.N) {
white.pts[_local2].addLink(yellow.pts[_local2]);
_local2 = _local2 + 2;
}
}
function midpoint() {
return(yellow.mp);
}
function broken() {
return(yellow.broken);
}
function update() {
mc.clear();
white.update();
yellow.update();
}
function hitTest(other, b) {
var _local2 = 0;
_local2 = _local2 + white.hitTest(other, b);
_local2 = _local2 + yellow.hitTest(other, b);
if (yellow.damage > 200) {
yellow.bust();
}
return(_local2);
}
}
Symbol 43 MovieClip [__Packages.Soft] Frame 0
class Soft
{
var mc, pts, N, color, mp, damage, broken;
function Soft (nmc, offsetx, offsety, scale, color, intension) {
mc = nmc;
pts = [];
N = 20;
var _local4 = (Math.PI*2) / N;
var _local3 = 0;
while (_local3 < N) {
pts.push(new Vec((Math.cos(_local4 * _local3) * scale) + offsetx, (Math.sin(_local4 * _local3) * scale) + offsety));
_local3++;
}
_local3 = 0;
while (_local3 < N) {
var _local2 = 1;
while (_local2 < intension) {
pts[_local3].addLink(pts[(_local3 + _local2) % N]);
_local2++;
}
_local3++;
}
this.color = color;
mp = new Vec(0, 0);
damage = 0;
broken = false;
}
function bust() {
if (broken) {
return(undefined);
}
var _local3 = 0;
while (_local3 < N) {
pts[_local3].clearLinks();
_local3++;
}
_local3 = 0;
while (_local3 < N) {
var _local2 = 1;
while (_local2 < 2) {
pts[_local3].addLink(pts[(_local3 + _local2) % N]);
_local2++;
}
_local3 = _local3 + 2;
}
broken = true;
}
function update() {
mc.beginFill(color);
pts[0].update();
mc.moveTo(pts[0].x, pts[0].y);
mp.x = pts[0].x;
mp.y = pts[0].y;
var _local3 = 1;
while (_local3 < N) {
var _local2 = pts[_local3];
_local2.update();
mp.x = mp.x + _local2.x;
mp.y = mp.y + _local2.y;
mc.lineTo(_local2.x, _local2.y);
_local3++;
}
mp.x = mp.x / N;
mp.y = mp.y / N;
mc.endFill();
mc._alpha = 80;
_local3 = 0;
while (_local3 < N) {
pts[_local3].adjustLinks();
_local3++;
}
_local3 = N - 1;
while (_local3 >= 0) {
pts[_local3].adjustLinks();
_local3--;
}
}
function hitTest(other, b) {
var _local4 = 0;
if (mc.hitTest(other)) {
var _local3 = 0;
while (_local3 < N) {
var _local2 = pts[_local3];
if (other.hitTest(_local2.x, _local2.y, true)) {
if (b) {
_local2.x = (_local2.px * 0.95) + (_local2.x * 0.05);
_local2.y = (_local2.py * 0.99) + (_local2.y * 0.01);
} else {
_local2.x = (_local2.px * 0.9) + (_local2.x * 0.1);
_local2.y = (_local2.py * 0.8) + (_local2.y * 0.2);
}
damage = damage + 1;
_local4 = _local4 + 1;
}
_local3++;
}
}
return(_local4);
}
}
Symbol 44 MovieClip [__Packages.Vec] Frame 0
class Vec
{
var x, y, px, py, vx, vy, links, distances;
function Vec (xx, yy) {
x = xx;
y = yy;
px = xx;
py = yy;
vx = 0;
vy = 0;
links = [];
distances = [];
}
function addLink(other) {
if (Math.random() < 0.5) {
links.push(other);
distances.push(distance(other));
} else {
links.unshift(other);
distances.unshift(distance(other));
}
}
function clearLinks() {
links = [];
distances = [];
}
function update(o) {
vx = x - px;
vy = y - py;
px = x;
py = y;
vx = vx * 0.99;
vy = vy * 0.99;
vy = vy + 0.25;
x = x + vx;
y = y + vy;
}
function distance(other) {
var _local3 = x - other.x;
var _local2 = y - other.y;
return(Math.sqrt((_local3 * _local3) + (_local2 * _local2)));
}
function adjustUnit(other, distance) {
var _local2 = other.x - x;
var _local3 = other.y - y;
var _local4 = Math.sqrt((_local2 * _local2) + (_local3 * _local3));
var _local5 = distance - _local4;
if (_local4 == 0) {
return(undefined);
}
_local2 = (_local2 / _local4) * (_local5 * 0.5);
_local3 = (_local3 / _local4) * (_local5 * 0.5);
x = x - _local2;
y = y - _local3;
other.x = other.x + _local2;
other.y = other.y + _local3;
}
function adjustLinks() {
var _local2 = 0;
while (_local2 < links.length) {
adjustUnit(links[_local2], distances[_local2]);
_local2++;
}
}
}
Symbol 20 MovieClip Frame 1
hit._visible = false;
_parent.pan = this;
Symbol 22 MovieClip Frame 1
_visible = false;
Symbol 24 MovieClip Frame 1
_parent.addBar(this);
Symbol 26 MovieClip Frame 1
_parent.addBar(this);
var r = 0;
var basex = _x;
this.onEnterFrame = function () {
r = r + 0.1;
_x = (basex + (Math.sin(r) * 100));
};
Symbol 28 MovieClip Frame 1
_parent.addBar(this);
this.onEnterFrame = function () {
_rotation = (_rotation + 1);
};
Symbol 30 MovieClip Frame 1
function start() {
this.onEnterFrame = function () {
_y = (_y - 2);
};
}
_parent.addBar(this);
Symbol 32 MovieClip Frame 1
_parent.addBar(this);
Symbol 34 MovieClip Frame 1