Section 1
//ChargeMeter_7 (ObakenoKoushin_fla.ChargeMeter_7)
package ObakenoKoushin_fla {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.system.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class ChargeMeter_7 extends MovieClip {
public var val:Number;
public var glo:MovieClip;
public var mas:MovieClip;
public var main;
public function ChargeMeter_7(){
addFrameScript(0, frame1);
}
function frame1(){
main = root;
main.register(this);
val = (1 / 2);
}
public function advance(){
val = Math.min(1, Math.max(0, val));
mas.y = ((mas.y * 0.2) + (((0.5 - val) * 240) * 0.8));
glo.y = mas.y;
}
}
}//package ObakenoKoushin_fla
Section 2
//Girly_9 (ObakenoKoushin_fla.Girly_9)
package ObakenoKoushin_fla {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.system.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Girly_9 extends MovieClip {
public var snapper:Number;
public var glo:Glowball;
public var maxCharge:Number;
public var tracker;
public var inner:Boolean;
public var speed:Number;
public var pos:Number;
public var meter;
public var mdown:Boolean;
public var dir:int;
public var main;
public var charge:Number;
public var mouse:Point;
public var _parent;
public var myShot:MovieClip;
public var orb:MovieClip;
public function Girly_9(){
addFrameScript(0, frame1);
}
public function onMDown(_arg1:MouseEvent){
mdown = true;
if (main.paused){
return;
};
if (((!(inner)) && ((charge > 4)))){
myShot = shoot(Math.atan2(mouse.y, mouse.x), (16 * (1 - Math.exp((-(mouse.length) / 64)))), (orb.heat + charge));
charge = (charge - 4);
};
}
public function sparkle(_arg1, _arg2:Number=1){
if (_arg1 < 1){
main.playSound(new Esnip(), (_arg1 * _arg2));
} else {
if (_arg1 < 2){
main.playSound(new Esnap(), _arg2);
} else {
if (_arg1 < 3){
main.playSound(new Eplop());
((4 - _arg1) * _arg2);
main.playSound(new Epop(), ((_arg1 - 3) * _arg2));
} else {
if (_arg1 < 4){
main.playSound(new Epop(), ((5 - _arg1) * _arg2));
main.playSound(new Ecrash(), (((_arg1 - 4) * _arg2) * (1 + ((_arg1 - 4) / 1))));
} else {
main.playSound(new Ecrash(), (_arg2 * (1 + ((_arg1 - 4) / 1))));
};
};
};
};
}
public function shoot(_arg1:Number=3.14159265358979, _arg2:Number=16, _arg3:Number=10){
var sp:*;
var dir = _arg1;
var speed = _arg2;
var power = _arg3;
sp = new MovieClip();
sp.glo = sp.addChild(new Glowball());
sp.glo.filters = [new GlowFilter(15737087, 1, 16, 16, 2, 1)];
sp.glo.s = ((128 * (1 - Math.exp((-(power) / 128)))) + 5);
sp.glo.cacheAsBitmap = true;
sp.blendMode = "add";
sp.vel = new Point((speed * Math.cos(dir)), (speed * Math.sin(dir)));
sp.phase = 0;
sp.power = power;
sp.bonus = 0;
main.register(sp);
sp.advance = function (){
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
if (Math.random() <= 0.25){
sparkle((1.125 * Math.random()), Math.random());
};
this.phase++;
this.bonus++;
this.glo.alpha = (0.5 + (0.1 * Math.cos(this.phase)));
this.vel.y = (this.vel.y + (1 / 4));
this.x = (this.x + this.vel.x);
this.y = (this.y + this.vel.y);
this.glo.rotation = ((180 / Math.PI) * Math.atan2(this.vel.y, this.vel.x));
_local1 = Math.exp((-(this.vel.length) / 32));
this.glo.width = (this.glo.s * (2 - _local1));
this.glo.height = (this.glo.s * _local1);
_local2 = orb.branch(new Point(this.x, this.y), new Point((this.x - this.vel.x), (this.y - this.vel.y)), (1 + (this.power / 20)), 4);
parent.addChild(_local2);
main.register(_local2);
if ((((this.x < -(this.width))) || ((this.y > (300 + this.height))))){
main.remove(this);
};
for (_local3 in main.reg.Enemy) {
_local4 = main.reg.Enemy[_local3];
_local5 = new Point((this.x - _local4.x), (this.y - _local4.y));
if (_local5.length < ((16 + (this.power / 2)) + (4 * _local4.size))){
_local6 = Math.exp((-(_local5.length) / 64));
_local4.onHit(this, ((power * _local6) / 4));
_local7 = ((_local4.inertia / _local5.length) / (1 + (_local5.length / 64)));
_local4.vel.offset((_local5.x * _local7), (_local5.y * _local7));
_local8 = orb.branch(new Point(this.x, this.y), new Point((_local4.x + main.random(-8, 8)), (_local4.y + main.random(-8, 8))), ((1 + (this.power / 20)) * _local6), (4 + (2 * _local6)));
sparkle((((1 + (this.power / 20)) * _local6) / 2));
parent.addChild(_local8);
main.register(_local8);
};
};
};
sp.retire = function (){
this.advance = function (){
this.glo.scaleX = (this.glo.scaleX * 0.5);
this.glo.scaleY = (this.glo.scaleY * 0.5);
if ((((this.width < 1)) && ((this.height < 1)))){
main.remove(this);
};
};
};
sp.x = (x + orb.x);
sp.y = (y + orb.y);
parent.addChild(sp);
return (sp);
}
function frame1(){
pos = 0;
maxCharge = 100;
charge = (maxCharge / 2);
dir = 0;
speed = 1;
mdown = false;
_parent = parent;
main = root;
meter = _parent.meter;
inner = false;
mouse = new Point(0, 0);
myShot = null;
tracker = _parent.tracker;
snapper = 0;
stage.addEventListener(MouseEvent.MOUSE_DOWN, onMDown);
stage.addEventListener(MouseEvent.MOUSE_UP, onMUp);
this.addEventListener(Event.REMOVED_FROM_STAGE, function (){
stage.removeEventListener(MouseEvent.MOUSE_DOWN, onMDown);
stage.removeEventListener(MouseEvent.MOUSE_UP, onMUp);
main.remove(orb);
});
}
public function advance(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:*;
mouse.x = orb.mouseX;
mouse.y = orb.mouseY;
inner = (mouse.length < 32);
if (((mdown) && (inner))){
_local1 = Math.atan2(mouse.y, mouse.x);
_local2 = ((1 + Math.cos(_local1)) / 2);
_local3 = (_local2 - pos);
pos = (pos + _local3);
_local4 = Math.abs(_local3);
charge = (charge + (_local4 * (1 + (orb.heat / 8))));
orb.heat = (orb.heat + (_local4 / 2));
snapper = (snapper + _local4);
if (snapper > (1 / 2)){
sparkle(snapper);
snapper = 0;
};
};
charge = Math.max(0, Math.min(((charge - (1 / 16)) + (orb.heat / 128)), maxCharge));
if (charge < 12){
charge = (charge + ((12 - charge) / 40));
};
orb.charge = charge;
orb.advance();
glo.alpha = ((orb.heat / 12) - 1);
glo.scaleX = (glo.scaleY = Math.min(2, ((orb.heat / 64) + (1 / 2))));
speed = (speed * (1 - (1 / 128)));
pos = Math.max(0, Math.min(1, pos));
gotoAndStop((2 + Math.round((10 * pos))));
meter.val = (charge / 100);
}
public function onMUp(_arg1:MouseEvent){
var exp:*;
var mult:*;
var a:*;
var sb:*;
var ang:*;
var b:*;
var e = _arg1;
mdown = false;
if (main.paused){
return;
};
if (myShot != null){
exp = main.create(new MovieClip(), parent);
exp.x = myShot.x;
exp.y = myShot.y;
exp.shock = new Shockwave();
exp.addChild(exp.shock);
exp.time = 0;
mult = (1 + (4 * (1 - Math.exp((-(myShot.bonus) / 64)))));
exp.power = ((myShot.power + 2) * mult);
exp.scale = Math.min(4, (1 + ((2 * (1 - Math.exp((-(myShot.power) / 0x0100)))) * mult)));
sparkle(((3 * exp.scale) - 1));
a = (4 * Math.random());
while (a < 8) {
ang = ((2 * Math.PI) * Math.random());
b = orb.branch(new Point(0, 0), new Point((50 * Math.cos(ang)), (50 * Math.sin(ang))), (1 + (exp.power / 100)), (4 + (2 * mult)));
exp.shock.addChild(b);
b.blendMode = "add";
a = (a + 1);
};
sb = main.sketch(exp.shock);
exp.decay = orb.dissolve(exp.shock, 1);
exp.removeChild(exp.shock);
exp.addChild(exp.decay);
exp.advance = function (){
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
this.decay.blow();
this.time++;
this.scaleX = (this.scaleY = (this.scale * (1 - Math.exp((-(this.time) / 16)))));
this.alpha = ((2 * Math.exp((-(this.time) / 16))) - (1 / 4));
_local1 = (this.power * Math.exp((-(this.time) / 4)));
_local2 = (1 + int((this.power / 25)));
for (_local3 in main.reg.Enemy) {
_local4 = main.reg.Enemy[_local3];
_local5 = new Point((_local4.x - this.x), (_local4.y - this.y));
if (_local5.length <= ((50 * this.scaleX) + ((_local4.width + _local4.height) / 4))){
_local6 = (((_local1 / (1 + (_local5.length / 2))) / 16) * _local4.inertia);
_local4.vel.offset(((_local5.x * _local6) / 2), (((_local5.y * _local6) * _local4.inertia) / 2));
_local4.onHit(this, ((2 * _local1) * Math.exp((-(_local5.length) / 128))));
_local2--;
if (_local2 <= 0){
break;
};
};
};
if (this.alpha < (1 / 32)){
main.remove(this);
};
};
exp.shock.cacheAsBitmap = true;
exp.advance();
myShot.retire();
myShot = null;
};
}
}
}//package ObakenoKoushin_fla
Section 3
//loadGoat_11 (ObakenoKoushin_fla.loadGoat_11)
package ObakenoKoushin_fla {
import flash.display.*;
public dynamic class loadGoat_11 extends MovieClip {
public function loadGoat_11(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ObakenoKoushin_fla
Section 4
//MainTimeline (ObakenoKoushin_fla.MainTimeline)
package ObakenoKoushin_fla {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.system.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class MainTimeline extends MovieClip {
public var masterVolume:Number;
public var pausable:Boolean;
public var myMenu:ContextMenu;
public var paused:Boolean;
public var mute:ContextMenuItem;
public var reset:ContextMenuItem;
public var mPause:ContextMenuItem;
public var pre:MovieClip;
public var reg:Array;
public var PAUSE:MovieClip;
public var game:Game;
public function MainTimeline(){
addFrameScript(0, frame1, 1, frame2);
}
public function create(_arg1:DisplayObject, _arg2:Object=null, _arg3:Boolean=true){
var _local4:*;
if (_arg2 == null){
_arg2 = this;
};
_local4 = _arg2.addChild(_arg1);
if (_arg3){
register(_local4);
};
return (_local4);
}
public function echo(_arg1){
trace("ECHO!", _arg1);
}
public function playSound(_arg1, _arg2:Number=1, _arg3:Number=0){
var _local4:SoundChannel;
_local4 = _arg1.play();
_local4.soundTransform = new SoundTransform((masterVolume * _arg2), _arg3);
return (_local4);
}
public function unregister(_arg1:DisplayObject, _arg2:String=""):void{
var _local3:String;
var _local4:*;
_local3 = _arg1.name;
if (_arg2 == ""){
for (_local4 in reg) {
delete reg[_local4][_local3];
};
};
}
public function printWord(_arg1:String, _arg2:Number=1, _arg3:Number=0, _arg4:Number=1){
var _local5:*;
var _local6:Number;
var _local7:*;
var _local8:*;
var _local9:*;
_local5 = new MovieClip();
_local6 = -(_arg3);
_local7 = (_arg1.length - 1);
while (_local7 >= 0) {
_local8 = _arg1.charAt(_local7);
if (_local8 == " "){
} else {
_local9 = new Glyph();
_local9.char = _local8;
_local9.scale = _arg2;
_local9.timer = ((-1 * _local7) + _local6);
_local9.bounciness = _arg4;
_local9.x = ((_local7 * 12) * _arg2);
_local9.visible = false;
register(_local9);
_local9.unregister = unregister;
_local5.addChild(_local9);
};
_local7--;
};
return (_local5);
}
function frame1(){
PAUSE.visible = false;
if (reg != undefined){
gotoAndStop(3);
};
}
public function remove(_arg1:DisplayObject):void{
unregister(_arg1);
_arg1.parent.removeChild(_arg1);
}
function frame2(){
reg = new Array();
stop();
this.removeChild(pre);
stage.addEventListener(Event.ENTER_FRAME, advance);
masterVolume = 1;
stage.addEventListener(KeyboardEvent.KEY_DOWN, function (){
pauseToggle();
});
paused = true;
pausable = true;
PAUSE.visible = false;
pauseToggle();
myMenu = new ContextMenu();
myMenu.hideBuiltInItems();
myMenu.builtInItems.quality = true;
myMenu.builtInItems.zoom = true;
mPause = new ContextMenuItem("Pause");
mPause.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, function (){
pauseToggle();
if (paused){
mPause.caption = "Unpause";
} else {
mPause.caption = "Pause";
};
});
reset = new ContextMenuItem("Reset");
reset.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, function (){
game.goto(4);
game.goto(1);
});
mute = new ContextMenuItem("Mute");
mute.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, function (){
masterVolume = (1 - masterVolume);
if (masterVolume == 1){
mute.caption = "Mute";
} else {
mute.caption = "Unmute";
};
});
myMenu.customItems.push(mPause);
myMenu.customItems.push(mute);
myMenu.customItems.push(reset);
this.contextMenu = myMenu;
}
public function advance(_arg1){
var _local2:*;
if (!paused){
for (_local2 in reg.Active) {
if (reg.Active[_local2].advance != undefined){
reg.Active[_local2].advance();
};
};
};
}
public function sketch(_arg1, _arg2:uint=0):BitmapData{
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:Matrix;
_local3 = _arg1.getBounds(_arg1.parent);
_local4 = _arg1.getBounds(_arg1);
_local5 = new BitmapData(Math.ceil((_local3.width + (2 * _arg2))), Math.ceil((_local3.height + (2 * _arg2))), true, 0);
_local6 = new Matrix();
_local6.translate(-(((_local4.width / 2) + _local4.x)), -(((_local4.height / 2) + _local4.y)));
_local6.scale(_arg1.scaleX, _arg1.scaleY);
_local6.rotate(((_arg1.rotation * Math.PI) / 180));
_local6.translate((_arg2 + (_local3.width / 2)), (_arg2 + (_local3.height / 2)));
_local5.draw(_arg1, _local6);
return (_local5);
}
public function random(_arg1:Number=-1, _arg2:Number=1){
return ((Math.min(_arg1, _arg2) + (Math.abs((_arg1 - _arg2)) * Math.random())));
}
public function register(_arg1:DisplayObject, _arg2:String="Active", _arg3:String=""):Boolean{
var who = _arg1;
var category = _arg2;
var ID = _arg3;
if (reg[category] == undefined){
reg[category] = new Array();
};
if (ID == ""){
if (who.name.length > 0){
ID = who.name;
} else {
return (false);
};
};
reg[category][ID] = who;
who.addEventListener(Event.REMOVED_FROM_STAGE, function (_arg1){
var _local2:*;
_local2 = _arg1.currentTarget;
unregister(_local2, category);
});
return (true);
}
public function pauseToggle(){
var _local1:*;
var _local2:*;
var _local3:ColorTransform;
var _local4:*;
if (!pausable){
return;
};
paused = !(paused);
PAUSE.visible = paused;
_local1 = 1;
_local2 = 0;
if (paused){
_local1 = 0.5;
};
_local3 = new ColorTransform(_local1, _local1, _local1, 1, _local2, _local2, _local2, 0);
_local4 = new Transform(game);
_local4.colorTransform = _local3;
}
}
}//package ObakenoKoushin_fla
Section 5
//Orb_10 (ObakenoKoushin_fla.Orb_10)
package ObakenoKoushin_fla {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.system.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Orb_10 extends MovieClip {
public var b;
public var a;
public var buildUp:Number;
public var main;
public var charge:Number;
public var branches;
public var heat:Number;
public function Orb_10(){
addFrameScript(0, frame1);
}
public function sparkOut(_arg1:Number=1){
var _local2:*;
var _local3:*;
var _local4:*;
_arg1 = (8 * Math.atan((_arg1 / 8)));
_local2 = ((Math.random() * Math.PI) * 2);
_local3 = new Point(Math.cos(_local2), Math.sin(_local2));
_local3.normalize((12 + (_arg1 / 2)));
_local4 = branch(new Point(0, 0), _local3, (_arg1 * Math.random()), (1 + _arg1));
branches.addChild(_local4);
main.register(_local4);
}
function frame1(){
heat = 0;
charge = 0;
buildUp = 0;
branches = new MovieClip();
main = root;
this.addChild(branches);
a = 0;
while (a < 0) {
b = branch(new Point(0, 0), new Point(400, 300), 8, 1);
stage.addChild(b);
a++;
};
}
public function dissolve(_arg1, _arg2:Number=4){
var d:*;
var marg:*;
var noiseSize:uint;
var bnds:*;
var who = _arg1;
var str = _arg2;
d = new MovieClip();
marg = (8 + (1 * str));
d.bmpD = main.sketch(who, marg);
d.draft = d.bmpD.clone();
noiseSize = int((2 + ((d.bmpD.width + d.bmpD.height) / 16)));
d.draft.perlinNoise(noiseSize, noiseSize, 1, (64 * Math.random()), true, true);
d.disp = new DisplacementMapFilter(d.draft, new Point(0, 0), 1, 2, str, str);
d.bmp = new Bitmap(d.bmpD, "auto", !(true));
d.holder = d.addChild(new MovieClip());
d.holder.addChild(d.bmp);
bnds = who.getBounds(who.parent);
d.holder.x = ((bnds.x - who.x) - marg);
d.holder.y = ((bnds.y - who.y) - marg);
d.advance = function (){
this.blow();
this.expand((str / 2));
};
d.expand = function (_arg1:Number=1){
this.alpha = (this.alpha * (1 - (_arg1 / 64)));
this.scaleX = (this.scaleX + (_arg1 / 0x0100));
this.scaleY = (this.scaleY + (_arg1 / 0x0100));
if (this.alpha < 0.0625){
main.remove(this);
};
};
d.blow = function (){
this.bmpD.applyFilter(this.bmpD, this.bmpD.rect, new Point(0, 0), this.disp);
};
d.onRemove = function (_arg1){
_arg1.target.bmpD.dispose();
_arg1.target.draft.dispose();
_arg1.target.removeEventListener(Event.REMOVED_FROM_STAGE, _arg1.target.onRemove);
};
d.addEventListener(Event.REMOVED_FROM_STAGE, d.onRemove);
d.x = who.x;
d.y = who.y;
return (d);
}
public function advance(){
heat = (heat * (1 - (1 / 128)));
buildUp = (buildUp + ((heat + (charge / 8)) + 1));
while (buildUp > 16) {
buildUp = 0;
sparkOut((charge / 8));
};
}
public function branch(_arg1:Point, _arg2:Point, _arg3:Number=2, _arg4:Number=1){
var b:*;
var dist:Number;
var n:int;
var pts:Array;
var a:*;
var ang:*;
var off:*;
var t:*;
var sc:Number;
var c:*;
var bnd:*;
var p:*;
var buck:*;
var pA = _arg1;
var pB = _arg2;
var thickness = _arg3;
var wildness = _arg4;
b = new MovieClip();
dist = pA.subtract(pB).length;
n = (2 + int(((dist / 32) * (1 + Math.random()))));
pts = new Array();
a = 0;
while (a < n) {
p = new Object();
p.f = Math.random();
p.x = ((pA.x * p.f) + (pB.x * (1 - p.f)));
p.y = ((pA.y * p.f) + (pB.y * (1 - p.f)));
pts.push(p);
a = (a + 1);
};
pts.sortOn("f", Array.DESCENDING);
ang = ((2 * Math.PI) * Math.random());
off = (Math.random() * (1 + (dist / 8)));
t = Math.random();
a = 0;
while (a < n) {
p = pts[a];
ang = (ang + (Math.random() - 0.5));
buck = (2 * Math.abs((p.f - 0.5)));
off = (off + (((2 * buck) * ((buck + 1) + (dist / 8))) * (Math.random() - 0.5)));
off = (off * (0.9 + (0.1 * Math.pow((1 - buck), 2))));
p.x = (p.x + ((((1 - buck) * wildness) * off) * Math.cos(ang)));
p.y = (p.y + ((((1 - buck) * wildness) * off) * Math.sin(ang)));
t = (t + (2 * (Math.random() - 0.5)));
p.t = (Math.abs(((Math.sin(t) * 0.9) + 0.1)) * thickness);
a = (a + 1);
};
sc = 8;
b.graphics.moveTo((pA.x * sc), (pA.y * sc));
a = 0;
while (a < n) {
p = pts[a];
b.graphics.lineStyle((p.t * sc), 0xFFFFFF, 1);
b.graphics.lineTo((p.x * sc), (p.y * sc));
a = (a + 1);
};
b.graphics.lineTo((pB.x * sc), (pB.y * sc));
b.filters = [new GlowFilter(10494192, 1, 8, 8, 2, 2), new GlowFilter(10494192, 1, 2, 2, 1, 1, true)];
b.cacheAsBitmap = true;
b.blendMode = "add";
b.scaleX = (b.scaleY = (1 / sc));
c = new MovieClip();
c.branch = c.addChild(b);
c.bmp = main.sketch(c);
bnd = b.getBounds(c);
c.removeChild(b);
c.B = c.addChild(new Bitmap(c.bmp));
c.B.x = bnd.x;
c.B.y = bnd.y;
c.blendMode = "add";
c.advance = function (){
this.B.alpha = (this.B.alpha * 0.75);
if (this.B.alpha < 0.1){
main.remove(this);
};
};
c.onRemove = function (_arg1){
_arg1.target.bmp.dispose();
_arg1.target.removeEventListener(Event.REMOVED_FROM_STAGE, _arg1.target.onRemove);
};
c.addEventListener(Event.REMOVED_FROM_STAGE, c.onRemove);
return (c);
}
}
}//package ObakenoKoushin_fla
Section 6
//Ecrash (Ecrash)
package {
import flash.media.*;
public dynamic class Ecrash extends Sound {
}
}//package
Section 7
//Enemy (Enemy)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.system.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Enemy extends MovieClip {
public var size:Number;
public var life:Number;
public var speed:Number;
public var phase:Number;
public var F:TextField;
public var level:Number;
public var score:uint;
public var vel;
public var querk;
public var inertia:Number;
public var bobFreq:Number;
public var main;
public var game;
public function Enemy(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10);
}
public function onHit(_arg1, _arg2:Number=-1){
var d:*;
var ind:*;
var award:*;
var who = _arg1;
var power = _arg2;
if (power == -1){
power = who.power;
};
life = (life - power);
if (life <= 0){
d = dissolve(this, 2);
d.vel = vel.clone();
d.vel.normalize((d.vel.length / 2));
d.advance = function (){
this.x = (this.x + this.vel.x);
this.y = (this.y + this.vel.y);
this.vel.normalize((this.vel.length * 0.99));
this.blow();
this.expand(2);
};
ind = parent.getChildIndex(this);
main.register(parent.addChildAt(d, ind));
award = main.printWord(score.toString(), Math.min(4, ((1 / 2) + (score / 0x0200))));
main.create(award, parent);
award.time = -(Math.min((2 * 30), (score / 10)));
award.x = (x - ((0 * award.width) / 2));
award.y = (y + ((0 * award.height) / 2));
award.advance = function (){
this.time++;
if (this.time > 30){
this.alpha = (this.alpha - (1 / 8));
if (this.alpha <= 0){
main.remove(this);
};
};
};
game.cashIn(this);
remove();
};
}
public function squash(_arg1:Number=1, _arg2:Number=0.125, _arg3:Number=0.125, _arg4:Number=0){
var _local5:*;
_local5 = (((((_arg1 * phase) * 2) * Math.PI) / 30) + _arg4);
scaleX = (size * (1 + (_arg2 * Math.cos(_local5))));
scaleY = (size * (1 - (_arg3 * Math.cos(_local5))));
}
function frame10(){
querk = function (){
rock(1, 15);
squash(1, (1 / 4), (1 / 4));
};
}
function frame3(){
querk = function (){
rock(1, 15, 150);
squash(4);
};
}
function frame6(){
querk = function (){
rock(1, 5);
squash();
};
}
function frame7(){
querk = function (){
rock(1, 15);
squash(1, (1 / 4), (1 / 4));
};
}
function frame1(){
if (isNaN(level)){
level = (1 + ((20 * Math.random()) * Math.random()));
};
size = (1 + (3 * (1 - Math.exp((-(level) / 8)))));
score = (int((level + 1)) * 10);
phase = (32 * Math.random());
vel = new Point(0, 0);
querk = function (){
};
inertia = ((1 / size) / size);
if (isNaN(speed)){
speed = 1;
};
speed = (speed * ((4 * inertia) + (1 / 8)));
main = root;
if (isNaN(life)){
life = 0;
};
life = (life + ((16 * (1 + (size * size))) * (1 + (level / 2))));
bobFreq = ((2 + (8 * Math.random())) / 64);
game = MovieClip(parent.parent);
scaleX = (scaleY = size);
gotoAndStop((2 + int(((totalFrames - 1) * Math.random()))));
main.register(this, "Enemy");
}
public function dissolve(_arg1, _arg2:Number=4){
var d:*;
var marg:*;
var noiseSize:uint;
var bnds:*;
var who = _arg1;
var str = _arg2;
d = new MovieClip();
marg = (8 + (1 * str));
d.bmpD = main.sketch(who, marg);
d.draft = d.bmpD.clone();
noiseSize = int((2 + ((d.bmpD.width + d.bmpD.height) / 16)));
d.draft.perlinNoise(noiseSize, noiseSize, 1, (64 * Math.random()), true, true);
d.disp = new DisplacementMapFilter(d.draft, new Point(0, 0), 1, 2, str, str);
d.bmp = new Bitmap(d.bmpD, "auto", !(true));
d.holder = d.addChild(new MovieClip());
d.holder.addChild(d.bmp);
bnds = who.getBounds(who.parent);
d.holder.x = ((bnds.x - who.x) - marg);
d.holder.y = ((bnds.y - who.y) - marg);
d.advance = function (){
this.blow();
this.expand((str / 2));
};
d.expand = function (_arg1:Number=1){
this.alpha = (this.alpha * (1 - (_arg1 / 64)));
this.scaleX = (this.scaleX + (_arg1 / 0x0100));
this.scaleY = (this.scaleY + (_arg1 / 0x0100));
if (this.alpha < 0.0625){
main.remove(this);
};
};
d.blow = function (){
this.bmpD.applyFilter(this.bmpD, this.bmpD.rect, new Point(0, 0), this.disp);
};
d.onRemove = function (_arg1){
_arg1.target.bmpD.dispose();
_arg1.target.draft.dispose();
_arg1.target.removeEventListener(Event.REMOVED_FROM_STAGE, _arg1.target.onRemove);
};
d.addEventListener(Event.REMOVED_FROM_STAGE, d.onRemove);
d.x = who.x;
d.y = who.y;
return (d);
}
function frame4(){
querk = function (){
rotation = (rotation + 10);
squash(2);
};
}
function frame5(){
querk = function (){
rock(1, 15);
squash(1, (1 / 4), (1 / 4));
};
}
public function rock(_arg1:Number=1, _arg2:Number=30, _arg3:Number=0, _arg4:Number=0){
rotation = (_arg3 + (_arg2 * Math.cos(((((((_arg1 * phase) * 2) * Math.PI) / 30) / 2) + _arg4))));
}
public function advance(){
phase = (phase + (1 * inertia));
if (vel != null){
x = (x + vel.x);
y = (y + vel.y);
vel.y = (vel.y + ((((speed * Math.sin((phase * bobFreq))) - vel.y) * inertia) / 4));
vel.x = (vel.x * (1 - (inertia / 8)));
vel.y = (vel.y * (1 - (inertia / 8)));
if (y < 40){
vel.y = (vel.y + inertia);
} else {
if (y > 240){
vel.y = (vel.y - inertia);
};
};
vel.x = (vel.x + (((speed - vel.x) * Math.min((Math.max(level, 1) * inertia), 1)) / 4));
};
if (y < (-10 * size)){
y = (-10 * size);
} else {
if (y > (240 + (10 * size))){
y = (240 + (10 * size));
};
};
if (querk != null){
querk();
};
if (x > (400 + width)){
game.trespass(this);
remove();
};
}
function frame8(){
querk = function (){
rock(1, 15);
squash();
};
}
public function remove(){
main.remove(this);
}
function frame9(){
querk = function (){
rock(1, 15);
squash();
};
F.text = "!@#$%+&*?".charAt(int((9 * Math.random())));
}
function frame2(){
querk = function (){
rock(1, 15);
squash();
};
}
}
}//package
Section 8
//Eplop (Eplop)
package {
import flash.media.*;
public dynamic class Eplop extends Sound {
}
}//package
Section 9
//Epop (Epop)
package {
import flash.media.*;
public dynamic class Epop extends Sound {
}
}//package
Section 10
//Esnap (Esnap)
package {
import flash.media.*;
public dynamic class Esnap extends Sound {
}
}//package
Section 11
//Esnip (Esnip)
package {
import flash.media.*;
public dynamic class Esnip extends Sound {
}
}//package
Section 12
//Game (Game)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.system.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Game extends MovieClip {
public var diff:Number;
public var stg:Number;
public var BG:MovieClip;
public var instructB:GlowButton;
public var buttonEasy:GlowButton;
public var e:MovieClip;
public var elapsedTime:String;
public var seconds;
public var score:Number;
public var buttonNormal:GlowButton;
public var cheat:uint;
public var mistakes:Number;
public var minutes;
public var player:MovieClip;
public var GO;
public var field:MovieClip;
public var returnB:GlowButton;
public var hours;
public var buttonHard:GlowButton;
public var timer:uint;
public var scoreDisp:TextField;
public var phase;
public var msg;
public var meter:MovieClip;
public var skipAhead:uint;
public var manager:Glowball;
public var main;
public var difficulty:String;
public var cheat2:uint;
public var _root;
public var _parent;
public var cheatA:GlowButton;
public var cheatB:GlowButton;
public var cap;
public var cheatC:GlowButton;
public var rush:Number;
public var meter2:MovieClip;
public function Game(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4);
}
function frame3(){
_root.register(player);
_root.register(manager);
_root.pausable = true;
if (difficulty == "Easy"){
diff = -1;
} else {
if (difficulty == "Hard"){
diff = 1;
} else {
diff = 0;
};
};
timer = (((skipAhead * 10) * 30) * 60);
score = 0;
rush = 0;
phase = "wait";
field = new MovieClip();
this.addChild(field);
this.swapChildren(field, manager);
mistakes = 0;
manager.advance = function (){
timer = (timer + 1);
stg = ((1 + (diff / 2)) * (1 - Math.exp(((-(timer) / 0x0100) / 32))));
player.charge = (player.charge + (((1 - Math.exp(((-(score) / 128) / 128))) / 12) - (Math.min(0.5, diff) / 12)));
player.charge = (player.charge + (cheat / 16));
if (phase == "rush"){
if ((((field.numChildren < 64)) && ((Math.random() <= ((((2 * stg) + 1) / 30) + (((rush + mistakes) / 0x0100) / 16)))))){
cap = (128 * Math.log((1 + ((timer * (1 + (diff / 4))) / 0x0200))));
e = _root.create(new Enemy(), field);
e.game = this.parent;
e.y = ((160 * Math.random()) + 20);
e.x = -64;
e.level = ((1 / 2) + ((cap * stg) * Math.pow((Math.random() * Math.random()), 3)));
if (field.numChildren > 8){
e.level = (e.level * Math.exp((-(field.numChildren) / 8)));
};
e.life = (((stg * 100) + ((stg * e.level) * (1 + (diff / 4)))) + (((1 + (diff / 4)) * timer) / 0x0200));
e.speed = (((1 / 2) + ((1 - Math.exp(((-(timer) / 64) / 128))) * (0.75 + (Math.min(0.25, diff) / 4)))) + (Math.min(0.25, diff) / 4));
};
rush = (rush - (1 / 2));
if (rush <= 0){
phase = "wait";
rush = ((-((1 + (2 * Math.random()))) * 30) * (1 - (diff / 2)));
};
} else {
rush++;
if (Math.random() <= (rush / 0x0100)){
phase = "rush";
rush = main.random(32, (128 + (64 * diff)));
};
};
meter2.val = (mistakes / 100);
mistakes = (mistakes - (cheat2 / 32));
mistakes = Math.max(0, Math.min(100, (mistakes - ((1 - (diff / 2)) / 0x0100))));
if (mistakes >= 100){
goto("gameover");
};
};
BG.gotoAndStop("play");
BG.cacheAsBitmap = true;
}
function frame4(){
GO = main.printWord("GAME OVER", 1.5);
this.addChild(GO);
main.register(GO);
GO.x = 130;
GO.y = 60;
seconds = int((timer / 30));
minutes = int((seconds / 60));
hours = int((minutes / 60));
elapsedTime = (seconds % 60).toString();
if (elapsedTime.length < 1){
elapsedTime = ("0" + elapsedTime);
};
elapsedTime = (((minutes % 60) + " : ") + elapsedTime);
if (elapsedTime.length < 7){
elapsedTime = ("0" + elapsedTime);
};
if (hours > 0){
elapsedTime = ((hours + " : ") + elapsedTime);
};
scoreDisp.text = ((((difficulty + "\n") + score.toString()) + "\n") + elapsedTime);
returnB.onRelease = function (){
goto("title");
};
if (_root.paused){
_root.pauseToggle();
};
_root.pausable = false;
}
function frame1(){
_parent = parent;
_root = root;
main = _root;
cheat = 0;
cheat2 = 0;
skipAhead = 0;
difficulty = "Normal";
diff = 0;
buttonEasy.onRelease = function (){
difficulty = "Easy";
goto("play");
};
buttonNormal.onRelease = function (){
difficulty = "Normal";
goto("play");
};
buttonHard.onRelease = function (){
difficulty = "Hard";
goto("play");
};
instructB.onRelease = function (){
goto("instruction");
};
cheatA.onRelease = function (){
_root.playSound(new Epop());
cheat++;
};
cheatB.onRelease = function (){
_root.playSound(new Eplop());
skipAhead++;
};
cheatC.onRelease = function (){
_root.playSound(new Esnip());
cheat2++;
};
stop();
if (_root.paused){
_root.pauseToggle();
};
_root.pausable = false;
}
function frame2(){
_root.register(player);
_root.register(manager);
_root.pausable = true;
timer = ((0 * 30) * 60);
score = 0;
rush = 0;
phase = "init";
field = new MovieClip();
this.addChild(field);
this.swapChildren(field, manager);
mistakes = 0;
manager.advance = function (){
stg = (1 - Math.exp(((-(timer) / 0x0100) / 32)));
if (phase == "init"){
player.charge = 0;
phase = "charge";
timer = 0;
msg = printMessage("Rub the ball to charge up energy!", 0.5);
this.addChild(msg);
msg.x = ((player.x - msg.width) + 80);
msg.y = (player.y - 80);
} else {
if (phase == "charge"){
if (player.charge >= 50){
msg.disappear = true;
msg = printMessage("Aim a bolt with the mouse.\nHold down the button to keep it sailing,\nrelease it for a bang!", 0.5);
this.addChild(msg);
msg.x = (200 - (msg.width / 4));
msg.y = (150 - (msg.height / 4));
phase = "shoot";
timer = 0;
};
} else {
if (phase == "shoot"){
if (score > 20){
phase = "warnings";
msg.disappear = true;
msg = printMessage("If you let a ghost get past you,\nyour grandmother will be alerted\nand you'll get in trouble.\nDon't let it happen!", 0.5);
this.addChild(msg);
msg.x = 200;
msg.y = 10;
timer = 0;
};
} else {
if (phase == "warnings"){
player.charge = (player.charge * 0.9);
timer++;
if (timer > 240){
phase = "farewell";
msg.disappear = true;
msg = printMessage("That's all there is to it.\nEnjoy!", 0.5);
this.addChild(msg);
msg.x = (200 - (msg.width / 4));
msg.y = (150 - (msg.height / 4));
timer = 0;
};
} else {
if (phase == "farewell"){
timer++;
if (timer > 150){
returnB.onRelease();
};
};
};
};
};
};
if ((((phase == "shoot")) || ((phase == "warnings")))){
if ((((Math.random() <= (1 / 60))) || ((((phase == "warnings")) && ((Math.random() <= (1 / 30))))))){
e = _root.create(new Enemy(), field);
e.game = this.parent;
e.y = ((100 * Math.random()) + 20);
e.x = -64;
e.level = ((1 / 2) + ((100 * stg) * Math.pow((Math.random() * Math.random()), 3)));
e.life = (e.life + ((stg * 100) + (stg * e.level)));
};
} else {
if (phase == "wait"){
rush++;
if (Math.random() <= (rush / 0x0100)){
phase = "rush";
rush = main.random(32, 128);
};
};
};
meter2.val = (mistakes / 100);
mistakes = Math.max(0, Math.min(100, (mistakes - (1 / 0x0100))));
};
BG.gotoAndStop("play");
returnB.onRelease = function (){
goto("title");
};
}
public function printMessage(_arg1:String, _arg2:Number=1){
var line:Number;
var MC:*;
var begin:Number;
var end:Number;
var lines:*;
var W:*;
var a:*;
var sub:*;
var msg:*;
var L:*;
var blurb = _arg1;
var scale = _arg2;
line = 0;
MC = new MovieClip();
begin = 0;
end = blurb.indexOf("\n", begin);
if (end == -1){
end = blurb.length;
};
lines = new Array();
while (begin < blurb.length) {
sub = blurb.substring(begin, end);
msg = main.printWord(sub, scale, begin);
MC.addChild(msg);
main.register(msg);
msg.advance = function (){
if (MC.disappear){
this.alpha = (this.alpha - 0.1);
if (this.alpha <= 0){
main.remove(this);
};
};
};
msg.y = ((28 * scale) * line);
line = (line + 1);
begin = (end + 1);
end = blurb.indexOf("\n", begin);
if (end == -1){
end = blurb.length;
};
lines.push(msg);
};
W = MC.width;
for (a in lines) {
L = lines[a];
L.x = ((W - L.width) / 2);
};
MC.disappear = false;
return (MC);
}
public function goto(_arg1){
var _local2:*;
var _local3:*;
for (_local2 in _root.reg.Active) {
_local3 = _root.reg.Active[_local2];
if ((((_local3 instanceof MovieClip)) && (this.contains(_local3)))){
main.remove(_local3);
};
};
gotoAndStop(_arg1);
}
public function trespass(_arg1){
mistakes = (mistakes + (3 + ((1 + (diff / 4)) * ((_arg1.level * 2) + (mistakes / 10)))));
}
public function cashIn(_arg1){
score = (score + _arg1.score);
scoreDisp.text = score.toString();
}
}
}//package
Section 13
//Glowball (Glowball)
package {
import flash.display.*;
public dynamic class Glowball extends MovieClip {
}
}//package
Section 14
//GlowButton (GlowButton)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.system.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class GlowButton extends MovieClip {
public var glo:Glowball;
public var _null:Function;
public var onOver:Function;
public var onRelease:Function;
public var advance:Function;
public var down:Boolean;
public var onPress:Function;
public var main;
public var over:Boolean;
public var onOut:Function;
public function GlowButton(){
addFrameScript(0, frame1);
}
public function _onRollOut(_arg1){
stage.addEventListener(MouseEvent.MOUSE_UP, _onReleaseOutside);
}
public function _onPress(_arg1){
down = true;
if (main.paused){
return;
};
onPress();
}
function frame1(){
over = false;
down = false;
main = MovieClip(root);
_null = function (){
};
if (onOver == undefined){
onOver = _null;
};
if (onOut == undefined){
onOut = _null;
};
if (onPress == undefined){
onPress = _null;
};
if (onRelease == undefined){
onRelease = _null;
};
glo.alpha = 0;
advance = function (){
var _local1:*;
_local1 = 0;
if (over){
_local1 = (_local1 + 0.5);
};
if (down){
_local1 = (_local1 + 0.5);
};
glo.alpha = ((glo.alpha * 0.75) + (_local1 * 0.25));
};
main.register(this);
this.addEventListener(MouseEvent.MOUSE_DOWN, _onPress);
this.addEventListener(MouseEvent.MOUSE_OUT, _onOut);
this.addEventListener(MouseEvent.MOUSE_OVER, _onOver);
this.addEventListener(MouseEvent.MOUSE_UP, _onRelease);
this.addEventListener(MouseEvent.ROLL_OUT, _onRollOut);
this.addEventListener(Event.REMOVED_FROM_STAGE, function (_arg1){
_arg1.currentTarget.removeEventListener(MouseEvent.ROLL_OUT, _onRollOut);
_arg1.currentTarget._onReleaseOutside(_arg1);
});
}
public function _onOver(_arg1){
over = true;
onOver();
}
public function _onRelease(_arg1){
if (main.paused){
return;
};
if (down){
onRelease();
};
down = false;
}
public function _onReleaseOutside(_arg1){
down = false;
stage.removeEventListener(MouseEvent.MOUSE_UP, _onReleaseOutside);
}
public function _onOut(_arg1){
over = false;
onOut();
}
}
}//package
Section 15
//Glyph (Glyph)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.system.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Glyph extends MovieClip {
public var bounciness:Number;
public var timer:Number;
public var scale:Number;
public var Alph:TextField;
public var h:Number;
public var vel:Number;
public var base;
public function Glyph(){
addFrameScript(0, frame1);
}
function frame1(){
if (isNaN(timer)){
timer = 0;
};
if (isNaN(scale)){
scale = 1;
};
if (isNaN(bounciness)){
bounciness = 1;
};
scaleX = (scaleY = scale);
base = y;
Alph.text = this.char;
vel = (-2 * (4 + Math.random()));
h = 0;
}
public function advance(){
var _local1:*;
if (timer <= 0){
timer++;
visible = false;
h = (-8 + (4 * Math.random()));
} else {
visible = true;
h = (h + vel);
_local1 = 1;
if (h < 0){
vel = (vel + 3);
vel = (vel * 0.9);
_local1 = ((_local1 / 2) + ((1 + (Math.atan((vel / 4)) / 2)) / 2));
} else {
_local1 = (1 + (1 - Math.exp((-(h) / 8))));
vel = (vel * 0.6);
vel = (vel - h);
if ((((Math.abs(vel) < 2)) && ((h < 1)))){
this.unregister(this);
this.cacheAsBitmap = true;
_local1 = 1;
h = 0;
};
};
y = ((Math.min(0, h) * scale) + base);
scaleX = ((scaleX / 2) + ((scale * _local1) / 2));
scaleY = ((scaleY / 2) + ((scale / _local1) / 2));
};
}
}
}//package
Section 16
//marker (marker)
package {
import flash.display.*;
public dynamic class marker extends MovieClip {
}
}//package
Section 17
//Shockwave (Shockwave)
package {
import flash.display.*;
public dynamic class Shockwave extends MovieClip {
}
}//package