Section 1
//Balloon (collectables.Balloon)
package collectables {
import flash.display.*;
import flash.geom.*;
import gameutil.*;
import fx.*;
public class Balloon {
private var fclock;// = 0
private var tw:Number;// = 0
public var gstate:String;// = "norm"
private var dir:Array;
private var dy;
private var risetime;// = 10
private var dx:Number;
private var halfw;
private var ao;
private var fdelay;// = 0
private var thresh;
public var tp2;
public var dsp;
private var isplaying:Boolean;// = false
private var hsp;// = 0
public var oldstate;// = "norm"
private var wsp;// = 0
private var xspeed;// = 30
private var rot;
private var oh;// = 0
public var anchorp;
public var sp:Sprite;
private var d;
private var riseclock:Number;// = 0
private var ow;// = 0
private var th;// = 0
private var bigRad:int;// = 0
private var pd:Object;
public var tp:Point;
public static var blist:Array = [];
public function Balloon(_arg1:int, _arg2:int){
gstate = "norm";
oldstate = "norm";
xspeed = 30;
bigRad = 0;
isplaying = false;
riseclock = 0;
risetime = 10;
tw = 0;
th = 0;
ow = 0;
oh = 0;
wsp = 0;
hsp = 0;
fclock = 0;
fdelay = 0;
super();
sp = new redBalloon();
sp.x = _arg1;
sp.y = _arg2;
Game.mc.addChild(sp);
dsp = new Sprite();
dsp.x = _arg1;
dsp.y = _arg2;
Game.mc.addChild(dsp);
bigRad = (sp.width * sp.width);
tp = new Point();
anchorp = new Point(((Math.random() - 0.5) * 5), 128);
tp2 = new Point();
halfw = (sp.width / 2);
ow = sp.width;
oh = sp.height;
tw = sp.width;
th = sp.height;
fclock = Math.random();
fdelay = 3;
gstate = "norm";
blist.push(this);
}
private function drawString():void{
dsp.x = sp.x;
dsp.y = sp.y;
dsp.graphics.clear();
dsp.graphics.lineStyle(2, 0xFFFFFF, 1, false, "none");
dsp.graphics.moveTo(0, 0);
dsp.graphics.lineTo(anchorp.x, anchorp.y);
}
private function checkPlayer():void{
thresh = ((Game.flub.halfw * Game.flub.halfw) + bigRad);
dx = (Game.flub.hitsp.x - sp.x);
dy = (Game.flub.hitsp.y - sp.y);
d = ((dx * dx) + (dy * dy));
if (d < thresh){
if (Game.flub.gstate != "reentry"){
if (Game.flub.gstate != "gameover"){
collect();
};
} else {
pop();
};
};
if (d < 180000){
if (!isplaying){
isplaying = true;
};
} else {
if (isplaying){
isplaying = false;
};
};
}
private function collect():void{
SoundMan.ballooncatch.play(0, 0, SoundMan.sfxtf);
Game.flub.btarg = this;
Game.flub.gstate = "balloon";
gstate = "riding";
}
public function pauseMe():void{
oldstate = gstate;
gstate = "paused";
}
public function unPauseMe():void{
gstate = oldstate;
}
public function update():void{
switch (gstate){
case "norm":
float();
drawString();
checkPlayer();
flubber();
break;
case "riding":
rise();
flubber();
if (Game.flub.gstate == "gameover"){
pop();
};
break;
};
}
public function kill():void{
if (Game.mc.contains(sp)){
Game.mc.removeChild(sp);
};
if (Game.mc.contains(dsp)){
Game.mc.removeChild(dsp);
};
}
private function pop():void{
var _local1:int;
SoundMan.bpop.play(0, 0, SoundMan.sfxtf);
new Shockring(sp.x, sp.y, Game.flubfx, -1, "bigpow", "slowscale");
_local1 = 0;
while (_local1 < 6) {
dir = Helper.getSpecificDir((_local1 * 60), 20);
rot = (_local1 * 60);
ao = {delay:0, times:[0, 1, 0], values:[1, 1, 0], lifetime:16, interval:33, loop:false};
pd = {loc:new Point(sp.x, sp.y), trails:false, xs:dir[0], rot:rot, ys:dir[1], itype:"bpiece", bm:"normal", colormode:"fixed", scol:0, ecol:null, alerp:ao, xlerp:null, ylerp:null, loop:false, motype:"stretch", resettype:"none"};
Particle.getP(pd, Game.flubfx);
_local1++;
};
if (Game.flub.gstate == "balloon"){
Game.flub.gstate = "norm";
};
if (Game.flub.gstate == "gameover"){
Game.flub.gstate = "gameover";
};
if (Game.flub.gstate != "reentry"){
Game.flub.yspeed = 0;
} else {
Game.flub.yspeed = (Game.flub.yspeed * 0.8);
};
gstate = "dead";
kill();
}
private function rise():void{
var _local1:Point;
riseclock = (riseclock + Tick.ftime);
if (riseclock > risetime){
riseclock = 0;
pop();
return;
};
dx = (sp.x - Game.flub.hitsp.x);
dy = ((sp.y + 128) - Game.flub.hitsp.y);
Game.flub.hitsp.x = (Game.flub.hitsp.x + (dx * 0.1));
Game.flub.hitsp.y = (Game.flub.hitsp.y + (dy * 0.1));
sp.x = (sp.x - (dx * 0.1));
sp.y = (sp.y - (dy * 0.1));
sp.y = (sp.y - (50 * Tick.ftime));
dsp.x = sp.x;
dsp.y = sp.y;
dsp.graphics.clear();
dsp.graphics.lineStyle(2, 0xFFFFFF, 1, false, "none");
dsp.graphics.moveTo(0, 0);
_local1 = new Point(Game.flub.droot.x, Game.flub.droot.y);
_local1 = Game.flub.mc.localToGlobal(_local1);
_local1 = Game.mc.globalToLocal(_local1);
tp = Game.mc.localToGlobal(_local1);
tp = dsp.globalToLocal(tp);
dsp.graphics.lineTo(tp.x, tp.y);
}
private function float(){
sp.x = (sp.x + (xspeed * Tick.ftime));
if (sp.x < halfw){
sp.x = halfw;
xspeed = -(xspeed);
};
if (sp.x > (0x0200 - halfw)){
sp.x = (0x0200 - halfw);
xspeed = -(xspeed);
};
}
private function flubber():void{
fclock = (fclock - Tick.ftime);
if (fclock < 0){
tw = (ow * 1.3);
th = (oh * 1.3);
fclock = fdelay;
};
dx = ((tw - sp.width) * 0.02);
dy = ((th - sp.height) * 0.02);
wsp = (dx + (wsp * 0.98));
hsp = (dy + (hsp * 0.98));
sp.width = (sp.width + wsp);
sp.height = (sp.height + hsp);
if (tw > ow){
tw = Math.max((tw - 0.1), ow);
};
if (tw < ow){
tw = Math.min((tw + 0.1), ow);
};
if (th > oh){
th = Math.max((th - 0.1), oh);
};
if (th < oh){
th = Math.min((th + 0.1), oh);
};
}
public static function killAll():void{
var _local1:Balloon;
for each (_local1 in blist) {
_local1.kill();
};
blist = [];
}
public static function unPauseAll():void{
var _local1:Balloon;
for each (_local1 in blist) {
_local1.unPauseMe();
};
}
public static function updateAll():void{
var _local1:Balloon;
for each (_local1 in blist) {
_local1.update();
};
}
public static function pauseAll():void{
var _local1:Balloon;
for each (_local1 in blist) {
_local1.pauseMe();
};
}
}
}//package collectables
Section 2
//Boost (collectables.Boost)
package collectables {
import flash.display.*;
import gameutil.*;
public class Boost {
private var isplaying:Boolean;// = false
public var oldstate;
public var gstate:String;// = "norm"
private var dy;
private var dx:int;
public var sp:MovieClip;
private var d;
private var bclock:Number;// = 0
private var bigRad:int;
private var thresh;
public static var blist:Array = [];
public function Boost(_arg1:int, _arg2:int){
gstate = "norm";
isplaying = false;
bclock = 0;
super();
sp = new booster();
sp.x = _arg1;
sp.y = _arg2;
Game.mc.addChild(sp);
bigRad = (sp.width * sp.width);
blist.push(this);
}
public function update():void{
switch (gstate){
case "norm":
bclock = (bclock + Tick.ftime);
checkPlayer();
break;
};
}
private function checkPlayer():void{
thresh = ((Game.flub.halfw * Game.flub.halfw) + bigRad);
dx = (Game.flub.hitsp.x - sp.x);
dy = (Game.flub.hitsp.y - sp.y);
d = ((dx * dx) + (dy * dy));
if (d < thresh){
if (Game.flub.gstate != "reentry"){
collect();
};
};
if (d < 180000){
if (!isplaying){
sp.play();
isplaying = true;
};
} else {
if (isplaying){
sp.stop();
isplaying = false;
};
};
}
public function unPauseMe():void{
gstate = oldstate;
}
public function kill():void{
Game.mc.removeChild(sp);
}
public function pauseMe():void{
oldstate = gstate;
gstate = "paused";
}
private function collect():void{
if (bclock > 1){
Game.flub.boost();
SoundMan.boost.play(0, 0, SoundMan.sfxtf);
bclock = 0;
};
}
public static function killAll():void{
var _local1:Boost;
for each (_local1 in blist) {
_local1.kill();
};
blist = [];
}
public static function unPauseAll():void{
var _local1:Boost;
for each (_local1 in blist) {
_local1.unPauseMe();
};
}
public static function setz():void{
var _local1:Boost;
for each (_local1 in blist) {
Game.mc.setChildIndex(_local1.sp, (Game.mc.numChildren - 1));
};
}
public static function pauseAll():void{
var _local1:Boost;
for each (_local1 in blist) {
_local1.pauseMe();
};
}
public static function updateAll():void{
var _local1:Boost;
for each (_local1 in blist) {
_local1.update();
};
}
}
}//package collectables
Section 3
//DarkMatter (collectables.DarkMatter)
package collectables {
import flash.display.*;
import flash.geom.*;
import gameutil.*;
import fx.*;
public class DarkMatter {
private var tp:Point;
public var killflag:Boolean;// = false
private var osp;// = 2
public var pointList:Array;
public var gstate:String;// = "norm"
private var dx;// = 0
private var dy;// = 0
private var maxs;// = 50
public var sp:Sprite;
public var cto:ColorTransform;
private var d:Number;// = 0
private var ox;
public var dtime:int;// = 2
private var oy;
public static var gstate:String = "norm";
public static var oldstate;
public function DarkMatter(_arg1:Number, _arg2:Number){
var _local3:int;
var _local4:Object;
var _local5:Point;
var _local6:*;
pointList = [];
gstate = "norm";
killflag = false;
dtime = 2;
d = 0;
dx = 0;
dy = 0;
osp = 2;
maxs = 50;
super();
sp = new dm();
sp.x = _arg1;
sp.y = _arg2;
ox = _arg1;
oy = _arg2;
sp.cacheAsBitmap = true;
Game.mc.addChild(sp);
_local3 = 0;
while (_local3 < 4) {
_local4 = {};
_local5 = new Point();
_local6 = Helper.getRandomDir(100);
_local5.x = (_arg1 + _local6.x);
_local5.y = (_arg2 + _local6.y);
_local4.p = _local5;
_local4.sx = ((Math.random() - 0.5) * 50);
_local4.sy = ((Math.random() - 0.5) * 50);
_local4.delay = 0;
pointList.push(_local4);
_local3++;
};
tp = new Point(0, 0);
cto = Helper.getColorT(0);
}
private function move2player():void{
d = Math.atan2(dy, dx);
sp.x = (sp.x + (Math.cos(d) * 13));
sp.y = (sp.y + (Math.sin(d) * 13));
}
public function update():void{
switch (gstate){
case "norm":
updateOrbs();
if (Game.flub.hitsp.y < 300){
dtime = 0;
gstate = "findplayer";
};
break;
case "findplayer":
updateOrbs();
checkPlayer();
move2player();
if (Game.flub.hitsp.y > 10000){
gstate = "norm";
sp.x = ox;
sp.y = oy;
};
break;
};
}
public function checkPlayer():void{
if (!killflag){
dx = (Game.flub.hitsp.x - sp.x);
dy = (Game.flub.hitsp.y - sp.y);
d = Math.sqrt(((dx * dx) + (dy * dy)));
osp = (7 + d);
maxs = Math.min((80 + d), 2000);
if (d < 50){
sp.visible = false;
SoundMan.dmcatch.play(0, 0, SoundMan.sfxtf);
new Shockring(sp.x, sp.y, Game.flubfx, 1);
Game.flub.gstate = "dmtrans";
gstate = "captured";
Points.setMilestone("Dark_Matter");
Points.dark_matter = true;
Shoman.writeSO("game_complete");
};
};
}
public function unPauseMe():void{
gstate = oldstate;
}
public function pauseMe():void{
oldstate = gstate;
gstate = "paused";
}
private function updateOrbs():void{
var _local1:Object;
var _local2:Object;
var _local3:Object;
for each (_local1 in pointList) {
_local1.p.x = (_local1.p.x + (_local1.sx * Tick.ftime));
_local1.p.y = (_local1.p.y + (_local1.sy * Tick.ftime));
if (_local1.p.x > sp.x){
_local1.sx = Math.max((_local1.sx - osp), -(maxs));
};
if (_local1.p.y > sp.y){
_local1.sy = Math.max((_local1.sy - osp), -(maxs));
};
if (_local1.p.x < sp.x){
_local1.sx = Math.min((_local1.sx + osp), maxs);
};
if (_local1.p.y < sp.y){
_local1.sy = Math.min((_local1.sy + osp), maxs);
};
_local1.delay++;
if (_local1.delay > dtime){
_local2 = {delay:0, times:[0, 0.1, 1], values:[0.3, 1, 0], lifetime:10, interval:33, loop:false};
_local3 = {loc:_local1.p, trails:false, itype:"fuzz", bm:"add", colormode:"fixed", scol:cto, ecol:cto, alerp:_local2, xlerp:null, ylerp:null, loop:false, motype:"fixed", resettype:"none"};
Particle.getP(_local3, Game.mc);
_local1.delay = 0;
};
};
}
public function kill():void{
if (gstate != "dead"){
gstate = "dead";
killflag = true;
Game.mc.removeChild(sp);
};
}
}
}//package collectables
Section 4
//FlubAdd (collectables.FlubAdd)
package collectables {
import flash.display.*;
import flash.geom.*;
import gameutil.*;
import fx.*;
public class FlubAdd {
private var isplaying:Boolean;// = false
public var oldstate;
private var oktoplay;// = true
public var gstate:String;// = "norm"
private var dy;
private var dx:int;
public var sp:Sprite;
private var d;
private var ao;
private var pd:Object;
private var bigRad:int;
private var thresh;
public static var flist:Array = [];
public function FlubAdd(_arg1:int, _arg2:int){
gstate = "norm";
isplaying = false;
oktoplay = true;
super();
(sp = new flubberadd());
(sp.x = _arg1);
(sp.y = _arg2);
Game.mc.addChild(sp);
(bigRad = (sp.width * sp.width));
(sp.visible = true);
flist.push(this);
}
public function update():void{
switch (gstate){
case "norm":
checkPlayer();
if (isplaying){
drip();
};
break;
};
}
private function drip():void{
var _local1:Number;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:Number;
_local1 = Math.random();
if (_local1 < 0.3){
_local2 = ((Math.random() * 16) + 2);
_local3 = ((sp.y + (Math.random() * 16)) + 32);
_local4 = (sp.x + ((Math.random() - 0.5) * 16));
_local5 = (((Math.random() * 8) * 0.1) + 0.1);
(ao = {delay:0, times:[0, 1], values:[1, 0], lifetime:20, interval:33, loop:false});
(pd = {speed:new Point(0, 0), startw:_local2, starth:_local2, loc:new Point(_local4, sp.y), trails:false, itype:"goo", bm:"normal", colormode:"fixed", scol:0, ecol:0, alerp:ao, xlerp:null, ylerp:null, loop:false, motype:"grav", gstr:_local5, scmode:1, resettype:"none"});
Particle.getP(pd, Game.flubfx);
};
}
private function checkPlayer():void{
(thresh = ((Game.flub.halfw * Game.flub.halfw) + bigRad));
(dx = (Game.flub.hitsp.x - sp.x));
(dy = (Game.flub.hitsp.y - sp.y));
(d = ((dx * dx) + (dy * dy)));
if (d < thresh){
collect();
} else {
(oktoplay = true);
};
if (d < 180000){
if (!isplaying){
(isplaying = true);
};
} else {
if (isplaying){
(isplaying = false);
};
};
}
public function kill():void{
Game.mc.removeChild(sp);
}
public function unPauseMe():void{
(gstate = oldstate);
}
private function collect():void{
if (oktoplay){
SoundMan.fill.play(0, 0, SoundMan.sfxtf);
(oktoplay = false);
};
Game.flub.changeSize(10);
}
public function pauseMe():void{
(oldstate = gstate);
(gstate = "paused");
}
public static function killAll():void{
var _local1:FlubAdd;
for each (var _local4 in flist) {
_local1 = _local4;
_local4;
_local1.kill();
};
(flist = []);
}
public static function updateAll():void{
var _local1:FlubAdd;
for each (_local1 in flist) {
_local1.update();
};
}
public static function pauseAll():void{
var _local1:FlubAdd;
for each (var _local4 in flist) {
_local1 = _local4;
_local4;
_local1.pauseMe();
};
}
public static function unPauseAll():void{
var _local1:FlubAdd;
for each (var _local4 in flist) {
_local1 = _local4;
_local4;
_local1.unPauseMe();
};
}
public static function setz():void{
var _local1:FlubAdd;
for each (_local1 in flist) {
};
}
}
}//package collectables
Section 5
//GameConnector (com.doof.client.gameconnector.GameConnector)
package com.doof.client.gameconnector {
import flash.events.*;
import flash.display.*;
import flash.system.*;
import flash.net.*;
import com.doof.client.gameshell.*;
public class GameConnector extends MovieClip {
private var _parentRef:DisplayObject;
private var _splashFinishedMethod:Function;
private var _restartGameMethod:Function;
public var _gameObject:Object;
private var _gameID:String;
public var _userProfileObject:Object;
private var _gameShell;
public function GameConnector(_arg1:DisplayObject, _arg2:String, _arg3:Function, _arg4:Function){
trace("GameConnector V8 constructor called");
allowDomains();
_parentRef = _arg1;
_gameID = _arg2;
_splashFinishedMethod = _arg3;
_restartGameMethod = _arg4;
loadGameShell();
}
private function getPassedParameter(_arg1:String):String{
var _local2:Object;
var _local3:String;
_local2 = LoaderInfo(_parentRef.root.loaderInfo).parameters;
_local3 = String(_local2[_arg1]);
return (_local3);
}
public function init():void{
trace("GameConnector init();");
_gameShell.init(_parentRef, _gameID, _splashFinishedMethod, _restartGameMethod);
}
private function loadGameShell():void{
var _local1:Loader;
var _local2:URLRequest;
var _local3:String;
_local1 = new Loader();
_local3 = getPassedParameter("environment");
if (((!((_local3 == "null"))) && (!((_local3 == "undefined"))))){
_local2 = new URLRequest((("http://cdn.doof.com/static/gameClient/shell/GameShell" + _local3) + ".swf"));
} else {
_local2 = new URLRequest("http://cdn.doof.com/static/gameClient/shell/GameShell.swf");
};
_local1.contentLoaderInfo.addEventListener(Event.COMPLETE, shellLoadCompleteHandler);
_local1.load(_local2);
}
public function gameStarted(_arg1:int):void{
trace((("GameConnector gameStarted(" + _arg1) + ");"));
_gameShell.gameStarted(_arg1);
}
public function gameStat(_arg1:String, _arg2:String):void{
trace((((("GameConnector gameStat(" + _arg1) + ", ") + _arg2) + ");"));
_gameShell.gameStat(_arg1, _arg2);
}
private function allowDomains():void{
Security.allowDomain("*");
Security.allowInsecureDomain("*");
}
private function shellLoadCompleteHandler(_arg1:Event):void{
_gameShell = MovieClip(_arg1.currentTarget.content);
if (_gameShell != null){
_gameShell.setGameConnector(this);
_gameShell.setGameURL(_parentRef.root.loaderInfo.url);
_gameShell.init(_parentRef, _gameID, _splashFinishedMethod, _restartGameMethod);
} else {
trace("Game shell not loaded, please make sure both swf files are using network sandbox mode.");
};
}
public function gameEnded(_arg1:int):void{
trace((("GameConnector gameEnded(" + _arg1) + ");"));
_gameShell.gameEnded(_arg1);
}
}
}//package com.doof.client.gameconnector
Section 6
//KongregateEvent (com.kongregate.as3.client.events.KongregateEvent)
package com.kongregate.as3.client.events {
import flash.events.*;
public class KongregateEvent extends Event {
public static const COMPLETE:String = "component_api_available";
public function KongregateEvent(_arg1:String){
super(_arg1);
}
}
}//package com.kongregate.as3.client.events
Section 7
//AbstractShadowService (com.kongregate.as3.client.services.AbstractShadowService)
package com.kongregate.as3.client.services {
import flash.events.*;
public class AbstractShadowService extends EventDispatcher {
protected function alert(_arg1:String, _arg2:String, _arg3="", _arg4:String=""):void{
trace(((((((("Kongregate API: " + _arg1) + ".") + _arg2) + "(") + _arg3) + ") ") + _arg4));
}
}
}//package com.kongregate.as3.client.services
Section 8
//HighScoreServiceShadow (com.kongregate.as3.client.services.HighScoreServiceShadow)
package com.kongregate.as3.client.services {
public class HighScoreServiceShadow extends AbstractShadowService implements IHighScoreServices {
private var mode:String;
public function HighScoreServiceShadow(){
mode = "";
}
public function submit(_arg1:Number, _arg2:String=null):void{
alert("IHighScoreServices", "submit", arguments);
}
public function connect():Boolean{
alert("IKongregateServices", "connect");
return (true);
}
public function requestList(_arg1:Function):void{
alert("IHighScoreServices", "requestList", "", (("[Mode: " + mode) + "]"));
_arg1({success:false});
}
public function setMode(_arg1:String):void{
alert("IHighScoreServices", "setMode", arguments);
this.mode = _arg1;
}
}
}//package com.kongregate.as3.client.services
Section 9
//IHighScoreServices (com.kongregate.as3.client.services.IHighScoreServices)
package com.kongregate.as3.client.services {
public interface IHighScoreServices {
function setMode(_arg1:String):void;
function submit(_arg1:Number, _arg2:String=null):void;
function requestList(_arg1:Function):void;
}
}//package com.kongregate.as3.client.services
Section 10
//IKongregateServices (com.kongregate.as3.client.services.IKongregateServices)
package com.kongregate.as3.client.services {
import flash.events.*;
public interface IKongregateServices extends IEventDispatcher {
function getPlayerInfo(_arg1:Function):void;
function connect(_arg1:Number=-1):Boolean;
}
}//package com.kongregate.as3.client.services
Section 11
//IStatServices (com.kongregate.as3.client.services.IStatServices)
package com.kongregate.as3.client.services {
public interface IStatServices {
function submitArray(_arg1:Array):void;
function submit(_arg1:String, _arg2:Number):void;
}
}//package com.kongregate.as3.client.services
Section 12
//IUserServices (com.kongregate.as3.client.services.IUserServices)
package com.kongregate.as3.client.services {
public interface IUserServices {
function getName():String;
function getPlayerInfo(_arg1:Function):void;
}
}//package com.kongregate.as3.client.services
Section 13
//KongregateServiceShadow (com.kongregate.as3.client.services.KongregateServiceShadow)
package com.kongregate.as3.client.services {
public class KongregateServiceShadow extends AbstractShadowService implements IKongregateServices {
public function getName():String{
alert("IKongregateServices", "getName");
return ("Guest");
}
public function connect(_arg1:Number=-1):Boolean{
alert("IKongregateServices", "connect", arguments);
return (true);
}
public function getPlayerInfo(_arg1:Function):void{
alert("IKongregateServices", "getPlayerInfo");
_arg1(new Object());
}
}
}//package com.kongregate.as3.client.services
Section 14
//StatServiceShadow (com.kongregate.as3.client.services.StatServiceShadow)
package com.kongregate.as3.client.services {
public class StatServiceShadow extends AbstractShadowService implements IStatServices {
public function submitArray(_arg1:Array):void{
alert("IStatServices", "submitArray", arguments);
}
public function submit(_arg1:String, _arg2:Number):void{
alert("IStatServices", "submitStat", arguments);
}
}
}//package com.kongregate.as3.client.services
Section 15
//UserServiceShadow (com.kongregate.as3.client.services.UserServiceShadow)
package com.kongregate.as3.client.services {
public class UserServiceShadow extends AbstractShadowService implements IUserServices {
public function getName():String{
alert("UserService", "getName");
return ("Guest");
}
public function getPlayerInfo(_arg1:Function):void{
alert("UserService", "getPlayerInfo");
_arg1({isGuest:true, name:"Guest", points:0, level:0, isMode:false, isAdmin:false, isDeveloper:false, avatarPath:"", chatAvatarPath:""});
}
}
}//package com.kongregate.as3.client.services
Section 16
//IAPIBootstrap (com.kongregate.as3.client.IAPIBootstrap)
package com.kongregate.as3.client {
import flash.events.*;
import flash.display.*;
public interface IAPIBootstrap {
function init(_arg1:Event=null, _arg2:Stage=null):void;
function hideLog():void;
function showLog(_arg1:int=0):void;
}
}//package com.kongregate.as3.client
Section 17
//KongregateAPI (com.kongregate.as3.client.KongregateAPI)
package com.kongregate.as3.client {
import flash.events.*;
import flash.display.*;
import com.kongregate.as3.client.events.*;
import com.kongregate.as3.client.services.*;
import flash.system.*;
import flash.utils.*;
import flash.net.*;
import flash.errors.*;
public class KongregateAPI extends Sprite {
private const VERSION:Number = 1;
private var loader:Loader;
private var loadedDomain:ApplicationDomain;
private static const CLASS_USER:String = "com.kongregate.as3.client.services.UserServices";
private static const CLASS_STATS:String = "com.kongregate.as3.client.services.StatServices";
private static const CLASS_SERVICES:String = "com.kongregate.as3.client.services.KongregateServices";
private static const CLASS_SCORES:String = "com.kongregate.as3.client.services.HighScoreServices";
private static const DEBUG_API_URL:String = "//Linuxpc/kongregate/public/flash/API_AS3.swf";
private static var _connected:Boolean;
private static var kUser:IUserServices;
private static var _loaded:Boolean;
private static var kServices:IKongregateServices;
private static var kScores:IHighScoreServices;
private static var mInstance:KongregateAPI;
private static var kStats:IStatServices;
private static var kAPI:IAPIBootstrap;
public function KongregateAPI(){
if (mInstance != null){
throw (new Error("Warning: KongregateAPI has been added to stage more than once or accessed improperly. Use getInstance() or a stage reference to access."));
};
mInstance = this;
this.addEventListener(Event.ADDED_TO_STAGE, init, false, 0, true);
}
public function get loaded():Boolean{
return (_loaded);
}
public function get connected():Boolean{
return (_connected);
}
private function alertConnected(_arg1:TimerEvent=null):void{
var _local2:KongregateEvent;
var _local3:Boolean;
_local2 = new KongregateEvent(KongregateEvent.COMPLETE);
_local3 = this.dispatchEvent(_local2);
}
private function init(_arg1:Event):void{
var _local2:Object;
var _local3:String;
var _local4:URLRequest;
var _local5:LoaderContext;
this.removeEventListener(Event.ADDED_TO_STAGE, init);
_loaded = false;
_connected = false;
_local2 = LoaderInfo(root.loaderInfo).parameters;
_local3 = _local2.api_path;
if (_local3 == null){
trace("Alert: Kongregate API could not be loaded, due to local testing. API will load when the game is uploaded.");
createShadowServices();
return;
};
Security.allowDomain("*.kongregate.com");
Security.allowDomain("kongregatetrunk.com");
_local4 = new URLRequest(_local3);
_local5 = new LoaderContext(false);
_local5.applicationDomain = ApplicationDomain.currentDomain;
_local5.securityDomain = SecurityDomain.currentDomain;
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);
loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
loader.load(_local4, _local5);
}
public function get api():IAPIBootstrap{
return (kAPI);
}
private function loadComplete(_arg1:Event):void{
getServices();
}
public function get scores():IHighScoreServices{
return (kScores);
}
private function ioErrorHandler(_arg1:IOErrorEvent):void{
throw (new IOError(("API file not found. " + _arg1)));
}
public function get services():IKongregateServices{
return (kServices);
}
public function get stats():IStatServices{
return (kStats);
}
private function createShadowServices():void{
var _local1:Timer;
trace(">>> Kongregate Shadow Services instantiated for local development..");
kServices = new KongregateServiceShadow();
kScores = new HighScoreServiceShadow();
kStats = new StatServiceShadow();
kUser = new UserServiceShadow();
_local1 = new Timer(200, 1);
_local1.addEventListener(TimerEvent.TIMER_COMPLETE, alertConnected);
_local1.start();
_connected = true;
}
public function get user():IUserServices{
return (kUser);
}
private function getServices():void{
var _local1:ApplicationDomain;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
_local1 = ApplicationDomain.currentDomain;
kAPI = IAPIBootstrap(loader.getChildAt(0));
this.addChild(loader);
_local2 = _local1.getDefinition(CLASS_SERVICES);
trace(_local2);
kServices = _local2.getInstance();
_local3 = _local1.getDefinition(CLASS_SCORES);
kScores = _local3.getInstance();
_local4 = _local1.getDefinition(CLASS_STATS);
kStats = _local4.getInstance();
_local5 = _local1.getDefinition(CLASS_USER);
kUser = _local5.getInstance();
kServices.connect(VERSION);
_loaded = true;
_connected = true;
alertConnected();
}
public static function getInstance():KongregateAPI{
if (!mInstance){
throw (new IllegalOperationError("You must add the Kongregate API component to the stage before attempting to access it."));
};
return (mInstance);
}
}
}//package com.kongregate.as3.client
Section 18
//AssetLoader_5 (flubber_fla.AssetLoader_5)
package flubber_fla {
import flash.display.*;
public dynamic class AssetLoader_5 extends MovieClip {
public function AssetLoader_5(){
addFrameScript(0, frame1);
}
function frame1(){
this.stop();
}
}
}//package flubber_fla
Section 19
//btxt_77 (flubber_fla.btxt_77)
package flubber_fla {
import flash.display.*;
import flash.text.*;
public dynamic class btxt_77 extends MovieClip {
public var best_txt:TextField;
}
}//package flubber_fla
Section 20
//ffg_loader_link_98 (flubber_fla.ffg_loader_link_98)
package flubber_fla {
import flash.display.*;
public dynamic class ffg_loader_link_98 extends MovieClip {
public function ffg_loader_link_98(){
addFrameScript(0, frame1);
}
function frame1(){
}
}
}//package flubber_fla
Section 21
//gameover_69 (flubber_fla.gameover_69)
package flubber_fla {
import flash.display.*;
public dynamic class gameover_69 extends MovieClip {
public var pa_btn:MovieClip;
public var winbox:MovieClip;
public var menu_btn:MovieClip;
public var sub_btn:MovieClip;
public function gameover_69(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
this.stop();
}
function frame2(){
this.stop();
}
}
}//package flubber_fla
Section 22
//goingdown_23 (flubber_fla.goingdown_23)
package flubber_fla {
import flash.display.*;
public dynamic class goingdown_23 extends MovieClip {
public function goingdown_23(){
addFrameScript(0, frame1);
}
function frame1(){
this.stop();
}
}
}//package flubber_fla
Section 23
//heightbox_70 (flubber_fla.heightbox_70)
package flubber_fla {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import gameutil.*;
import flash.media.*;
import flash.system.*;
import flash.text.*;
import flash.utils.*;
import flash.net.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class heightbox_70 extends MovieClip {
public var viewscores:MovieClip;
public var htxt:TextField;
public var abot_name:TextField;
public var hshadow:TextField;
public var abot_submit:MovieClip;
public function heightbox_70(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
function frame3(){
viewscores.buttonMode = true;
viewscores.addEventListener(MouseEvent.MOUSE_UP, Game.go2abot_scores);
}
function frame1(){
this.stop();
htxt.mouseEnabled = false;
htxt.mouseWheelEnabled = false;
hshadow.mouseEnabled = false;
hshadow.mouseWheelEnabled = false;
}
function frame2(){
abot_submit.buttonMode = true;
if (Game.playmode == "rise"){
abot_submit.addEventListener(MouseEvent.MOUSE_UP, Game.abot_sendHeight);
} else {
abot_submit.addEventListener(MouseEvent.MOUSE_UP, Game.abot_sendSmashes);
};
if (((!((Shoman.myso.data.myname == null))) && (!((Shoman.myso.data.myname == "enter your name"))))){
abot_name.text = Shoman.myso.data.myname;
};
}
}
}//package flubber_fla
Section 24
//htxt_76 (flubber_fla.htxt_76)
package flubber_fla {
import flash.display.*;
import flash.text.*;
public dynamic class htxt_76 extends MovieClip {
public var height_txt:TextField;
}
}//package flubber_fla
Section 25
//introanimation_96 (flubber_fla.introanimation_96)
package flubber_fla {
import flash.display.*;
public dynamic class introanimation_96 extends MovieClip {
public var ffgComplete:Boolean;
public var bang2:MovieClip;
public var ffg_load_link:MovieClip;
public var bangl:MovieClip;
public var rp:MovieClip;
public var lp:MovieClip;
public var less:MovieClip;
public var us:MovieClip;
public var great:MovieClip;
public function introanimation_96(){
addFrameScript(0, frame1, 176, frame177);
}
function frame177(){
stop();
ffgComplete = true;
}
function frame1(){
ffgComplete = false;
}
}
}//package flubber_fla
Section 26
//MainTimeline (flubber_fla.MainTimeline)
package flubber_fla {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import mochi.*;
import gameutil.*;
import flash.media.*;
import flash.system.*;
import flash.text.*;
import flash.utils.*;
import flash.net.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class MainTimeline extends MovieClip {
public var agintro:MovieClip;
public var rolled:Boolean;
public var loader_logos:MovieClip;
public var speedW;
public var aglink:MovieClip;
public var targW;
public var targH;
public var ffgURL:URLRequest;
public var ts:MovieClip;
public var lp_x;
public var num:int;
public var dh;
public var ffg:MovieClip;
public var dx;
public var looky;
public var myGame;
public var dy;
public var dw:Number;
public var myMochiclip:MovieClip;
public var myloader:MovieClip;
public var isLoaded:Boolean;
public var rp_y;
public var lp_y;
public var finished:Boolean;
public var rot:Number;
public var rp_x;
public var lookx;
public var speedH;
public function MainTimeline(){
addFrameScript(0, frame1, 7, frame8, 14, frame15, 21, frame22, 27, frame28);
}
public function linkup(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://armorgames.com?gamereferral=FlubberRise"), "_blank");
}
public function mochiPLAcomplete():void{
MochiBot.track(this, "80af4660");
this.gotoAndStop("sponsor");
}
public function update(_arg1:Event):void{
dw = (targW - ts.tflub.width);
dh = (targH - ts.tflub.height);
speedW = ((dw * 0.1) + (speedW * 0.9));
speedH = ((dh * 0.2) + (speedH * 0.85));
ts.tflub.height = (ts.tflub.height + speedH);
ts.tflub.width = (ts.tflub.width + speedW);
if (targW > 90){
targW = Math.max((targW * 0.95), 90);
};
if (targW < 90){
targW = Math.min((targW * 1.05), 90);
};
if (targH > 90){
targW = Math.max((targH * 0.95), 90);
};
if (targH < 90){
targW = Math.min((targH * 1.05), 90);
};
if (ts.pmg_btn.hitTestPoint(mouseX, mouseY, false)){
ts.pmg_btn.alpha = 1;
if (!rolled){
SoundMan.bounce1.play(0, 0, SoundMan.sfxtf);
targW = (90 + (Math.random() * 20));
targH = (100 + (Math.random() * 30));
rolled = true;
};
} else {
ts.pmg_btn.alpha = 0.8;
if (rolled){
targW = 90;
targH = 90;
rolled = false;
};
};
if (ts.tflub.face.currentFrame == 1){
dy = (mouseY - 253);
dx = (mouseX - 0x0100);
rot = Math.atan2(dy, dx);
lookx = (lp_x + (Math.cos(rot) * 4));
looky = (lp_y + (Math.sin(rot) * 4));
ts.tflub.face.lpupil.x = (ts.tflub.face.lpupil.x + ((lookx - ts.tflub.face.lpupil.x) * 0.3));
ts.tflub.face.lpupil.y = (ts.tflub.face.lpupil.y + ((looky - ts.tflub.face.lpupil.y) * 0.3));
ts.tflub.face.rpupil.x = (ts.tflub.face.rpupil.x + (((lookx + 26) - ts.tflub.face.rpupil.x) * 0.3));
ts.tflub.face.rpupil.y = (ts.tflub.face.rpupil.y + ((looky - ts.tflub.face.rpupil.y) * 0.3));
};
}
public function lupdate(_arg1:Event):void{
var _local2:Number;
if (!isLoaded){
_local2 = (loaderInfo.bytesLoaded / loaderInfo.bytesTotal);
myloader.l_txt.text = (int((_local2 * 100)) + "%");
myloader.l_bar.width = (_local2 * 186);
if (loaderInfo.bytesLoaded == loaderInfo.bytesTotal){
myloader.visible = false;
myloader.x = -1000;
loader_logos.visible = false;
myloader.x = -1000;
isLoaded = true;
if (Game.mochiok){
MochiBot.track(this, "80af4660");
};
myloader.removeEventListener(Event.ENTER_FRAME, lupdate);
this.gotoAndStop("sponsor");
};
};
}
public function agEF(_arg1:Event):void{
if (agintro.isComplete){
agintro.removeEventListener(Event.ENTER_FRAME, agEF);
agintro.stop();
agintro.visible = false;
aglink.visible = false;
gotoAndStop("funface");
};
}
public function sup(_arg1:MouseEvent):void{
if (_arg1.currentTarget.name == "gd_btn"){
if (finished){
Game.playmode = "fall";
} else {
return;
};
} else {
Game.playmode = "rise";
};
ts.start_btn.removeEventListener(MouseEvent.MOUSE_UP, sup);
ts.start_btn.removeEventListener(MouseEvent.MOUSE_OVER, fover);
ts.start_btn.removeEventListener(MouseEvent.MOUSE_OUT, fout);
ts.tflub.removeEventListener(MouseEvent.MOUSE_OVER, fover);
ts.tflub.removeEventListener(MouseEvent.MOUSE_OUT, fout);
ts.tflub.removeEventListener(MouseEvent.MOUSE_UP, sup);
ts.gd_btn.removeEventListener(MouseEvent.MOUSE_OVER, fover);
ts.gd_btn.removeEventListener(MouseEvent.MOUSE_OUT, fout);
ts.gd_btn.removeEventListener(MouseEvent.MOUSE_UP, sup);
this.removeEventListener(Event.ENTER_FRAME, update);
this.removeChild(ts);
this.gotoAndStop("game");
}
function frame15(){
this.stop();
agintro.stop();
removeChild(agintro);
ffg = new ffgIntro();
ffg.x = 0x0100;
ffg.y = 200;
this.addChild(ffg);
ffgURL = new URLRequest("http://www.funfacegames.com?r=armorg_flubber_intro");
ffg.mouseEnabled = false;
ffg.ffgAnim.mouseEnabled = false;
ffg.ffgAnim.ffg_load_link.buttonMode = true;
if (Game.mochiok){
MochiServices.addLinkEvent("http://x.mochiads.com/link/d3008d38a26b644c", "http://www.funfacegames.com", ffg.ffgAnim.ffg_load_link);
} else {
ffg.ffgAnim.ffg_load_link.addEventListener(MouseEvent.MOUSE_UP, ffg_nav);
};
ffg.addEventListener(Event.ENTER_FRAME, ffgEF);
}
function frame1(){
this.stop();
myGame = new Game(this);
if (Game.mochiok){
myloader.visible = false;
myloader.x = -1000;
loader_logos.visible = false;
myloader.x = -1000;
MochiServices.connect("bb14256f8999cc3d", this, onConnectError);
} else {
myloader.visible = true;
loader_logos.visible = true;
myloader.addEventListener(Event.ENTER_FRAME, lupdate);
};
num = 0;
isLoaded = false;
if (Game.mochiok){
myMochiclip = new MovieClip();
addChild(myMochiclip);
MochiAd.showPreGameAd({clip:myMochiclip, id:"bb14256f8999cc3d", res:"512x600", background:16777161, color:12181835, outline:0xFFFFFF, no_bg:true, ad_finished:mochiPLAcomplete});
};
}
function frame8(){
this.stop();
agintro = new ag_intro_mc();
agintro.mouseChildren = false;
agintro.mouseEnabled = false;
aglink = new ag_intro_link();
aglink.buttonMode = true;
agintro.x = 0x0100;
agintro.y = 300;
aglink.x = 110;
aglink.y = 134;
this.addChild(agintro);
this.addChild(aglink);
aglink.addEventListener(MouseEvent.MOUSE_UP, ag_nav);
agintro.addEventListener(Event.ENTER_FRAME, agEF);
}
public function ag_nav(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://armorgames.com?gamereferral=FlubberRise"), "_blank");
}
public function ffgEF(_arg1:Event):void{
if (ffg.ffgAnim.ffgComplete){
ffg.removeEventListener(Event.ENTER_FRAME, ffgEF);
if (!Game.mochiok){
ffg.ffgAnim.ffg_load_link.removeEventListener(MouseEvent.MOUSE_UP, ffg_nav);
};
gotoAndStop("menu");
};
}
public function ffg_nav(_arg1:MouseEvent):void{
navigateToURL(ffgURL, "_blank");
}
public function fover(_arg1:MouseEvent):void{
if (!finished){
if (_arg1.currentTarget.name == "gd_btn"){
return;
};
if (_arg1.currentTarget.name != "tflub"){
_arg1.currentTarget.alpha = 1;
};
SoundMan.bounce1.play(0, 0, SoundMan.sfxtf);
targW = (90 + (Math.random() * 20));
targH = (100 + (Math.random() * 30));
} else {
if (_arg1.currentTarget.name != "tflub"){
_arg1.currentTarget.alpha = 1;
};
SoundMan.bounce1.play(0, 0, SoundMan.sfxtf);
targW = (90 + (Math.random() * 20));
targH = (100 + (Math.random() * 30));
};
}
function frame22(){
this.stop();
if (this.contains(ffg)){
this.removeChild(ffg);
};
if (!SoundMan.initialized){
SoundMan.init();
SoundMan.startSounds();
};
ts = new titleScreen();
ts.x = 0x0100;
ts.y = 200;
this.addChild(ts);
finished = false;
if (Game.sodat != null){
if (Game.sodat.data.g_c){
finished = true;
ts.gd_btn.alpha = 0.8;
ts.gd_btn.gotoAndStop(2);
} else {
ts.gd_btn.alpha = 0.2;
ts.gd_btn.gotoAndStop(1);
};
};
ts.start_btn.addEventListener(MouseEvent.MOUSE_UP, sup);
ts.start_btn.addEventListener(MouseEvent.MOUSE_OVER, fover);
ts.start_btn.addEventListener(MouseEvent.MOUSE_OUT, fout);
ts.tflub.addEventListener(MouseEvent.MOUSE_OVER, fover);
ts.tflub.addEventListener(MouseEvent.MOUSE_OUT, fout);
ts.tflub.addEventListener(MouseEvent.MOUSE_UP, sup);
ts.pmg_btn.addEventListener(MouseEvent.MOUSE_UP, linkup);
ts.gd_btn.addEventListener(MouseEvent.MOUSE_OVER, fover);
ts.gd_btn.addEventListener(MouseEvent.MOUSE_OUT, fout);
ts.gd_btn.addEventListener(MouseEvent.MOUSE_UP, sup);
ts.gd_btn.buttonMode = true;
ts.tflub.buttonMode = true;
ts.pmg_btn.buttonMode = true;
ts.start_btn.buttonMode = true;
ts.tflub.face.shock.visible = false;
lp_x = ts.tflub.face.lpupil.x;
lp_y = ts.tflub.face.lpupil.y;
rp_x = ts.tflub.face.rpupil.x;
rp_y = ts.tflub.face.rpupil.y;
this.addEventListener(Event.ENTER_FRAME, update);
dw = 0;
dh = 0;
targW = 90;
targH = 90;
speedW = 0;
speedH = 0;
rolled = false;
}
public function onConnectError(){
}
function frame28(){
this.stop();
Game.startGame();
}
public function fout(_arg1:MouseEvent):void{
if (!finished){
if (_arg1.currentTarget.name == "gd_btn"){
return;
};
if (_arg1.currentTarget.name != "tflub"){
_arg1.currentTarget.alpha = 0.8;
};
targW = 90;
targH = 90;
} else {
if (_arg1.currentTarget.name != "tflub"){
_arg1.currentTarget.alpha = 0.8;
};
targW = 90;
targH = 90;
};
}
}
}//package flubber_fla
Section 27
//musicMute_79 (flubber_fla.musicMute_79)
package flubber_fla {
import flash.display.*;
public dynamic class musicMute_79 extends MovieClip {
public function musicMute_79(){
addFrameScript(0, frame1);
}
function frame1(){
this.stop();
}
}
}//package flubber_fla
Section 28
//mutebtn_78 (flubber_fla.mutebtn_78)
package flubber_fla {
import flash.display.*;
public dynamic class mutebtn_78 extends MovieClip {
public function mutebtn_78(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package flubber_fla
Section 29
//myloader_2 (flubber_fla.myloader_2)
package flubber_fla {
import flash.display.*;
import flash.text.*;
public dynamic class myloader_2 extends MovieClip {
public var l_txt:TextField;
public var l_bar:MovieClip;
}
}//package flubber_fla
Section 30
//paddle_50 (flubber_fla.paddle_50)
package flubber_fla {
import flash.display.*;
public dynamic class paddle_50 extends MovieClip {
public function paddle_50(){
addFrameScript(0, frame1);
}
function frame1(){
this.stop();
}
}
}//package flubber_fla
Section 31
//shadow_110 (flubber_fla.shadow_110)
package flubber_fla {
import flash.display.*;
public dynamic class shadow_110 extends MovieClip {
public var bang2:MovieClip;
public var bangl:MovieClip;
public var rp:MovieClip;
public var lp:MovieClip;
public var less:MovieClip;
public var us:MovieClip;
public var great:MovieClip;
}
}//package flubber_fla
Section 32
//titleFlub_13 (flubber_fla.titleFlub_13)
package flubber_fla {
import flash.display.*;
public dynamic class titleFlub_13 extends MovieClip {
public var face:Ball;
}
}//package flubber_fla
Section 33
//Particle (fx.Particle)
package fx {
import flash.display.*;
import flash.geom.*;
import gameutil.*;
public class Particle extends Sprite {
public var xs:Number;// = 0
public var pdata:Object;
private var cto:ColorTransform;
public var ys;// = 0
private var ao:Object;
private var tclock:Number;// = 0
public var mypos:Point;
private var sc:Number;// = 0
public var sp:Sprite;
public var alerp:Lerp;
public var removed:Boolean;// = false
private var gstr:Number;// = 1
public var ylerp;
public var ct:ColorTransform;
public var mycontainer:Sprite;
private var tp:Point;
private var freq;// = 0
public var gstate:String;// = "waiting"
private var td;
public var myindex:int;
private var p:Particle;
private var tdelay;// = 1
public var poslerp:Boolean;// = false
private var amp;// = 0
public var oh;
public var ow:int;
public var xlerp;
public var wave:Number;// = 0
public static var pnum:int = 0;
public static var maxp = 128;
public static var plist:Array = [];
public function Particle(_arg1:Object, _arg2:Sprite){
poslerp = false;
xs = 0;
ys = 0;
gstate = "waiting";
removed = false;
gstr = 1;
wave = 0;
sc = 0;
freq = 0;
amp = 0;
tclock = 0;
tdelay = 1;
super();
pdata = _arg1;
mycontainer = _arg2;
mypos = new Point(0, 0);
createsprite(pdata.itype, _arg2);
sp.mouseEnabled = false;
sp.mouseChildren = false;
reset(pdata, mycontainer);
plist.push(this);
}
private function dowave():void{
sc = (sc + freq);
wave = Math.sin(sc);
}
private function dopos():void{
if ((((pdata.motype == "grav")) || ((pdata.motype == "rgrav")))){
sp.x = (sp.x + (xs * Tick.ftime));
sp.y = (sp.y + (ys * Tick.ftime));
if (gstr != 1){
ys = (ys + (10 * gstr));
} else {
ys = (ys + 10);
};
};
if (pdata.motype == "rgrav"){
sp.rotation = (sp.rotation + ((xs * 2) * Tick.ftime));
};
if (pdata.motype == "wave"){
dowave();
sp.x = (sp.x + ((xs * Tick.ftime) + wave));
sp.y = (sp.y + ((ys * Tick.ftime) + wave));
} else {
if (pdata.motype == "stretch"){
stretchAndMove();
} else {
if ((((pdata.motype == "rdir")) || ((pdata.motype == "expand")))){
sp.x = (sp.x + (xs * Tick.ftime));
sp.y = (sp.y + (ys * Tick.ftime));
};
};
};
if (poslerp){
mypos.x = xlerp.cval;
mypos.y = ylerp.cval;
sp.x = (mypos.x + wave);
sp.y = (mypos.y + wave);
if (xlerp.finished){
if (pdata.loop){
reset(pdata, mycontainer);
} else {
kill();
};
};
};
if (pdata.scmode){
sp.width = (sp.width * 0.98);
sp.height = (sp.height * 0.98);
};
}
private function initvars():void{
if (alerp != null){
alerp.killlerp();
};
if (xlerp != null){
xlerp.killlerp();
};
if (ylerp != null){
ylerp.killlerp();
};
if (pdata.alerp != null){
alerp = new Lerp(pdata.alerp);
};
if (pdata.xlerp != null){
poslerp = true;
xlerp = new Lerp(pdata.xlerp);
ylerp = new Lerp(pdata.ylerp);
} else {
poslerp = false;
};
if (pdata.motype == "wave"){
freq = ((Math.random() * 0.05) + 0.05);
amp = (0.5 + (Math.random() * 3));
};
if (pdata.motype == "grav"){
freq = ((Math.random() * 0.05) + 0.05);
amp = (0.5 + (Math.random() * 3));
};
}
private function lerpalpha():void{
if (alerp != null){
sp.alpha = alerp.cval;
if (((alerp.finished) && (!(removed)))){
if (pdata.loop){
reset(pdata, mycontainer);
} else {
kill();
};
};
};
}
public function kill():void{
if (mycontainer.contains(sp)){
mycontainer.removeChild(sp);
};
removed = true;
gstate = "dead";
}
private function stretchAndMove():void{
sp.rotation = 0;
sp.width = ((Math.abs(pdata.xs) + Math.abs(pdata.ys)) * 2);
sp.rotation = pdata.rot;
sp.x = (sp.x + pdata.xs);
sp.y = (sp.y + pdata.ys);
pdata.xs = (pdata.xs * 0.95);
pdata.ys = (pdata.ys * 0.95);
}
private function createtrail():void{
ao = {delay:0, times:[0, 1], values:[1, 0], lifetime:10, interval:33, loop:false};
cto = sp.transform.colorTransform;
td = {loc:new Point(sp.x, sp.y), trails:false, startw:sp.width, starth:sp.height, scmode:pdata.scmode, itype:pdata.itype, bm:pdata.bm, colormode:"fixed", scol:cto, ecol:cto, alerp:ao, xlerp:null, ylerp:null, loop:false, motype:"fixed", resettype:"none"};
Particle.getP(td, mycontainer);
}
public function reset(_arg1:Object, _arg2):void{
var _local3:Point;
if (gstate == "dead"){
createsprite(_arg1.itype, _arg2);
mycontainer = _arg2;
} else {
if (pdata.itype != _arg1.itype){
mycontainer.removeChild(sp);
createsprite(_arg1.itype, _arg2);
mycontainer = _arg2;
} else {
if (mycontainer != _arg2){
mycontainer.removeChild(sp);
createsprite(_arg1.itype, _arg2);
mycontainer = _arg2;
};
};
};
pdata = _arg1;
sp.blendMode = pdata.bm;
initvars();
if (pdata.colormode == "random"){
ct = sp.transform.colorTransform;
ct.redMultiplier = Math.random();
ct.blueMultiplier = Math.random();
ct.greenMultiplier = Math.random();
sp.transform.colorTransform = ct;
} else {
if (pdata.scol != 0){
sp.transform.colorTransform = pdata.scol;
};
};
if (pdata.resettype == "random"){
tp = Helper.getRandomDir(((Math.random() * 100) + 100));
xlerp.kfobj.values[0] = (xlerp.kfobj.values[1] + tp.x);
ylerp.kfobj.values[0] = (xlerp.kfobj.values[1] + tp.y);
};
sp.x = pdata.loc.x;
sp.y = pdata.loc.y;
sp.alpha = 1;
sp.width = ow;
sp.height = oh;
if (pdata.startw){
sp.width = pdata.startw;
sp.height = pdata.starth;
};
if (pdata.gstr != null){
gstr = pdata.gstr;
} else {
gstr = 1;
};
if (alerp != null){
alerp.resetlerp();
};
if (xlerp != null){
xlerp.resetlerp();
};
if (ylerp != null){
ylerp.resetlerp();
};
if (pdata.speed != null){
xs = pdata.speed.x;
ys = pdata.speed.y;
};
if (pdata.motype == "rdir"){
_local3 = Helper.getRandomDir(((Math.random() * 100) + 30));
xs = _local3.x;
ys = _local3.y;
};
gstate = "normal";
removed = false;
}
private function createsprite(_arg1:String, _arg2:Sprite):void{
switch (_arg1){
case "goo":
sp = new goo();
break;
case "fuzz":
sp = new fuzz();
break;
case "bigfuzz":
sp = new bigfuzz();
break;
case "heat":
sp = new heat();
break;
case "bpiece":
sp = new bpiece();
break;
case "leaf":
sp = new leaf();
break;
case "Star":
sp = new Star();
break;
case "spark":
sp = new spark();
break;
case "bfrag1":
sp = new bfrag1();
break;
case "bfrag2":
sp = new bfrag2();
break;
case "bfrag3":
sp = new bfrag3();
break;
};
ow = sp.width;
oh = sp.height;
sp.blendMode = pdata.bm;
sp.x = pdata.loc.x;
sp.y = pdata.loc.y;
sp.alpha = 1;
_arg2.addChild(sp);
}
private function update():void{
switch (gstate){
case "normal":
dopos();
lerpalpha();
if (pdata.trails){
tclock++;
if (tclock > tdelay){
createtrail();
tclock = 0;
};
};
break;
case "waiting":
break;
};
}
public static function killAll():void{
var _local1:Particle;
for each (_local1 in plist) {
if (_local1.sp.parent != null){
_local1.gstate = "dead";
_local1.sp.parent.removeChild(_local1.sp);
};
};
plist = [];
pnum = 0;
}
public static function getP(_arg1:Object, _arg2:Sprite):void{
if (pnum < maxp){
if (plist[pnum] != null){
plist[pnum].reset(_arg1, _arg2);
} else {
new Particle(_arg1, _arg2);
};
} else {
pnum = 0;
plist[pnum].reset(_arg1, _arg2);
};
pnum++;
}
public static function updateAll():void{
var _local1:Particle;
for each (_local1 in plist) {
if (!_local1.removed){
_local1.update();
};
};
}
}
}//package fx
Section 34
//Shockring (fx.Shockring)
package fx {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import gameutil.*;
import flash.utils.*;
public class Shockring extends Sprite {
private var rtimer:Timer;
private var fadespeed:int;// = 1
private var sp:Sprite;
public var alerp:Lerp;
private var cm:Number;// = 0.4
private var ct:ColorTransform;
public var mycontainer:Sprite;
private var mw;
public var sclerp:Lerp;
public var motype:String;
public function Shockring(_arg1, _arg2, _arg3:Sprite, _arg4:int=-1, _arg5:String="norm", _arg6:String="norm"){
var _local7:Object;
var _local8:*;
fadespeed = 1;
cm = 0.4;
super();
mycontainer = _arg3;
motype = _arg6;
createsprite(_arg5);
sp.x = _arg1;
sp.y = _arg2;
if (motype == "slowscale"){
mw = (sp.width * 2);
sp.width = (sp.width * 0.5);
sp.height = (sp.height * 0.5);
_local7 = {delay:0, times:[0, 0.15, 1], values:[0, 0.8, 0], lifetime:10, interval:33, loop:false};
_local8 = {delay:0, times:[0, 1], values:[sp.width, mw], lifetime:10, interval:33, loop:false};
} else {
sp.width = 0;
sp.height = 0;
_local7 = {delay:0, times:[0, 0.15, 1], values:[0, 0.8, -0.1], lifetime:16, interval:33, loop:false};
_local8 = {delay:0, times:[0, 0.15, 1], values:[0, 120, 0x0100], lifetime:16, interval:33, loop:false};
};
ct = new ColorTransform();
setColor(_arg4);
sp.blendMode = "add";
alerp = new Lerp(_local7);
sclerp = new Lerp(_local8);
rtimer = new Timer(33, 0);
rtimer.addEventListener(TimerEvent.TIMER, update);
rtimer.start();
mycontainer.addChild(sp);
}
private function setColor(_arg1:int):void{
switch (_arg1){
case -1:
return;
case 0:
ct.redMultiplier = cm;
ct.blueMultiplier = cm;
ct.greenMultiplier = cm;
ct.redOffset = 70;
ct.greenOffset = 70;
ct.blueOffset = 230;
break;
case 1:
ct.redMultiplier = cm;
ct.blueMultiplier = cm;
ct.greenMultiplier = cm;
ct.redOffset = 70;
ct.greenOffset = 230;
ct.blueOffset = 70;
break;
case 2:
ct.redMultiplier = cm;
ct.blueMultiplier = cm;
ct.greenMultiplier = cm;
ct.redOffset = 210;
ct.greenOffset = 140;
ct.blueOffset = 40;
break;
case 3:
ct.redMultiplier = cm;
ct.blueMultiplier = cm;
ct.greenMultiplier = cm;
ct.redOffset = 230;
ct.greenOffset = 70;
ct.blueOffset = 70;
break;
};
sp.transform.colorTransform = ct;
}
private function kill():void{
mycontainer.removeChild(sp);
rtimer.stop();
rtimer.removeEventListener(TimerEvent.TIMER, update);
}
private function createsprite(_arg1:String):void{
switch (_arg1){
case "goo":
sp = new goo();
break;
case "fuzz":
sp = new fuzz();
break;
case "heat":
sp = new heat();
break;
case "bpiece":
sp = new bpiece();
break;
case "norm":
sp = new sring();
break;
case "bigpow":
sp = new bigpow();
break;
};
}
private function update(_arg1:TimerEvent):void{
if (!sclerp.finished){
sp.width = sclerp.getvalue();
sp.height = sp.width;
sp.alpha = alerp.getvalue();
} else {
kill();
};
}
}
}//package fx
Section 35
//Helper (gameutil.Helper)
package gameutil {
import flash.geom.*;
public class Helper {
public static var a:Number;
public static var c:Number;
private static var cm:Number = 0.4;
private static var plist:Array = [];
public static var b:Number;
private static var pnt:Point;
public static var thresh:Number = 0.2;
private function hextoargb(_arg1:Number):Object{
var _local2:*;
_local2 = {};
_local2.alpha = ((_arg1 >> 24) & 0xFF);
_local2.red = ((_arg1 >> 16) & 0xFF);
_local2.green = ((_arg1 >> 8) & 0xFF);
_local2.blue = (_arg1 & 0xFF);
return (_local2);
}
private function argbtohex(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):int{
return (((((_arg1 << 24) | (_arg2 << 16)) | (_arg3 << 8)) | _arg4));
}
public static function getSpecificDir(_arg1:Number, _arg2:Number):Array{
plist = [0, 0];
c = (_arg1 * 0.0175);
plist[0] = (Math.cos(c) * _arg2);
plist[1] = (Math.sin(c) * _arg2);
return (plist);
}
public static function getColorT(_arg1:int):ColorTransform{
var _local2:ColorTransform;
_local2 = new ColorTransform();
switch (_arg1){
case -1:
return (null);
case 0:
_local2.redMultiplier = cm;
_local2.blueMultiplier = cm;
_local2.greenMultiplier = cm;
_local2.redOffset = 70;
_local2.greenOffset = 70;
_local2.blueOffset = 230;
break;
case 1:
_local2.redMultiplier = cm;
_local2.blueMultiplier = cm;
_local2.greenMultiplier = cm;
_local2.redOffset = 70;
_local2.greenOffset = 230;
_local2.blueOffset = 70;
break;
case 2:
_local2.redMultiplier = cm;
_local2.blueMultiplier = cm;
_local2.greenMultiplier = cm;
_local2.redOffset = 210;
_local2.greenOffset = 140;
_local2.blueOffset = 40;
break;
case 3:
_local2.redMultiplier = cm;
_local2.blueMultiplier = cm;
_local2.greenMultiplier = cm;
_local2.redOffset = 230;
_local2.greenOffset = 70;
_local2.blueOffset = 70;
break;
};
return (_local2);
}
public static function inertiaSingle(_arg1:Number, _arg2:Number, _arg3):Number{
return ((_arg1 - (_arg2 * _arg3)));
}
public static function getHyp(_arg1:Point, _arg2:Point):Number{
var _local3:Point;
_local3 = _arg1.subtract(_arg2);
return (Math.sqrt(((_local3.x * _local3.x) + (_local3.y * _local3.y))));
}
public static function pointAt(_arg1:Point, _arg2:Point, _arg3:Boolean):Number{
var _local4:Point;
var _local5:Number;
_local4 = _arg1.subtract(_arg2);
_local5 = Math.atan2(_local4.y, _local4.x);
if (!_arg3){
return ((_local5 * 57.295779));
};
return (_local5);
}
public static function cosInterp(_arg1:Point, _arg2:Point, _arg3:Number):Point{
var _local4:Number;
var _local5:*;
var _local6:*;
_local4 = (1 - (Math.cos((_arg3 * Math.PI)) * 0.5));
_local5 = new Point((_arg1.x * (1 - _local4)), (_arg1.y * (1 - _local4)));
_local6 = new Point((_arg2.x * _local4), (_arg2.y * _local4));
return (_local5.add(_local6));
}
public static function linearInterp(_arg1:Point, _arg2:Point, _arg3:Number):Point{
pnt = _arg2.subtract(_arg1);
return (_arg1.add(new Point((_arg3 * pnt.x), (_arg3 * pnt.y))));
}
public static function inertiaPos(_arg1:Point, _arg2:Point, _arg3:Number):Point{
var _local4:Point;
_local4 = _arg1.subtract(_arg2);
_arg1.subtract(_arg2).x = (_local4.x * _arg3);
_local4.y = (_local4.y * _arg3);
return (_local4);
}
public static function getRandomDir(_arg1:Number):Point{
pnt = new Point(0, 0);
c = ((Math.random() * 360) * 0.0175);
pnt.x = (Math.cos(c) * _arg1);
pnt.y = (Math.sin(c) * _arg1);
return (pnt);
}
public static function fastsqr(_arg1:Number):Number{
b = (_arg1 * 0.25);
do {
c = (_arg1 / b);
b = ((b + c) * 0.5);
a = (b - c);
if (a < 0){
a = -(a);
};
} while (a > thresh);
return (b);
}
}
}//package gameutil
Section 36
//Lerp (gameutil.Lerp)
package gameutil {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Lerp extends Sprite {
private var floattime:Number;// = 0
private var targtime:Number;// = 0
public var debug:Boolean;// = false
public var dead:Boolean;// = false
private var dtimer:Number;// = 0
private var subkeytime:Number;// = 0
public var gstate:String;// = "paused"
private var targval:Number;// = 0
public var finished:Boolean;// = false
private var startval:Number;// = 0
public var cevt:MyEvents;
public var ctime:Number;// = 0
private var smooth:Boolean;// = false
private var ktimer:Timer;
public var kfobj:Object;
public var predelay:int;// = 0
private var keynum:int;// = 0
private var subduration:Number;// = 0
public var cval:Number;// = 0
private var subrange:Number;// = 0
public function Lerp(_arg1:Object){
gstate = "paused";
dtimer = 0;
predelay = 0;
keynum = 0;
cval = 0;
targval = 0;
startval = 0;
ctime = 0;
targtime = 0;
finished = false;
subkeytime = 0;
subduration = 0;
subrange = 0;
smooth = false;
dead = false;
debug = false;
floattime = 0;
super();
kfobj = _arg1;
predelay = kfobj.delay;
ktimer = new Timer(kfobj.interval, 0);
ktimer.addEventListener(TimerEvent.TIMER, update);
cevt = new MyEvents();
resetlerp();
}
public function getvalue():Number{
return (cval);
}
public function dumpvars(){
}
public function pauseMe():void{
if (ktimer != null){
ktimer.stop();
};
}
public function setTime(_arg1:Number):void{
var _local2:int;
ctime = _arg1;
floattime = (ctime / kfobj.lifetime);
_local2 = Math.floor((floattime * (kfobj.times.length - 1)));
keynum = _local2;
targtime = kfobj.times[(keynum + 1)];
targval = kfobj.values[(keynum + 1)];
startval = kfobj.values[keynum];
subrange = (targval - startval);
subduration = ((targtime - kfobj.times[keynum]) * kfobj.lifetime);
subkeytime = ((targtime * kfobj.lifetime) - ctime);
cval = (startval + (subrange * (subkeytime / subduration)));
}
public function resetlerp():void{
cval = kfobj.values[0];
targval = kfobj.values[1];
targtime = kfobj.times[1];
startval = kfobj.values[0];
ctime = 0;
keynum = 0;
dtimer = 0;
subduration = ((kfobj.times[1] - kfobj.times[0]) * kfobj.lifetime);
floattime = 0;
subkeytime = 0;
subrange = (targval - startval);
finished = false;
gstate = "paused";
if (kfobj.delay != 0){
};
if (ktimer != null){
ktimer.reset();
};
if (ktimer != null){
ktimer.start();
};
}
public function update(_arg1:TimerEvent=null):void{
var _local2:Number;
var _local3:Number;
switch (gstate){
case "paused":
dtimer++;
if (dtimer >= predelay){
gstate = "running";
dtimer = 0;
cevt.triggerMe(MyEvents.READY);
};
break;
case "running":
if (!finished){
ctime = Math.min((ctime + 1), kfobj.lifetime);
subkeytime = Math.min((subkeytime + 1), subduration);
floattime = (ctime / kfobj.lifetime);
if (ctime == kfobj.lifetime){
if (kfobj.loop){
ktimer.stop();
finished = true;
return;
};
killlerp();
return;
};
if (floattime >= targtime){
if (keynum < (kfobj.times.length - 2)){
keynum++;
targtime = kfobj.times[(keynum + 1)];
targval = kfobj.values[(keynum + 1)];
startval = kfobj.values[keynum];
subrange = (targval - startval);
subduration = ((targtime - kfobj.times[keynum]) * kfobj.lifetime);
subkeytime = 0;
};
};
if (!smooth){
cval = (startval + (subrange * (subkeytime / subduration)));
} else {
_local2 = (subkeytime / subduration);
_local3 = ((1 - Math.cos((_local2 * Math.PI))) * 0.5);
cval = ((startval * (1 - _local3)) + (targval * _local3));
};
};
break;
};
if (debug){
dumpvars();
};
}
public function killlerp():void{
if (!dead){
dead = true;
ktimer.stop();
ktimer.removeEventListener(TimerEvent.TIMER, update);
ktimer = null;
finished = true;
};
}
public function unPause():void{
if (ktimer != null){
ktimer.start();
};
}
}
}//package gameutil
Section 37
//Shoman (gameutil.Shoman)
package gameutil {
import flash.net.*;
public class Shoman {
public static var mydata:Object;
public static var myso:SharedObject;
public static var mlist:Array = [];
public static function writeSO(_arg1:String, _arg2:Boolean=true):void{
var _local3:Object;
switch (_arg1){
case "game_complete":
myso.data.g_c = _arg2;
break;
case "default":
break;
};
_local3 = myso.flush();
}
public static function init():void{
}
public static function loadSO():Object{
myso = SharedObject.getLocal("flubber_rise");
if (myso.size == 0){
myso.data.g_c = false;
myso.data.myname = "";
};
return (myso);
}
public static function writeName(_arg1:String):void{
var _local2:Object;
myso.data.myname = _arg1;
_local2 = myso.flush();
}
}
}//package gameutil
Section 38
//SoundMan (gameutil.SoundMan)
package gameutil {
import flash.events.*;
import flash.display.*;
import flash.media.*;
import flash.utils.*;
public class SoundMan extends Sprite {
public static var wind;
public static var springy:Sound;
public static var sfxmuted:Boolean = false;
public static var btick:int = 0;
public static var b1:Sound;
public static var b2;
public static var b3;
public static var gravzone;
private static var clock:Number = 0;
public static var musicfade:Boolean = false;
public static var music:Sound;
public static var sfxvol:Number = 0;
public static var sfire:Sound;
public static var wtf:SoundTransform;
public static var brush:Sound;
public static var pops;
public static var heatchan:SoundChannel;
public static var oldMusicMax:Number = 0.25;
public static var hitspike:Sound;
public static var sfxchan:SoundChannel;
public static var windchan:SoundChannel;
public static var musicmuted = false;
public static var heatfade:Boolean = false;
public static var tickTog:Boolean = true;
public static var measurecount:int = 0;
public static var fill:Sound;
public static var musicvol:Number = 0;
public static var maxsfxvol:Number = 0.5;
public static var mtf:SoundTransform;
public static var shock:Sound;
public static var boost:Sound;
public static var boom1:Sound;
public static var bounce1:Sound;
public static var bpop:Sound;
public static var stimer:Timer;
public static var landslide;
public static var sfxtf:SoundTransform;
public static var bsmash;
public static var musicstarted:Boolean = false;
public static var bpmTimer:Timer;
public static var lightning:Sound;
public static var windvol:Number = 0.05;
public static var dmcatch;
public static var getflooby;
public static var initialized:Boolean = false;
public static var barcount:int = 0;
public static var fireloop:Sound;
public static var heatvol:Number = 0;
public static var htf:SoundTransform;
public static var loopcount:int = 0;
public static var ballooncatch:Sound;
public static var bcount:int = 0;
public static var maxmusicvol:Number = 0.25;
public static var musicchan:SoundChannel;
public static var maxheatvol:Number = 1;
public static function adjustmusicvol(_arg1:Number):void{
maxmusicvol = Math.max(Math.min((maxmusicvol + _arg1), 1), 0);
oldMusicMax = maxmusicvol;
musicvol = maxmusicvol;
mtf = musicchan.soundTransform;
mtf.volume = musicvol;
musicchan.soundTransform = mtf;
}
public static function init():void{
sfxchan = new SoundChannel();
sfxtf = sfxchan.soundTransform;
sfxtf.volume = 0.5;
musicchan = new SoundChannel();
mtf = musicchan.soundTransform;
mtf.volume = 0;
music = new arpegi_arms();
heatchan = new SoundChannel();
htf = heatchan.soundTransform;
htf.volume = 0;
windchan = new SoundChannel();
wtf = musicchan.soundTransform;
wtf.volume = 0;
bounce1 = new bounce();
boom1 = new bigboom();
springy = new spring();
fill = new fillup();
hitspike = new stab();
ballooncatch = new balloon_ride();
bpop = new pop();
boost = new boostsnd();
lightning = new lightningsnd();
shock = new shocksnd();
brush = new leaves();
sfire = new swoopfire();
fireloop = new flameloop();
b1 = new bump1();
b2 = new bump2();
b3 = new bump3();
landslide = new landfall();
gravzone = new gravThresh();
dmcatch = new darkmattercatch();
wind = new finalwind();
bsmash = new blockSmash();
getflooby = new floobyCatch();
pops = new popsnd();
stimer = new Timer(132, 0);
stimer.addEventListener(TimerEvent.TIMER, update);
stimer.start();
initialized = true;
}
public static function resetBPM(_arg1:TimerEvent){
bpmTimer.reset();
}
public static function startSounds():void{
musicchan = music.play(0, 9999, mtf);
musicfade = true;
windchan = wind.play(0, 9999, wtf);
}
public static function adjustsfxvol(_arg1:Number):void{
maxsfxvol = Math.max(Math.min((maxsfxvol + _arg1), 1), 0);
sfxtf.volume = maxsfxvol;
}
public static function muteMusic(_arg1:MouseEvent=null):void{
if (musicmuted){
musicmuted = false;
mtf = musicchan.soundTransform;
mtf.volume = 0.3;
musicchan.soundTransform = mtf;
Game.hud.musicMute.gotoAndStop(1);
} else {
musicmuted = true;
mtf = musicchan.soundTransform;
mtf.volume = 0;
musicchan.soundTransform = mtf;
Game.hud.musicMute.gotoAndStop(2);
};
}
public static function muteSfx(_arg1:MouseEvent=null):void{
if (sfxmuted){
sfxmuted = false;
Game.hud.mute_btn.gotoAndStop(1);
sfxtf = sfxchan.soundTransform;
sfxtf.volume = 0.5;
sfxchan.soundTransform = sfxtf;
} else {
sfxmuted = true;
Game.hud.mute_btn.gotoAndStop(2);
sfxtf = sfxchan.soundTransform;
sfxtf.volume = 0;
sfxchan.soundTransform = sfxtf;
htf = heatchan.soundTransform;
htf.volume = 0;
heatchan.soundTransform = htf;
windvol = 0;
wtf = windchan.soundTransform;
wtf.volume = 0;
windchan.soundTransform = wtf;
};
}
public static function beat(_arg1:TimerEvent):void{
if (tickTog){
Game.timeline.targW = 80;
Game.timeline.targH = 90;
} else {
Game.timeline.targW = 90;
Game.timeline.targH = 80;
};
tickTog = !(tickTog);
}
public static function newMusicMax(_arg1:String):void{
if (_arg1 == "quiet"){
if (maxmusicvol > 0.1){
oldMusicMax = maxmusicvol;
maxmusicvol = 0.1;
musicfade = true;
};
} else {
if (maxmusicvol < oldMusicMax){
maxmusicvol = oldMusicMax;
musicfade = true;
};
};
}
private static function update(_arg1:TimerEvent):void{
var _local2:Number;
if (!musicmuted){
if (musicfade){
if (musicvol < maxmusicvol){
musicvol = Math.min((musicvol + 0.01), maxmusicvol);
} else {
musicvol = Math.max((musicvol - 0.01), maxmusicvol);
};
if (musicvol == maxmusicvol){
musicfade = false;
};
};
if (musicvol != maxmusicvol){
mtf = musicchan.soundTransform;
mtf.volume = musicvol;
musicchan.soundTransform = mtf;
};
};
if (!sfxmuted){
if (heatfade){
if (heatvol < 1){
heatvol = Math.min((heatvol + 0.03), 0.6);
htf = heatchan.soundTransform;
htf.volume = heatvol;
heatchan.soundTransform = htf;
};
} else {
if (heatvol > 0){
heatvol = Math.max((heatvol - 0.1), 0);
htf = heatchan.soundTransform;
htf.volume = heatvol;
heatchan.soundTransform = htf;
} else {
heatchan.stop();
};
};
if (wtf.volume != windvol){
wtf = windchan.soundTransform;
_local2 = ((windvol - wtf.volume) * 0.1);
wtf.volume = (wtf.volume + _local2);
windchan.soundTransform = wtf;
};
};
}
public static function crossfade(_arg1:String):void{
}
public static function destroy():void{
}
}
}//package gameutil
Section 39
//Tick (gameutil.Tick)
package gameutil {
import flash.utils.*;
public class Tick {
public static var ftime:Number = 0;
private static var oldtime:int = 0;
public static var fps:uint = 0;
public static var secs = getTimer();
public static var fps_txt:int = 0;
public static function getFtime():void{
ftime = Math.min(((getTimer() - oldtime) / 1000), 0.1);
fps++;
if ((getTimer() - secs) > 1000){
secs = getTimer();
fps_txt = fps;
fps = 0;
};
oldtime = getTimer();
}
}
}//package gameutil
Section 40
//MochiScores (mochi.MochiScores)
package mochi {
import flash.display.*;
import flash.text.*;
public class MochiScores {
private static var boardID:String;
public static var onErrorHandler:Object;
public static var onCloseHandler:Object;
public static function showLeaderboard(_arg1:Object=null):void{
var options = _arg1;
if (options != null){
if (options.clip != null){
if ((options.clip is Sprite)){
MochiServices.setContainer(options.clip);
};
delete options.clip;
} else {
MochiServices.setContainer();
};
MochiServices.stayOnTop();
if (options.name != null){
if ((options.name is TextField)){
if (options.name.text.length > 0){
options.name = options.name.text;
};
};
};
if (options.score != null){
if ((options.score is TextField)){
if (options.score.text.length > 0){
options.score = options.score.text;
};
};
};
if (options.onDisplay != null){
options.onDisplay();
} else {
if (MochiServices.clip != null){
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
//unresolved jump
};
};
};
} else {
options = {};
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
//unresolved jump
};
};
if (options.onClose != null){
onCloseHandler = options.onClose;
} else {
onCloseHandler = function ():void{
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.play();
//unresolved jump
};
};
};
if (options.onError != null){
onErrorHandler = options.onError;
} else {
onErrorHandler = null;
};
if (options.boardID == null){
if (MochiScores.boardID != null){
options.boardID = MochiScores.boardID;
};
};
MochiServices.send("scores_showLeaderboard", {options:options}, null, onClose);
}
public static function closeLeaderboard():void{
MochiServices.send("scores_closeLeaderboard");
}
public static function getPlayerInfo(_arg1:Object, _arg2:Object=null):void{
MochiServices.send("scores_getPlayerInfo", null, _arg1, _arg2);
}
public static function requestList(_arg1:Object, _arg2:Object=null):void{
MochiServices.send("scores_requestList", null, _arg1, _arg2);
}
public static function scoresArrayToObjects(_arg1:Object):Object{
var _local2:Object;
var _local3:Number;
var _local4:Number;
var _local5:Object;
var _local6:Object;
var _local7:String;
var _local8:String;
_local2 = {};
for (_local7 in _arg1) {
if (typeof(_arg1[_local7]) == "object"){
if (((!((_arg1[_local7].cols == null))) && (!((_arg1[_local7].rows == null))))){
_local2[_local7] = [];
_local5 = _arg1[_local7];
_local4 = 0;
while (_local4 < _local5.rows.length) {
_local6 = {};
_local3 = 0;
while (_local3 < _local5.cols.length) {
_local6[_local5.cols[_local3]] = _local5.rows[_local4][_local3];
_local3++;
};
_local2[_local7].push(_local6);
_local4++;
};
} else {
_local2[_local7] = {};
for (_local8 in _arg1[_local7]) {
_local2[_local7][_local8] = _arg1[_local7][_local8];
};
};
} else {
_local2[_local7] = _arg1[_local7];
};
};
return (_local2);
}
public static function submit(_arg1:Number, _arg2:String, _arg3:Object=null, _arg4:Object=null):void{
MochiServices.send("scores_submit", {score:_arg1, name:_arg2}, _arg3, _arg4);
}
public static function onClose(_arg1:Object=null):void{
if (_arg1 != null){
if (_arg1.error != null){
if (_arg1.error == true){
if (onErrorHandler != null){
if (_arg1.errorCode == null){
_arg1.errorCode = "IOError";
};
onErrorHandler(_arg1.errorCode);
MochiServices.doClose();
return;
};
};
};
};
onCloseHandler();
MochiServices.doClose();
}
public static function setBoardID(_arg1:String):void{
MochiScores.boardID = _arg1;
MochiServices.send("scores_setBoardID", {boardID:_arg1});
}
}
}//package mochi
Section 41
//MochiServices (mochi.MochiServices)
package mochi {
import flash.events.*;
import flash.display.*;
import flash.system.*;
import flash.utils.*;
import flash.net.*;
public class MochiServices {
private static var _container:Object;
private static var _connected:Boolean = false;
private static var _swfVersion:String;
private static var _sendChannel:LocalConnection;
private static var _rcvChannelName:String;
private static var _gatewayURL:String = "http://www.mochiads.com/static/lib/services/services.swf";
private static var _clip:MovieClip;
private static var _loader:Loader;
private static var _id:String;
private static var _listenChannel:LocalConnection;
private static var _timer:Timer;
private static var _sendChannelName:String;
private static var _startTime:Number;
private static var _connecting:Boolean = false;
public static var onError:Object;
private static var _listenChannelName:String = "__mochiservices";
private static var _rcvChannel:LocalConnection;
public static function isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function send(_arg1:String, _arg2:Object=null, _arg3:Object=null, _arg4:Object=null):void{
if (_connected){
_sendChannel.send(_sendChannelName, "onReceive", {methodName:_arg1, args:_arg2, callbackID:_clip._nextcallbackID});
} else {
if ((((_clip == null)) || (!(_connecting)))){
onError("NotConnected");
handleError(_arg2, _arg3, _arg4);
flush(true);
return;
};
_clip._queue.push({methodName:_arg1, args:_arg2, callbackID:_clip._nextcallbackID});
};
if (_clip != null){
if (((!((_clip._callbacks == null))) && (!((_clip._nextcallbackID == null))))){
_clip._callbacks[_clip._nextcallbackID] = {callbackObject:_arg3, callbackMethod:_arg4};
_clip._nextcallbackID++;
};
};
}
public static function get connected():Boolean{
return (_connected);
}
private static function flush(_arg1:Boolean):void{
var _local2:Object;
var _local3:Object;
if (_clip != null){
if (_clip._queue != null){
while (_clip._queue.length > 0) {
_local2 = _clip._queue.shift();
_local3 = null;
if (_local2 != null){
if (_local2.callbackID != null){
_local3 = _clip._callbacks[_local2.callbackID];
};
delete _clip._callbacks[_local2.callbackID];
if (((_arg1) && (!((_local3 == null))))){
handleError(_local2.args, _local3.callbackObject, _local3.callbackMethod);
};
};
};
};
};
}
private static function clickMovie(_arg1:String, _arg2:Function):MovieClip{
var _local3:Array;
var _local4:int;
var _local5:Array;
var _local6:Array;
var _local7:MovieClip;
var _local8:LocalConnection;
var _local9:String;
var _local10:ByteArray;
var _local11:ByteArray;
var _local12:uint;
var _local13:uint;
var _local14:Loader;
_local3 = [150, 21, 0, 7, 1, 0, 0, 0, 0, 98, 116, 110, 0, 7, 2, 0, 0, 0, 0, 116, 104, 105, 115, 0, 28, 150, 22, 0, 0, 99, 114, 101, 97, 116, 101, 69, 109, 112, 116, 121, 77, 111, 118, 105, 101, 67, 108, 105, 112, 0, 82, 135, 1, 0, 0, 23, 150, 13, 0, 4, 0, 0, 111, 110, 82, 101, 108, 101, 97, 115, 101, 0, 142, 8, 0, 0, 0, 0, 2, 42, 0, 114, 0, 150, 17, 0, 0, 32, 0, 7, 1, 0, 0, 0, 8, 0, 0, 115, 112, 108, 105, 116, 0, 82, 135, 1, 0, 1, 23, 150, 7, 0, 4, 1, 7, 0, 0, 0, 0, 78, 150, 8, 0, 0, 95, 98, 108, 97, 110, 107, 0, 154, 1, 0, 0, 150, 7, 0, 0, 99, 108, 105, 99, 107, 0, 150, 7, 0, 4, 1, 7, 1, 0, 0, 0, 78, 150, 27, 0, 7, 2, 0, 0, 0, 7, 0, 0, 0, 0, 0, 76, 111, 99, 97, 108, 67, 111, 110, 110, 101, 99, 116, 105, 111, 110, 0, 64, 150, 6, 0, 0, 115, 101, 110, 100, 0, 82, 79, 150, 15, 0, 4, 0, 0, 95, 97, 108, 112, 104, 97, 0, 7, 0, 0, 0, 0, 79, 150, 23, 0, 7, 0xFF, 0, 0xFF, 0, 7, 1, 0, 0, 0, 4, 0, 0, 98, 101, 103, 105, 110, 70, 105, 108, 108, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 109, 111, 118, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 16, 0, 7, 0, 0, 0, 0, 4, 0, 0, 101, 110, 100, 70, 105, 108, 108, 0, 82, 23];
_local5 = [104, 0, 31, 64, 0, 7, 208, 0, 0, 12, 1, 0, 67, 2, 0xFF, 0xFF, 0xFF, 63, 3];
_local6 = [0, 64, 0, 0, 0];
_local7 = new MovieClip();
_local8 = new LocalConnection();
_local9 = ((("_click_" + Math.floor((Math.random() * 999999))) + "_") + Math.floor(new Date().getTime()));
_local8 = new LocalConnection();
_local7.lc = _local8;
_local7.click = _arg2;
_local8.client = _local7;
_local8.connect(_local9);
_local10 = new ByteArray();
_local11 = new ByteArray();
_local11.endian = Endian.LITTLE_ENDIAN;
_local11.writeShort(1);
_local11.writeUTFBytes(((_arg1 + " ") + _local9));
_local11.writeByte(0);
_local12 = ((_local3.length + _local11.length) + 4);
_local13 = (_local12 + 35);
_local10.endian = Endian.LITTLE_ENDIAN;
_local10.writeUTFBytes("FWS");
_local10.writeByte(8);
_local10.writeUnsignedInt(_local13);
for each (_local4 in _local5) {
_local10.writeByte(_local4);
};
_local10.writeUnsignedInt(_local12);
_local10.writeByte(136);
_local10.writeShort(_local11.length);
_local10.writeBytes(_local11);
for each (_local4 in _local3) {
_local10.writeByte(_local4);
};
for each (_local4 in _local6) {
_local10.writeByte(_local4);
};
_local14 = new Loader();
_local14.loadBytes(_local10);
_local7.addChild(_local14);
return (_local7);
}
private static function init(_arg1:String, _arg2:Object):void{
_id = _arg1;
if (_arg2 != null){
_container = _arg2;
loadCommunicator(_arg1, _container);
};
}
public static function get childClip():Object{
return (_clip);
}
public static function get id():String{
return (_id);
}
public static function stayOnTop():void{
_container.addEventListener(Event.ENTER_FRAME, MochiServices.bringToTop, false, 0, true);
if (_clip != null){
_clip.visible = true;
};
}
public static function addLinkEvent(_arg1:String, _arg2:String, _arg3:DisplayObjectContainer, _arg4:Function=null):void{
var netup:Boolean;
var vars:Object;
var s:String;
var i:Number;
var x:String;
var req:URLRequest;
var loader:Loader;
var err:Function;
var complete:Function;
var setURL:Function;
var url = _arg1;
var burl = _arg2;
var btn = _arg3;
var onClick = _arg4;
vars = new Object();
vars["mav"] = getVersion();
vars["swfv"] = "9";
vars["swfurl"] = btn.loaderInfo.loaderURL;
vars["fv"] = Capabilities.version;
vars["os"] = Capabilities.os;
vars["lang"] = Capabilities.language;
vars["scres"] = ((Capabilities.screenResolutionX + "x") + Capabilities.screenResolutionY);
s = "?";
i = 0;
for (x in vars) {
if (i != 0){
s = (s + "&");
};
i = (i + 1);
s = (((s + x) + "=") + escape(vars[x]));
};
req = new URLRequest("http://x.mochiads.com/linkping.swf");
loader = new Loader();
err = function (_arg1:Object):void{
netup = false;
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
complete = function (_arg1:Object):void{
netup = true;
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, err);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.load(req);
setURL = function ():void{
var _local1:String;
var _local2:DisplayObject;
if (netup){
_local1 = (url + s);
} else {
_local1 = burl;
};
_local2 = clickMovie(_local1, onClick);
btn.addChild(_local2);
_local2.scaleX = (0.01 * btn.width);
_local2.scaleY = (0.01 * btn.height);
};
setTimeout(setURL, 1500);
}
public static function getVersion():String{
return ("1.35");
}
public static function disconnect():void{
if (((_connected) || (_connecting))){
if (_clip != null){
if (_clip.parent != null){
if ((_clip.parent is Sprite)){
Sprite(_clip.parent).removeChild(_clip);
_clip = null;
};
};
};
_connecting = (_connected = false);
flush(true);
try {
_listenChannel.close();
_rcvChannel.close();
} catch(error:Error) {
};
};
if (_timer != null){
try {
_timer.stop();
} catch(error:Error) {
};
};
}
public static function allowDomains(_arg1:String):String{
var _local2:String;
Security.allowDomain("*");
Security.allowInsecureDomain("*");
if (_arg1.indexOf("http://") != -1){
_local2 = _arg1.split("/")[2].split(":")[0];
Security.allowDomain(_local2);
Security.allowInsecureDomain(_local2);
};
return (_local2);
}
public static function doClose():void{
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
if (_clip.parent != null){
Sprite(_clip.parent).removeChild(_clip);
};
}
public static function setContainer(_arg1:Object=null, _arg2:Boolean=true):void{
if (_arg1 != null){
if ((_arg1 is Sprite)){
_container = _arg1;
};
};
if (_arg2){
if ((_container is Sprite)){
Sprite(_container).addChild(_clip);
};
};
}
private static function onStatus(_arg1:StatusEvent):void{
switch (_arg1.level){
case "error":
_connected = false;
_listenChannel.connect(_listenChannelName);
break;
};
}
private static function initComChannels():void{
if (!_connected){
_sendChannel.addEventListener(StatusEvent.STATUS, MochiServices.onStatus);
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, clip:_container, version:getVersion(), parentURL:_container.loaderInfo.loaderURL});
_rcvChannel.addEventListener(StatusEvent.STATUS, MochiServices.onStatus);
_clip.onReceive = function (_arg1:Object):void{
var cb:String;
var cblst:Object;
var method:*;
var methodName:String;
var obj:Object;
var pkg = _arg1;
cb = pkg.callbackID;
cblst = this.client._callbacks[cb];
if (!cblst){
return;
};
method = cblst.callbackMethod;
methodName = "";
obj = cblst.callbackObject;
if (((obj) && ((typeof(method) == "string")))){
methodName = method;
if (obj[method] != null){
method = obj[method];
//unresolved jump
};
};
if (method != undefined){
try {
method.apply(obj, pkg.args);
} catch(error:Error) {
};
} else {
if (obj != null){
try {
obj(pkg.args);
} catch(error:Error) {
};
};
};
delete this.client._callbacks[cb];
};
_clip.onError = function ():void{
MochiServices.onError("IOError");
};
_rcvChannel.connect(_rcvChannelName);
_connecting = false;
_connected = true;
_listenChannel.close();
while (_clip._queue.length > 0) {
_sendChannel.send(_sendChannelName, "onReceive", _clip._queue.shift());
};
};
}
private static function listen():void{
_listenChannel = new LocalConnection();
_listenChannel.client = _clip;
_clip.handshake = function (_arg1:Object):void{
MochiServices.comChannelName = _arg1.newChannel;
};
_listenChannel.allowDomain("*", "localhost");
_listenChannel.allowInsecureDomain("*", "localhost");
_listenChannel.connect(_listenChannelName);
}
private static function handleError(_arg1:Object, _arg2:Object, _arg3:Object):void{
var args = _arg1;
var callbackObject = _arg2;
var callbackMethod = _arg3;
if (args != null){
if (args.onError != null){
args.onError.apply(null, ["NotConnected"]);
};
if (((!((args.options == null))) && (!((args.options.onError == null))))){
args.options.onError.apply(null, ["NotConnected"]);
};
};
if (callbackMethod != null){
args = {};
args.error = true;
args.errorCode = "NotConnected";
if (((!((callbackObject == null))) && ((callbackMethod is String)))){
try {
var _local5 = callbackObject;
_local5[callbackMethod](args);
} catch(error:Error) {
};
} else {
if (callbackMethod != null){
try {
callbackMethod.apply(args);
} catch(error:Error) {
};
};
};
};
}
public static function get clip():Object{
return (_container);
}
public static function set comChannelName(_arg1:String):void{
if (_arg1 != null){
if (_arg1.length > 3){
_sendChannelName = (_arg1 + "_fromgame");
_rcvChannelName = _arg1;
initComChannels();
};
};
}
private static function loadCommunicator(_arg1:String, _arg2:Object):MovieClip{
var clipname:String;
var f:Function;
var req:URLRequest;
var id = _arg1;
var clip = _arg2;
clipname = ("_mochiservices_com_" + id);
if (_clip != null){
return (_clip);
};
if (!MochiServices.isNetworkAvailable()){
return (null);
};
MochiServices.allowDomains(_gatewayURL);
_clip = createEmptyMovieClip(clip, clipname, 10336, false);
_loader = new Loader();
_timer = new Timer(1000, 0);
_startTime = getTimer();
_timer.addEventListener(TimerEvent.TIMER, connectWait);
_timer.start();
f = function (_arg1:Object):void{
_clip._mochiad_ctr_failed = true;
MochiServices.disconnect();
MochiServices.onError("IOError");
};
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, f);
req = new URLRequest(_gatewayURL);
_loader.load(req);
_clip.addChild(_loader);
_clip._mochiservices_com = _loader;
_sendChannel = new LocalConnection();
_clip._queue = [];
_rcvChannel = new LocalConnection();
_rcvChannel.allowDomain("*", "localhost");
_rcvChannel.allowInsecureDomain("*", "localhost");
_rcvChannel.client = _clip;
_clip._nextcallbackID = 0;
_clip._callbacks = {};
listen();
return (_clip);
}
public static function bringToTop(_arg1:Event):void{
var e = _arg1;
if (MochiServices.clip != null){
if (MochiServices.childClip != null){
try {
if (MochiServices.clip.numChildren > 1){
MochiServices.clip.setChildIndex(MochiServices.childClip, (MochiServices.clip.numChildren - 1));
};
} catch(errorObject:Error) {
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
};
};
};
}
public static function connect(_arg1:String, _arg2:Object, _arg3:Object=null):void{
var id = _arg1;
var clip = _arg2;
var onError = _arg3;
if ((clip is DisplayObject)){
if (((!(_connected)) && ((_clip == null)))){
_connecting = true;
init(id, clip);
};
//unresolved jump
};
if (onError != null){
MochiServices.onError = onError;
} else {
if (MochiServices.onError == null){
MochiServices.onError = function (_arg1:String):void{
};
};
};
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Boolean=true):MovieClip{
var mc:MovieClip;
var parent = _arg1;
var name = _arg2;
var depth = _arg3;
var doAdd = _arg4;
mc = new MovieClip();
if (doAdd){
if (((false) && (depth))){
parent.addChildAt(mc, depth);
} else {
parent.addChild(mc);
};
};
try {
parent[name] = mc;
} catch(e:Error) {
throw (new Error("MochiServices requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."));
};
mc["_name"] = name;
return (mc);
}
public static function connectWait(_arg1:TimerEvent):void{
if ((getTimer() - _startTime) > 10000){
if (!_connected){
_clip._mochiad_ctr_failed = true;
MochiServices.disconnect();
MochiServices.onError("IOError");
};
_timer.stop();
};
}
}
}//package mochi
Section 42
//bigBlock (props.bigBlock)
package props {
import flash.geom.*;
import gameutil.*;
import fx.*;
public class bigBlock extends Platform {
private var nodown:Boolean;// = false
private var pd:Object;
private var ao;
private var r:int;
public function bigBlock(_arg1:int, _arg2:int, _arg3=false){
var _local4:int;
var _local5:int;
var _local6:String;
var _local7:Number;
var _local8:*;
var _local9:*;
nodown = false;
super();
sp = this;
nodown = _arg3;
this.x = _arg1;
this.y = _arg2;
_local4 = ((sp.width / 2) + 1);
_local5 = ((sp.height / 2) + 1);
left = (_arg1 - _local4);
right = (_arg1 + _local4);
top = (_arg2 - _local5);
bot = (_arg2 + _local5);
if (Math.random() < 0.5){
if ((((this.x > 41)) && ((this.x < 471)))){
r = int((Math.random() * 4));
if (nodown){
r = 1;
};
switch (r){
case 0:
_local6 = "bot";
_local7 = this.x;
_local8 = (this.y + 72);
_local9 = 0;
Game.poslist.push([_arg1, (_arg2 + 82)]);
break;
case 1:
_local6 = "right";
_local7 = (this.x + 72);
_local8 = this.y;
_local9 = -90;
Game.poslist.push([(_arg1 + 82), _arg2]);
break;
case 2:
_local6 = "left";
_local7 = (this.x - 72);
_local8 = this.y;
_local9 = 90;
Game.poslist.push([(_arg1 - 82), _arg2]);
break;
case 3:
_local6 = "top";
_local7 = this.x;
_local8 = (this.y - 72);
_local9 = 180;
Game.poslist.push([_arg1, (_arg2 - 82)]);
break;
};
new Spike(_local7, _local8, _local9, _local6);
};
};
Game.mc.addChild(this);
plist.push(this);
}
public function xplode():void{
var _local1:int;
var _local2:String;
var _local3:Point;
r = (Math.random() * 10);
if (r > 7){
SoundMan.boom1.play(0, 0, SoundMan.sfxtf);
} else {
SoundMan.bsmash.play(0, 0, SoundMan.sfxtf);
};
sp.visible = false;
gstate = "dead";
new Shockring(sp.x, sp.y, Game.flubfx, -1, "bigpow", "slowscale");
_local1 = 0;
while (_local1 < 8) {
r = (Math.random() * 2);
if (r == 0){
_local2 = "bfrag1";
};
if (r == 1){
_local2 = "bfrag2";
};
if (r == 2){
_local2 = "bfrag3";
};
_local3 = new Point();
_local3.x = ((Math.random() - 0.5) * 500);
_local3.y = ((Math.random() * 700) + 500);
ao = {delay:0, times:[0, 1], values:[1, 0], lifetime:20, interval:33, loop:false};
pd = {loc:new Point(sp.x, sp.y), trails:false, speed:_local3, rot:(Math.random() * 360), itype:_local2, bm:"normal", colormode:"fixed", scol:0, ecol:null, alerp:ao, xlerp:null, ylerp:null, loop:false, motype:"rgrav", resettype:"none"};
Particle.getP(pd, Game.flubfx);
_local1++;
};
Game.flub.shake(10, 0.5);
Game.flub.yspeed = (Game.flub.yspeed * 0.8);
Game.flub.mc.gotoAndStop(4);
Game.flub.xclock = 0;
gstate = "dead";
Points.addBlockBust(1);
}
override public function update():void{
var _local1:int;
switch (gstate){
case "norm":
_local1 = checkPlayer();
if (_local1 == 13){
xplode();
};
break;
};
}
}
}//package props
Section 43
//Cloud (props.Cloud)
package props {
import flash.display.*;
import gameutil.*;
public class Cloud {
private var isplaying;// = false
public var oldstate;
private var struck;// = false
public var xspeed:Number;// = 0
public var gstate:String;// = "norm"
private var hit:Boolean;// = false
public var bolt:Sprite;
public var boltclock;// = 0
private var dy;
public var sp:Sprite;
private var dx:Number;
private var halfw:int;
private var d;
private var thresh:int;
public static var clist:Array = [];
public function Cloud(_arg1:int, _arg2:int){
gstate = "norm";
xspeed = 0;
boltclock = 0;
hit = false;
struck = false;
isplaying = false;
super();
sp = new bigCloud();
sp.x = _arg1;
sp.y = _arg2;
xspeed = (((Math.random() * 10) + 2) * 0.3);
Game.mc.addChild(sp);
clist.push(this);
halfw = (sp.width / 2);
bolt = new lBolt();
bolt.y = 142;
bolt.visible = false;
sp.addChild(bolt);
sp.setChildIndex(bolt, 0);
}
private function checkPlayer():void{
thresh = 18000;
dx = (Game.flub.hitsp.x - sp.x);
dy = (Game.flub.hitsp.y - sp.y);
d = ((dx * dx) + (dy * dy));
if (d < thresh){
if ((((Math.random() < 0.05)) && ((Game.flub.hitsp.y > (sp.y - 64))))){
strikeplayer();
};
};
if (d < 180000){
if (!isplaying){
isplaying = true;
};
} else {
if (isplaying){
isplaying = false;
};
};
}
function update(){
switch (gstate){
case "norm":
moveMe();
if (Game.gstate == "play"){
checkPlayer();
};
break;
case "strike":
moveMe();
updateBolt();
checkPlayer();
break;
};
}
private function strikeplayer():void{
if (Game.flub.gstate != "reentry"){
if (!Game.flub.mc.shock.visible){
bolt.visible = true;
SoundMan.lightning.play(0, 0, SoundMan.sfxtf);
struck = true;
boltclock = 0;
gstate = "strike";
Game.flub.hurt(0, 0);
Game.flub.electrocute();
};
};
}
private function moveMe():void{
sp.x = (sp.x + xspeed);
if (sp.x > (600 + halfw)){
sp.x = -(halfw);
};
if (sp.x < -(halfw)){
sp.x = (600 + halfw);
};
}
public function kill():void{
Game.mc.removeChild(sp);
}
public function unPauseMe():void{
gstate = oldstate;
}
public function pauseMe():void{
oldstate = gstate;
gstate = "paused";
}
private function updateBolt():void{
boltclock = (boltclock + Tick.ftime);
if (boltclock > 2){
boltclock = 0;
gstate = "norm";
bolt.visible = false;
struck = false;
};
bolt.alpha = Math.random();
}
public static function killAll():void{
var _local1:Cloud;
for each (_local1 in clist) {
_local1.kill();
};
clist = [];
}
public static function unPauseAll():void{
var _local1:Cloud;
for each (_local1 in clist) {
_local1.unPauseMe();
};
}
public static function updateAll():void{
var _local1:Cloud;
for each (_local1 in clist) {
_local1.update();
};
}
public static function pauseAll():void{
var _local1:Cloud;
for each (_local1 in clist) {
_local1.pauseMe();
};
}
}
}//package props
Section 44
//FloobyAnim (props.FloobyAnim)
package props {
import flash.display.*;
import flash.geom.*;
import gameutil.*;
import fx.*;
public class FloobyAnim {
private var isplaying:Boolean;// = false
public var oldstate;
public var gstate:String;// = "norm"
private var dy;
private var targx;
private var dx:int;
private var bigrad:int;// = 8000
public var sp:MovieClip;
private var targy;
private var d;
private var bclock:Number;// = 0
private var pd:Object;
private var ao;
private var thresh;
public function FloobyAnim(_arg1:int, _arg2:int){
gstate = "norm";
bigrad = 8000;
isplaying = false;
bclock = 0;
super();
sp = new vj();
sp.x = _arg1;
sp.y = _arg2;
Game.mc.addChild(sp);
}
private function xplode():void{
new Shockring(sp.x, sp.y, Game.mc, -1);
}
public function update():void{
switch (gstate){
case "norm":
sparkle();
break;
case "transfer":
transfer();
break;
};
}
private function sparkle():void{
var _local1:Number;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:Number;
_local1 = Math.random();
if (_local1 < 0.3){
_local2 = ((Math.random() * 16) + 2);
_local3 = ((sp.y + (Math.random() * 16)) + 32);
_local4 = (sp.x + ((Math.random() - 0.5) * 16));
_local5 = (((Math.random() * 8) * 0.1) + 0.1);
ao = {delay:0, times:[0, 1], values:[1, 0], lifetime:16, interval:33, loop:false};
pd = {speed:new Point(0, 0), startw:_local2, starth:_local2, loc:new Point(_local4, sp.y), trails:false, itype:"Star", bm:"add", colormode:"fixed", scol:0, ecol:0, alerp:ao, xlerp:null, ylerp:null, loop:false, motype:"grav", gstr:_local5, scmode:1, resettype:"none"};
Particle.getP(pd, Game.flubfx);
};
}
public function unPauseMe():void{
gstate = oldstate;
}
private function transfer():void{
targx = Game.flub.mc.x;
targy = Game.flub.mc.y;
dx = (targx - sp.x);
dy = (targy - sp.y);
sp.x = (sp.x + (dx * 0.2));
sp.y = (sp.y + (dy * 0.2));
sp.width = (sp.width * 0.97);
sp.height = (sp.height * 0.97);
d = Math.sqrt(((dx * dx) + (dy * dy)));
if (d < 5){
SoundMan.getflooby.play(0, 0, SoundMan.sfxtf);
xplode();
kill();
Game.flub.makeFloobyChain();
Points.setMilestone("Lunar_Rescue");
Points.lunar_rescue = true;
};
}
public function kill():void{
Game.mc.removeChild(sp);
gstate = "dead";
}
public function pauseMe():void{
oldstate = gstate;
gstate = "paused";
}
}
}//package props
Section 45
//Platform (props.Platform)
package props {
import flash.display.*;
import flash.geom.*;
import gameutil.*;
public class Platform extends Sprite {
private var pmc:FPlayer;
public var left:int;
public var right;
public var sp:Sprite;
private var cb;
private var hph;
private var cl:int;
private var cr;
private var ct;
private var hpw:int;
public var top;
private var tp:Point;
public var gstate:String;// = "norm"
public var bot;
public var oldstate;
public var mytype:String;// = "default"
public static var plist:Array = [];
public function Platform(){
gstate = "norm";
mytype = "default";
super();
tp = new Point();
}
public function checkPlayer():int{
pmc = Game.flub;
hpw = Game.flub.halfw;
hph = Game.flub.halfh;
cl = (pmc.hitsp.x - hpw);
cr = (pmc.hitsp.x + hpw);
ct = (pmc.hitsp.y - hph);
cb = (pmc.hitsp.y + hph);
switch (mytype){
case "default":
tp.x = cr;
tp.y = pmc.hitsp.y;
tp = Game.mc.localToGlobal(tp);
if (sp.hitTestPoint(tp.x, tp.y, false)){
if ((((Game.flub.gstate == "norm")) || ((Game.flub.gstate == "balloon")))){
pmc.hitsp.x = (left - hpw);
pmc.xspeed = 0;
return (1);
};
return (13);
};
tp.x = cl;
tp.y = pmc.hitsp.y;
tp = Game.mc.localToGlobal(tp);
if (sp.hitTestPoint(tp.x, tp.y, false)){
if ((((Game.flub.gstate == "norm")) || ((Game.flub.gstate == "balloon")))){
pmc.hitsp.x = (right + hpw);
pmc.xspeed = 0;
return (2);
};
return (13);
};
tp.x = pmc.hitsp.x;
tp.y = cb;
tp = Game.mc.localToGlobal(tp);
if (sp.hitTestPoint(tp.x, tp.y, false)){
if ((((Game.flub.gstate == "norm")) || ((Game.flub.gstate == "balloon")))){
pmc.hitsp.y = (top - hph);
Game.flub.bounce();
return (3);
};
return (13);
};
tp.x = pmc.hitsp.x;
tp.y = ct;
tp = Game.mc.localToGlobal(tp);
if (sp.hitTestPoint(tp.x, tp.y, false)){
if ((((Game.flub.gstate == "norm")) || ((Game.flub.gstate == "balloon")))){
pmc.hitsp.y = (bot + hph);
pmc.yspeed = 0;
return (4);
};
return (13);
};
break;
case "top":
if (pmc.yspeed >= 0){
tp.x = pmc.hitsp.x;
tp.y = cb;
tp = Game.mc.localToGlobal(tp);
if (sp.hitTestPoint(tp.x, tp.y, false)){
if ((((Game.flub.gstate == "norm")) || ((Game.flub.gstate == "balloon")))){
pmc.hitsp.y = (top - hph);
Game.flub.bounce();
return (3);
};
return (13);
};
};
break;
};
return (0);
}
public function pauseMe():void{
oldstate = gstate;
gstate = "paused";
}
public function unPauseMe():void{
gstate = oldstate;
}
public function kill():void{
Game.mc.removeChild(sp);
}
public function update():void{
}
public static function killAll():void{
var _local1:Platform;
for each (_local1 in plist) {
_local1.kill();
};
plist = [];
}
public static function unPauseAll():void{
var _local1:Platform;
for each (_local1 in plist) {
_local1.unPauseMe();
};
}
public static function updateAll():void{
var _local1:Platform;
for each (_local1 in plist) {
_local1.update();
};
}
public static function pauseAll():void{
var _local1:Platform;
for each (_local1 in plist) {
_local1.pauseMe();
};
}
}
}//package props
Section 46
//Spike (props.Spike)
package props {
import flash.display.*;
import flash.geom.*;
import gameutil.*;
import fx.*;
public class Spike {
private var pmc:FPlayer;
public var oldstate;
private var checkrad;
public var gstate:String;// = "norm"
private var dx:Number;// = 0
private var dy;// = 0
public var sp:Sprite;
private var hph;
private var d;// = 0
public var stype:String;
private var hpw:int;
private var boostx;
private var boosty;
private var hitClock;// = 0
private var tp:Point;
public static var slist:Array = [];
public function Spike(_arg1, _arg2, _arg3, _arg4){
gstate = "norm";
dx = 0;
dy = 0;
d = 0;
hitClock = 0;
super();
stype = _arg4;
tp = new Point();
switch (stype){
case "bot":
boostx = 0;
boosty = 20;
sp = new singlespike();
break;
case "top":
boostx = 0;
boosty = -20;
sp = new upSpike();
break;
case "left":
boostx = -20;
boosty = 0;
sp = new singlespike();
break;
case "right":
boostx = 20;
boosty = 0;
sp = new singlespike();
break;
};
sp.x = _arg1;
sp.y = _arg2;
sp.rotation = _arg3;
Game.mc.addChild(sp);
slist.push(this);
}
public function checkPlayer():void{
hitClock = (hitClock - Tick.ftime);
if (hitClock < 0){
pmc = Game.flub;
hpw = Game.flub.halfw;
checkrad = ((hpw * hpw) + 4000);
dx = (pmc.mc.x - sp.x);
dy = (pmc.mc.y - sp.y);
d = ((dx * dx) + (dy * dy));
if (d < checkrad){
if (Game.flub.gstate != "reentry"){
SoundMan.hitspike.play(0, 0, SoundMan.sfxtf);
new Shockring(sp.x, sp.y, Game.flubfx, -1, "bigpow", "slowscale");
pmc.hurt(boostx, boosty);
hitClock = 1;
} else {
sp.visible = false;
gstate = "dead";
};
};
};
}
public function update():void{
switch (gstate){
case "norm":
checkPlayer();
break;
};
}
public function unPauseMe():void{
gstate = oldstate;
}
public function kill():void{
Game.mc.removeChild(sp);
}
public function pauseMe():void{
oldstate = gstate;
gstate = "paused";
}
public static function killAll():void{
var _local1:Spike;
for each (_local1 in slist) {
_local1.kill();
};
slist = [];
}
public static function unPauseAll():void{
var _local1:Spike;
for each (_local1 in slist) {
_local1.unPauseMe();
};
}
public static function updateAll():void{
var _local1:Spike;
for each (_local1 in slist) {
_local1.update();
};
}
public static function pauseAll():void{
var _local1:Spike;
for each (_local1 in slist) {
_local1.pauseMe();
};
}
}
}//package props
Section 47
//TopBlock (props.TopBlock)
package props {
public class TopBlock extends Platform {
public function TopBlock(_arg1:int, _arg2:int, _arg3:int){
var _local4:int;
var _local5:int;
super();
sp = this;
mytype = "top";
this.x = _arg1;
this.y = _arg2;
this.width = _arg3;
_local4 = ((sp.width / 2) + 1);
_local5 = ((sp.height / 2) + 1);
left = (_arg1 - _local4);
right = (_arg1 + _local4);
top = (_arg2 - _local5);
bot = (_arg2 + _local5);
Game.mc.addChild(this);
plist.push(this);
}
override public function update():void{
var _local1:int;
switch (gstate){
case "norm":
_local1 = checkPlayer();
break;
};
}
}
}//package props
Section 48
//ag_intro_link (ag_intro_link)
package {
import flash.display.*;
public dynamic class ag_intro_link extends MovieClip {
}
}//package
Section 49
//ag_intro_mc (ag_intro_mc)
package {
import flash.display.*;
public dynamic class ag_intro_mc extends MovieClip {
public var isComplete:Boolean;
public function ag_intro_mc(){
addFrameScript(0, frame1, 218, frame219);
}
function frame1(){
isComplete = false;
}
function frame219(){
this.stop();
isComplete = true;
}
}
}//package
Section 50
//arpegi_arms (arpegi_arms)
package {
import flash.media.*;
public dynamic class arpegi_arms extends Sound {
}
}//package
Section 51
//Ball (Ball)
package {
import flash.display.*;
public dynamic class Ball extends MovieClip {
public var rpupil:MovieClip;
public var lpupil:MovieClip;
public var droot:MovieClip;
public var shock:MovieClip;
public function Ball(){
addFrameScript(0, frame1);
}
function frame1(){
this.stop();
}
}
}//package
Section 52
//balloon_ride (balloon_ride)
package {
import flash.media.*;
public dynamic class balloon_ride extends Sound {
}
}//package
Section 53
//bfrag1 (bfrag1)
package {
import flash.display.*;
public dynamic class bfrag1 extends Sprite {
}
}//package
Section 54
//bfrag2 (bfrag2)
package {
import flash.display.*;
public dynamic class bfrag2 extends Sprite {
}
}//package
Section 55
//bfrag3 (bfrag3)
package {
import flash.display.*;
public dynamic class bfrag3 extends Sprite {
}
}//package
Section 56
//bgsky (bgsky)
package {
import flash.display.*;
public dynamic class bgsky extends Sprite {
}
}//package
Section 57
//bigboom (bigboom)
package {
import flash.media.*;
public dynamic class bigboom extends Sound {
}
}//package
Section 58
//bigCloud (bigCloud)
package {
import flash.display.*;
public dynamic class bigCloud extends Sprite {
}
}//package
Section 59
//bigfuzz (bigfuzz)
package {
import flash.display.*;
public dynamic class bigfuzz extends Sprite {
}
}//package
Section 60
//bigpow (bigpow)
package {
import flash.display.*;
public dynamic class bigpow extends Sprite {
}
}//package
Section 61
//blockSmash (blockSmash)
package {
import flash.media.*;
public dynamic class blockSmash extends Sound {
}
}//package
Section 62
//booster (booster)
package {
import flash.display.*;
public dynamic class booster extends MovieClip {
}
}//package
Section 63
//boostsnd (boostsnd)
package {
import flash.media.*;
public dynamic class boostsnd extends Sound {
}
}//package
Section 64
//bounce (bounce)
package {
import flash.media.*;
public dynamic class bounce extends Sound {
}
}//package
Section 65
//bpiece (bpiece)
package {
import flash.display.*;
public dynamic class bpiece extends Sprite {
}
}//package
Section 66
//bump1 (bump1)
package {
import flash.media.*;
public dynamic class bump1 extends Sound {
}
}//package
Section 67
//bump2 (bump2)
package {
import flash.media.*;
public dynamic class bump2 extends Sound {
}
}//package
Section 68
//bump3 (bump3)
package {
import flash.media.*;
public dynamic class bump3 extends Sound {
}
}//package
Section 69
//cliff (cliff)
package {
import flash.display.*;
public dynamic class cliff extends Sprite {
}
}//package
Section 70
//colbox (colbox)
package {
import flash.display.*;
public dynamic class colbox extends Sprite {
}
}//package
Section 71
//credits (credits)
package {
import flash.events.*;
import flash.display.*;
import mochi.*;
import flash.net.*;
public dynamic class credits extends MovieClip {
public var back_btn:MovieClip;
public var minifloob:vj;
public var pmg_btn:pmgb;
public var grnd:groundPlatform;
public function credits(){
addFrameScript(0, frame1);
}
public function linkup(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://armorgames.com?gamereferral=FlubberRise"), "_blank");
}
public function back_click(_arg1:MouseEvent):void{
back_btn.removeEventListener(MouseEvent.MOUSE_UP, back_click);
if (!Game.mochiok){
pmg_btn.removeEventListener(MouseEvent.MOUSE_UP, linkup);
};
Game.flub.back2menu();
}
function frame1(){
this.stop();
if (!Game.flub.floobygot){
minifloob.stop();
minifloob.visible = false;
};
pmg_btn.buttonMode = true;
if (Game.mochiok){
MochiServices.addLinkEvent("http://x.mochiads.com/link/c75fad183cbdc468", "http://www.funfacegames.com", pmg_btn);
} else {
pmg_btn.addEventListener(MouseEvent.MOUSE_UP, linkup);
};
back_btn.addEventListener(MouseEvent.MOUSE_UP, back_click);
back_btn.buttonMode = true;
}
}
}//package
Section 72
//darkmattercatch (darkmattercatch)
package {
import flash.media.*;
public dynamic class darkmattercatch extends Sound {
}
}//package
Section 73
//dialogBox (dialogBox)
package {
import flash.display.*;
public dynamic class dialogBox extends MovieClip {
public function dialogBox(){
addFrameScript(0, frame1);
}
function frame1(){
this.stop();
}
}
}//package
Section 74
//diseaseCloud (diseaseCloud)
package {
import flash.display.*;
public dynamic class diseaseCloud extends Sprite {
}
}//package
Section 75
//dm (dm)
package {
import flash.display.*;
public dynamic class dm extends Sprite {
}
}//package
Section 76
//dot (dot)
package {
import flash.display.*;
public dynamic class dot extends Sprite {
}
}//package
Section 77
//emptyp (emptyp)
package {
import flash.display.*;
public dynamic class emptyp extends Sprite {
}
}//package
Section 78
//endArrow (endArrow)
package {
import flash.display.*;
public dynamic class endArrow extends Sprite {
}
}//package
Section 79
//ffgIntro (ffgIntro)
package {
import flash.display.*;
public dynamic class ffgIntro extends MovieClip {
public var ffgAnim:MovieClip;
}
}//package
Section 80
//fillup (fillup)
package {
import flash.media.*;
public dynamic class fillup extends Sound {
}
}//package
Section 81
//finalwind (finalwind)
package {
import flash.media.*;
public dynamic class finalwind extends Sound {
}
}//package
Section 82
//flameloop (flameloop)
package {
import flash.media.*;
public dynamic class flameloop extends Sound {
}
}//package
Section 83
//flooby_walk (flooby_walk)
package {
import flash.display.*;
public dynamic class flooby_walk extends MovieClip {
public var fwalk:MovieClip;
public function flooby_walk(){
addFrameScript(81, frame82);
}
function frame82(){
this.stop();
}
}
}//package
Section 84
//floobyCatch (floobyCatch)
package {
import flash.media.*;
public dynamic class floobyCatch extends Sound {
}
}//package
Section 85
//flubberadd (flubberadd)
package {
import flash.display.*;
public dynamic class flubberadd extends Sprite {
}
}//package
Section 86
//FPlayer (FPlayer)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import collectables.*;
import gameutil.*;
import fx.*;
import flash.ui.*;
public class FPlayer {
public var gooloss;// = false
public var boostClock;// = 0
private var ao;
private var sc:Number;// = 0
private var tspeed;
public var by;
public var bx;
public var grav;// = 1
public var d;
public var absorbDelay;// = 0
private var freq;// = 0
private var heatison;// = false
private var keyok;// = true
private var tp:Point;
private var lp_x;
public var dh;
private var lp_y;
private var dmtshow;// = false
public var gstate:String;// = "norm"
public var dir;
public var dw;
private var dx;
public var halfh;
public var xclock;
private var camshake:Boolean;// = false
public var ea;
public var halfw:int;
private var dy;
private var rp_x;
private var rp_y;
private var stretching;// = false
private var antigrav;// = false
public var btarg:Balloon;
public var oldstate;
public var flagtarg:int;
public var xspeed:Number;// = 0
private var emax;// = 1
public var camtargy;
public var wave:Number;// = 0
public var speedh;// = 0
public var dmt;
public var speedw;// = 0
public var hs;
public var roundhi;// = 0
public var oldh;
public var targH;// = 128
public var fwalk;
public var hitsp;
public var targW;// = 128
public var squash;
public var curhi:int;// = 0
private var shakedur:Number;
public var impact;// = 0
public var droot;
public var cred;
public var boosting;// = false
public var dangles:Array;
private var shakestr;
public var flag:MovieClip;
public var yspeed;// = 0
public var floobygot;// = false
public var leafclock;// = 0
private var hit:Boolean;// = false
public var maxy;// = 50
public var mc:MovieClip;
public var bgmove:Boolean;// = false
public var dtip;
private var lookx;
private var looky;
public var dsp:Sprite;
private var amp;// = 0
private var rot:Number;
public var start_y;
public var stretchH;// = 0
public var besthi;// = 0
public var gooclock:Number;// = 0
public var clicky;// = 20
private var pd:Object;
public var floob:Sprite;
public function FPlayer(){
gstate = "norm";
xspeed = 0;
yspeed = 0;
targW = 128;
targH = 128;
stretchH = 0;
speedw = 0;
speedh = 0;
absorbDelay = 0;
impact = 0;
hit = false;
keyok = true;
stretching = false;
heatison = false;
antigrav = false;
dmtshow = false;
curhi = 0;
besthi = 0;
roundhi = 0;
maxy = 50;
clicky = 20;
bgmove = false;
gooloss = false;
floobygot = false;
boosting = false;
gooclock = 0;
leafclock = 0;
boostClock = 0;
grav = 1;
camshake = false;
emax = 1;
dangles = [];
wave = 0;
sc = 0;
freq = 0;
amp = 0;
super();
mc = new Ball();
Game.mc.addChild(mc);
mc.addEventListener(MouseEvent.MOUSE_DOWN, mpress);
mc.buttonMode = true;
tp = new Point();
tspeed = new Point();
hitsp = new colbox();
hitsp.mouseEnabled = false;
hitsp.mouseChildren = false;
Game.mc.addChild(hitsp);
makeDangles();
makeHeatShield();
resetGame();
lp_x = mc.lpupil.x;
lp_y = mc.lpupil.y;
rp_x = mc.rpupil.x;
rp_y = mc.rpupil.y;
Game.timeline.addEventListener(KeyboardEvent.KEY_DOWN, keydown);
Game.timeline.addEventListener(KeyboardEvent.KEY_DOWN, keyup);
mc.shock.visible = false;
}
public function makeHeatShield():void{
hs = new sonicBoom();
hs.x = hitsp.x;
hs.y = hitsp.y;
hs.glowball.visible = false;
hs.width = (hitsp.width * 1.5);
hs.height = (hitsp.height * 1.2);
hs.alpha = 0;
hs.blendMode = "add";
hs.mouseChildren = false;
hs.mouseEnabled = false;
Game.mc.addChild(hs);
}
public function back2menu():void{
gstate = "creditreturn";
}
private function xeyeTimer():void{
xclock = (xclock + Tick.ftime);
if ((((xclock > 1)) && (!((mc.currentFrame == 1))))){
xclock = 0;
mc.gotoAndStop(1);
};
}
public function hurt(_arg1, _arg2):void{
xspeed = (xspeed + _arg1);
yspeed = (yspeed + _arg2);
changeSize(-10);
gooloss = true;
mc.gotoAndStop(2);
xclock = 0;
if (gstate != "reentry"){
Points.nothurt = false;
};
}
public function pauseMe():void{
oldstate = gstate;
gstate = "paused";
}
private function makeBigBoom():void{
var _local1:int;
var _local2:int;
new Shockring(hitsp.x, hitsp.y, Game.flubfx, 1);
_local1 = ((halfw * 0.5) + 2);
_local2 = 0;
while (_local2 < 10) {
dir = Helper.getSpecificDir((_local2 * 36), 20);
rot = (_local2 * 36);
ao = {delay:0, times:[0, 1, 0], values:[1, 1, 0], lifetime:20, interval:33, loop:false};
pd = {loc:new Point(hitsp.x, hitsp.y), trails:false, startw:_local1, starth:_local1, xs:dir[0], rot:rot, ys:dir[1], itype:"goo", bm:"normal", colormode:"fixed", scol:0, ecol:null, alerp:ao, xlerp:null, ylerp:null, loop:false, motype:"stretch", resettype:"none"};
Particle.getP(pd, Game.flubfx);
_local2++;
};
if (gstate != "gameover"){
gooloss = true;
if (gstate != "reentry"){
changeSize(-20);
Points.nothurt = false;
} else {
changeSize(-20);
};
mc.gotoAndStop(3);
xclock = 0;
};
}
private function updateDangles():void{
var _local1:Number;
var _local2:Point;
var _local3:int;
var _local4:Object;
_local1 = yspeed;
if (gstate == "balloon"){
_local1 = -1;
};
freq = (0.1 + (Math.abs(_local1) * 0.1));
amp = (0.1 + (Math.abs(_local1) * 0.01));
sc = (sc + freq);
wave = Math.sin(sc);
_local2 = new Point(droot.x, droot.y);
_local2 = mc.localToGlobal(_local2);
_local2 = Game.mc.globalToLocal(_local2);
dsp.x = _local2.x;
dsp.y = _local2.y;
dsp.graphics.clear();
dsp.graphics.lineStyle(2, 11066380, 1, false, "none");
dsp.graphics.moveTo(0, 0);
_local3 = 1;
while (_local3 < dangles.length) {
_local4 = dangles[_local3];
_local4.pos.y = (_local4.pos.y - ((_local1 * _local4.stiff) - 1));
_local4.pos.x = (_local4.pos.x - ((xspeed * _local4.stiff) + wave));
dx = (_local4.targ.pos.x - _local4.pos.x);
dy = (_local4.targ.pos.y - _local4.pos.y);
_local4.xs = ((dx * _local4.acc) + (_local4.xs * _local4.damp));
_local4.ys = ((dy * _local4.acc) + (_local4.ys * _local4.damp));
_local4.pos.x = (_local4.pos.x + _local4.xs);
_local4.pos.y = (_local4.pos.y + _local4.ys);
dsp.graphics.lineTo(_local4.pos.x, _local4.pos.y);
_local3++;
};
dtip.x = dangles[(dangles.length - 1)].pos.x;
dtip.y = dangles[(dangles.length - 1)].pos.y;
}
public function electrocute():void{
mc.shock.visible = true;
mc.shock.alpha = 1;
emax = 1;
SoundMan.shock.play(0, 0, SoundMan.sfxtf);
}
public function makeFlag():void{
flag = new mflag();
flag.x = 0;
flag.y = Game.levHeight;
flag.mouseEnabled = false;
flag.mouseChildren = false;
flagtarg = (Game.levHeight - 476);
Game.mc.addChild(flag);
flagtarg = ((Game.levHeight - int((besthi * 64))) - 476);
}
private function moveNcheck():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:Number;
if (boosting){
boostClock = (boostClock - Tick.ftime);
if (boostClock < 0){
boosting = false;
};
_local2 = ((Math.random() * halfw) + 2);
_local3 = (hitsp.x + ((Math.random() - 0.5) * halfw));
_local4 = (((Math.random() * 8) * 0.1) + 0.1);
ao = {delay:0, times:[0, 1], values:[1, 0], lifetime:12, interval:33, loop:false};
pd = {speed:new Point((-(xspeed) * 5), (-(yspeed) * 5)), startw:_local2, starth:_local2, loc:new Point(_local3, mc.y), trails:false, itype:"Star", bm:"add", colormode:"fixed", scol:0, ecol:0, alerp:ao, xlerp:null, ylerp:null, loop:false, motype:"grav", gstr:_local4, scmode:1, resettype:"none"};
Particle.getP(pd, Game.flubfx);
};
xspeed = (xspeed * 0.97);
if (yspeed >= 50){
xspeed = (xspeed + Math.max(Math.min(((Game.timeline.mouseX - hitsp.x) * 0.005), 0.3), -0.3));
};
if (!antigrav){
if (mc.rotation != 0){
if (mc.rotation < 0){
mc.rotation = Math.min((mc.rotation + 6), 0);
};
if (mc.rotation > 0){
mc.rotation = Math.max((mc.rotation - 6), 0);
};
};
};
if ((((gstate == "norm")) || ((gstate == "balloon")))){
if ((((hitsp.y < Game.levHeight)) && ((hitsp.y > 0x7D00)))){
SoundMan.windvol = (0.1 + ((Math.abs(yspeed) / maxy) * 0.35));
} else {
SoundMan.windvol = 0;
};
};
hitsp.x = (hitsp.x + xspeed);
hitsp.y = (hitsp.y + yspeed);
if (gstate != "reentry"){
if ((((hitsp.y <= 10000)) && (!(antigrav)))){
noGrav();
makestars(-1);
if (!Points.low_g){
Points.low_g = true;
Points.setMilestone("Low_G");
};
};
if ((((hitsp.y > 10000)) && (antigrav))){
setGrav();
makestars(1);
};
if (antigrav){
mc.rotation = (mc.rotation + xspeed);
};
};
if (hitsp.x < halfw){
hitsp.x = halfw;
xspeed = -(xspeed);
Game.leftPaddle(hitsp.y);
};
if (hitsp.x > (0x0200 - halfw)){
hitsp.x = (0x0200 - halfw);
xspeed = -(xspeed);
Game.rightPaddle(hitsp.y);
};
bx = hitsp.x;
by = (hitsp.y + (hitsp.height * 0.5));
if (!hit){
dw = (targW - hitsp.width);
dh = (targH - hitsp.height);
speedw = ((dw * 0.1) + (speedw * 0.9));
speedh = ((dh * 0.2) + (speedh * 0.85));
hitsp.height = (hitsp.height + speedh);
hitsp.width = (hitsp.width + speedw);
halfw = (hitsp.width / 2);
halfh = (hitsp.height / 2);
if ((hitsp.y + halfh) > (Game.ground.y - (Game.ground.height / 2))){
bounce();
hitsp.y = (Game.ground.y - (halfh + (Game.ground.height / 2)));
if (gstate == "reentry"){
SoundMan.landslide.play(0, 0, SoundMan.sfxtf);
Game.hud.gover.gotoAndStop(2);
Points.sendallstats();
Game.gameOver();
gstate = "finalBoom";
};
};
} else {
doImpact();
};
yspeed = Math.min((yspeed + grav), maxy);
if (yspeed > 5){
stretchH = Math.min((stretchH + (yspeed * 0.005)), 5);
if (!stretching){
oldh = targH;
stretching = true;
};
targH = Math.min((targH + stretchH), (oldh * 1.3));
} else {
stretchH = 0;
if (stretching){
targH = oldh;
stretching = false;
};
};
curhi = Math.max(0, (Game.mc.y - Game.startpos));
_local1 = (curhi / 64);
if (_local1 > roundhi){
roundhi = _local1;
};
Game.hud.htxt.height_txt.text = (_local1 + " m");
if (_local1 > besthi){
besthi = _local1;
flag.alpha = 1;
Game.hud.btxt.best_txt.text = (_local1 + " m");
flagtarg = ((Game.levHeight - curhi) - 476);
};
mc.width = hitsp.width;
mc.height = hitsp.height;
mc.x = hitsp.x;
mc.y = hitsp.y;
}
public function bounce():void{
hit = true;
if ((((yspeed >= 50)) && (!((gstate == "gameover"))))){
SoundMan.boom1.play(0, 0, SoundMan.sfxtf);
shake((halfw * 0.35), 1);
makeBigBoom();
} else {
if (yspeed > 30){
if (yspeed > 1){
SoundMan.b3.play(0, 0, SoundMan.sfxtf);
};
} else {
if (yspeed > 15){
if (yspeed > 1){
SoundMan.b2.play(0, 0, SoundMan.sfxtf);
};
} else {
if (yspeed > 4){
if (yspeed > 1){
SoundMan.b1.play(0, 0, SoundMan.sfxtf);
};
};
};
};
};
impact = (yspeed * 0.75);
yspeed = 0;
absorbDelay = impact;
if (gstate == "gameover"){
impact = 0;
};
if (impact < 4){
hit = false;
};
}
private function look():void{
if (((!((mc == null))) && (!((mc.lpupil == null))))){
if (mc.currentFrame == 1){
dy = (Game.mc.mouseY - hitsp.y);
dx = (Game.timeline.mouseX - hitsp.x);
rot = Math.atan2(dy, dx);
lookx = (lp_x + (Math.cos(rot) * 4));
looky = (lp_y + (Math.sin(rot) * 4));
mc.lpupil.x = (mc.lpupil.x + ((lookx - mc.lpupil.x) * 0.3));
mc.lpupil.y = (mc.lpupil.y + ((looky - mc.lpupil.y) * 0.3));
mc.rpupil.x = (mc.rpupil.x + (((lookx + 26) - mc.rpupil.x) * 0.3));
mc.rpupil.y = (mc.rpupil.y + ((looky - mc.rpupil.y) * 0.3));
};
};
}
private function balloonMove():void{
yspeed = -10;
}
private function camTrack():void{
var _local1:Number;
var _local2:int;
camtargy = (-(hitsp.y) + 300);
if (camtargy < Game.startpos){
camtargy = Game.startpos;
};
_local1 = 0.1;
if (yspeed > 10){
_local1 = (yspeed * 0.025);
};
d = ((camtargy - Game.mc.y) * _local1);
Game.mc.y = (Game.mc.y + d);
_local2 = (1656 - ((curhi * 0.038) - Game.sky.y));
Game.sky.y = (Game.sky.y - (_local2 * 0.1));
if (Game.sky.y < -1655){
Game.sky.y = -1656;
};
if (Game.sky.y > 1013){
Game.sky.y = 1013;
};
}
private function floobywin():void{
dx = (150 - hitsp.x);
hitsp.x = (hitsp.x + (dx * 0.1));
mc.x = hitsp.x;
if (Math.abs(dx) < 5){
dtip.removeChild(floob);
fwalk = new flooby_walk();
fwalk.x = 0;
fwalk.y = 600;
Game.timeline.addChild(fwalk);
gstate = "floobywalk";
};
}
public function update(){
switch (gstate){
case "norm":
focusCheck();
camTrack();
moveNcheck();
look();
updateDangles();
moveFlag();
if (gooloss){
spillgoo();
};
updateHeatShield();
if (camshake){
shakecam();
};
xeyeTimer();
checkLeaves();
updateShock();
break;
case "balloon":
focusCheck();
camTrack();
moveNcheck();
balloonMove();
look();
updateDangles();
moveFlag();
if (gooloss){
spillgoo();
};
updateHeatShield();
if (camshake){
shakecam();
};
xeyeTimer();
checkLeaves();
updateShock();
break;
case "reentry":
focusCheck();
camTrack();
moveNcheck();
look();
updateDangles();
moveFlag();
if (gooloss){
spillgoo();
};
updateHeatShield();
if (camshake){
shakecam();
};
xeyeTimer();
checkLeaves();
updateShock();
break;
case "dmtrans":
focusCheck();
yspeed = (yspeed * 0.9);
dx = (100 - hitsp.x);
hitsp.x = (hitsp.x + (dx * 0.1));
mc.x = hitsp.x;
if (dmt != null){
dmt.x = hitsp.x;
};
if (Math.abs(yspeed) < 2){
if (!dmtshow){
dmt = new heavymsg();
dmt.x = hitsp.x;
dmt.y = (hitsp.y - halfh);
Game.mc.addChild(dmt);
dmt.addEventListener(MouseEvent.MOUSE_DOWN, dmt_advance);
dmt.buttonMode = true;
dmtshow = true;
};
};
look();
camTrack();
xeyeTimer();
updateDangles();
break;
case "floobywin":
focusCheck();
floobywin();
camTrack();
moveNcheck();
look();
updateDangles();
if (gooloss){
spillgoo();
};
if (camshake){
shakecam();
};
break;
case "floobywalk":
focusCheck();
camTrack();
moveNcheck();
look();
updateDangles();
if (fwalk.currentFrame == fwalk.totalFrames){
ea = new endArrow();
ea.x = 430;
ea.y = (Game.levHeight - 110);
ea.addEventListener(MouseEvent.MOUSE_DOWN, eadown);
ea.buttonMode = true;
Game.mc.addChild(ea);
gstate = "gameover";
Game.timeline.removeChild(fwalk);
};
case "conversation":
updateDialog();
break;
case "finalBoom":
focusCheck();
camTrack();
moveNcheck();
look();
updateDangles();
moveFlag();
if (gooloss){
spillgoo();
};
updateHeatShield();
if (camshake){
shakecam();
};
xeyeTimer();
checkLeaves();
updateShock();
finalBoom();
break;
case "gameover":
if (!Game.scoreboardShowing){
focusCheck();
};
camTrack();
moveNcheck();
if (Points.game_complete){
look();
};
updateDangles();
moveFlag();
if (gooloss){
spillgoo();
};
if (camshake){
shakecam();
};
break;
case "showCred":
cred.x = (cred.x - 20);
Game.mc.x = (Game.mc.x - 20);
if (cred.x < 0){
cred.x = 0;
gstate = "credits";
};
break;
case "creditreturn":
cred.x = (cred.x + 20);
Game.mc.x = (Game.mc.x + 20);
if (cred.x > 0x0200){
Game.mc.x = 0;
Game.timeline.removeChild(cred);
cred = null;
gstate = "gameover";
Game.hud.gover.visible = true;
};
break;
};
}
private function spillgoo():void{
var _local1:int;
var _local2:int;
var _local3:Number;
gooclock = (gooclock + Tick.ftime);
if (gooclock > 2){
gooloss = false;
gooclock = 0;
};
_local1 = ((Math.random() * halfw) + 2);
_local2 = (hitsp.x + ((Math.random() - 0.5) * halfw));
_local3 = (((Math.random() * 8) * 0.1) + 0.1);
ao = {delay:0, times:[0, 1], values:[1, 0], lifetime:8, interval:33, loop:false};
pd = {speed:new Point((-(xspeed) * 5), (-(yspeed) * 5)), startw:_local1, starth:_local1, loc:new Point(_local2, mc.y), trails:false, itype:"goo", bm:"normal", colormode:"fixed", scol:0, ecol:0, alerp:ao, xlerp:null, ylerp:null, loop:false, motype:"grav", gstr:_local3, scmode:1, resettype:"none"};
Particle.getP(pd, Game.flubfx);
}
private function heatParty():void{
var _local1:int;
var _local2:int;
var _local3:Number;
_local1 = ((Math.random() * (halfw / 2)) + 2);
_local2 = (hitsp.x + ((Math.random() - 0.5) * hs.width));
_local3 = (((Math.random() * 8) * 0.1) + 0.1);
ao = {delay:0, times:[0, 1], values:[1, 0], lifetime:8, interval:33, loop:false};
pd = {speed:new Point((-(xspeed) * 5), (-(yspeed) * 5)), startw:_local1, starth:_local1, loc:new Point(_local2, hs.y), trails:false, itype:"heat", bm:"add", colormode:"fixed", scol:0, ecol:0, alerp:ao, xlerp:null, ylerp:null, loop:false, motype:"grav", gstr:_local3, scmode:1, resettype:"none"};
Particle.getP(pd, Game.flubfx);
}
private function moveFlag():void{
dy = (flagtarg - flag.y);
flag.y = (flag.y + (dy * 0.1));
}
public function shake(_arg1:int, _arg2:Number):void{
camshake = true;
shakestr = _arg1;
shakedur = _arg2;
}
private function shakecam():void{
shakedur = (shakedur - Tick.ftime);
if (shakedur > 0){
Game.mc.x = (Game.mc.x + ((Math.random() * shakestr) - (shakestr * 0.5)));
Game.mc.y = (Game.mc.y + ((Math.random() * shakestr) - (shakestr * 0.5)));
if (Game.mc.y < Game.startpos){
Game.mc.y = Game.startpos;
};
shakestr = (shakestr * 0.99);
d = (0 - Game.mc.x);
Game.mc.x = (Game.mc.x + (d * 0.1));
} else {
d = (0 - Game.mc.x);
Game.mc.x = (Game.mc.x + (d * 0.1));
if (Math.abs(d) < 3){
Game.mc.x = 0;
camshake = false;
};
};
}
private function focusCheck():void{
if (mc != null){
if (Game.timeline.stage.focus != mc){
try {
Game.timeline.stage.focus = mc;
} catch(e:ArgumentError) {
};
};
};
}
public function updateHeatShield():void{
var _local1:Number;
if (yspeed >= 50){
hitsp.x = (hitsp.x + ((Math.random() - 0.5) * 5));
hs.x = (hitsp.x + ((Math.random() - 0.5) * 5));
hs.y = ((hitsp.y + (halfh / 2)) + ((Math.random() - 0.5) * 3));
hs.width = (hitsp.width * 1.6);
hs.height = (hitsp.height * 0.7);
d = (yspeed / maxy);
_local1 = ((d * 0.8) + (((Math.random() - 0.15) * 0.3) - 0.15));
hs.alpha = (hs.alpha + ((_local1 - hs.alpha) * 0.3));
heatParty();
if (!heatison){
SoundMan.sfire.play(0, 0, SoundMan.sfxtf);
SoundMan.heatvol = 0;
SoundMan.htf.volume = 0;
SoundMan.heatchan.soundTransform = SoundMan.htf;
SoundMan.heatchan = SoundMan.fireloop.play(0, 9999, SoundMan.htf);
SoundMan.heatfade = true;
heatison = true;
};
} else {
hs.alpha = Math.max((hs.alpha - (2 * Tick.ftime)), 0);
SoundMan.heatfade = false;
heatison = false;
};
}
public function keyup(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.SPACE){
keyok = true;
};
if (_arg1.keyCode == 80){
if (Game.gstate == "play"){
SoundMan.pops.play(0, 0, SoundMan.sfxtf);
Game.pauseAll();
} else {
if (Game.gstate == "paused"){
SoundMan.pops.play(0, 0, SoundMan.sfxtf);
Game.unPauseAll();
};
};
};
}
private function eadown(_arg1:MouseEvent):void{
if (cred == null){
cred = new credits();
cred.x = 0x0200;
cred.y = 600;
Game.timeline.addChild(cred);
};
Game.hud.gover.visible = false;
gstate = "showCred";
}
private function makestars(_arg1:int):void{
var _local2:int;
var _local3:int;
_local2 = 0;
while (_local2 < 16) {
tp.x = ((Math.random() - 0.5) * 200);
tp.y = ((Math.random() * _arg1) * 500);
_local3 = ((Math.random() * 32) + 2);
ao = {delay:0, times:[0, 1], values:[1, 0], lifetime:33, interval:33, loop:false};
pd = {speed:tp, loc:new Point(hitsp.x, hitsp.y), trails:false, startw:_local3, starth:_local3, rot:rot, itype:"fuzz", bm:"add", colormode:"fixed", scol:0, ecol:null, alerp:ao, xlerp:null, ylerp:null, loop:false, motype:"grav", resettype:"none"};
Particle.getP(pd, Game.mc);
_local2++;
};
}
private function dmt_advance(_arg1:MouseEvent):void{
if (dmt.currentFrame < 3){
dmt.gotoAndStop((dmt.currentFrame + 1));
} else {
grav = 2;
maxy = 60;
antigrav = false;
mc.rotation = 0;
dmt.removeEventListener(MouseEvent.MOUSE_DOWN, dmt_advance);
Game.mc.removeChild(dmt);
hs.glowball.visible = true;
gstate = "reentry";
Points.setHeight(besthi);
};
}
private function updateShock():void{
if (mc.shock.visible){
emax = (emax - Tick.ftime);
mc.shock.alpha = (Math.random() * emax);
if (emax < 0){
mc.shock.visible = false;
};
};
}
public function unPauseMe():void{
gstate = oldstate;
}
private function updateDialog():void{
}
private function finalBoom():void{
var _local1:int;
Game.bigcliff.y = (Game.bigcliff.y + 6);
shake(10, 1);
tp.x = ((Math.random() * 150) + 350);
tp.y = (((Math.random() * 32) + Game.ground.y) - 100);
tspeed.x = 0;
tspeed.y = ((-(Math.random()) * 20) + 30);
_local1 = ((Math.random() * 20) + 44);
ao = {delay:0, times:[0, 0.5, 1], values:[0, 1, 0], lifetime:20, interval:33, loop:false};
pd = {speed:tspeed, loc:tp, trails:false, startw:_local1, starth:_local1, itype:"bigfuzz", bm:"add", colormode:"fixed", scol:0, ecol:null, alerp:ao, xlerp:null, ylerp:null, loop:false, motype:"wave", resettype:"none"};
Particle.getP(pd, Game.mc);
if (Game.bigcliff.y > (Game.levHeight + 500)){
Game.mc.x = 0;
Game.mc.y = Game.startpos;
if (floobygot){
gstate = "floobywin";
} else {
ea = new endArrow();
ea.x = 430;
ea.y = (Game.levHeight - 110);
ea.addEventListener(MouseEvent.MOUSE_DOWN, eadown);
ea.buttonMode = true;
Game.mc.addChild(ea);
gstate = "gameover";
};
};
}
public function keydown(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.SPACE){
if (keyok){
if (hitsp.hitTestPoint(Game.timeline.mouseX, Game.timeline.mouseY, false)){
mpress();
keyok = false;
};
};
};
}
public function boost():void{
yspeed = -50;
hitsp.width = (hitsp.width * 0.6);
hitsp.height = (hitsp.height * 1.4);
boosting = true;
boostClock = 2;
}
private function makeDangles():void{
var _local1:int;
var _local2:int;
var _local3:Point;
var _local4:Object;
dsp = new Sprite();
dsp.x = hitsp.x;
dsp.y = hitsp.y;
Game.mc.addChild(dsp);
dsp.mouseEnabled = false;
dsp.mouseChildren = false;
droot = mc.droot;
dtip = new tipsp();
dtip.x = 0;
dtip.y = 0;
dtip.blendMode = "add";
dsp.addChild(dtip);
_local1 = 8;
dangles[0] = {pos:new Point(0, 0), acc:1, stiff:1, damp:0, xs:0, ys:0};
_local2 = 1;
while (_local2 < _local1) {
_local3 = new Point(0, 0);
_local4 = {};
_local4.pos = _local3;
_local4.targ = dangles[(_local2 - 1)];
_local4.acc = (((_local2 + 1) / (_local1 + 1)) * 0.2);
_local4.stiff = (((_local2 + 1) / (_local1 + 1)) * 0.7);
_local4.damp = (0.6 + (((_local2 + 1) / (_local1 + 1)) * 0.29));
_local4.xs = 0;
_local4.ys = 0;
dangles.push(_local4);
_local2++;
};
}
private function doImpact(){
absorbDelay = (absorbDelay * 0.3);
hitsp.height = (hitsp.height - (absorbDelay * squash));
hitsp.width = (hitsp.width + (absorbDelay * squash));
hitsp.y = (hitsp.y + (absorbDelay * 0.3));
halfw = (hitsp.width / 2);
halfh = (hitsp.height / 2);
if (absorbDelay <= 1){
yspeed = -(impact);
hit = false;
};
}
public function noGrav():void{
antigrav = true;
maxy = 15;
clicky = 20;
grav = 0.5;
SoundMan.gravzone.play(0, 0, SoundMan.sfxtf);
}
private function checkLeaves():void{
var _local1:Point;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:Number;
var _local6:Point;
leafclock = (leafclock - Tick.ftime);
if ((((curhi < 900)) && ((((yspeed > 5)) || ((yspeed < -5)))))){
for each (_local1 in Game.leafspots) {
_local1 = Game.tree.localToGlobal(_local1);
_local1 = Game.mc.globalToLocal(_local1);
dx = (_local1.x - hitsp.x);
dy = (_local1.y - hitsp.y);
d = ((dx * dx) + (dy * dy));
if ((((d < 5000)) && ((leafclock < 0)))){
SoundMan.brush.play(0, 0, SoundMan.sfxtf);
_local2 = 0;
while (_local2 < 5) {
_local3 = ((Math.random() * 20) + 8);
_local4 = (hitsp.x + ((Math.random() - 0.5) * halfw));
_local5 = (((Math.random() * 8) * 0.1) + 0.1);
_local6 = Helper.getRandomDir(60);
ao = {delay:0, times:[0, 1], values:[1, 0], lifetime:32, interval:33, loop:false};
pd = {speed:_local6, startw:_local3, starth:_local3, loc:_local1, trails:false, itype:"leaf", bm:"normal", colormode:"fixed", scol:0, ecol:0, alerp:ao, xlerp:null, ylerp:null, loop:false, motype:"rgrav", gstr:_local5, scmode:1, resettype:"none"};
Particle.getP(pd, Game.mc);
_local2++;
};
leafclock = 2;
break;
};
};
};
}
public function changeSize(_arg1:int){
targW = (targW + _arg1);
if (targW > 128){
targW = 128;
};
if (targW < 16){
if (gstate != "reentry"){
mc.gotoAndStop(1);
gameOver();
Points.setHeight(besthi);
return;
};
targW = (targW - _arg1);
};
targH = targW;
hs.width = (hitsp.width * 1.6);
hs.height = (hitsp.height * 0.7);
oldh = targH;
squash = (((targW / 128) * 128) * 0.02);
}
public function resetGame():void{
if (Game.playmode == "fall"){
start_y = -1500;
} else {
start_y = (Game.levHeight - 250);
};
if (floob != null){
if (dtip.contains(floob)){
dtip.removeChild(floob);
};
};
if (cred != null){
if (Game.timeline.contains(cred)){
Game.timeline.removeChild(cred);
};
cred = null;
};
if (ea != null){
if (Game.mc.contains(ea)){
Game.mc.removeChild(ea);
};
ea = null;
};
SoundMan.heatvol = 0;
SoundMan.htf.volume = 0;
SoundMan.heatchan.soundTransform = SoundMan.htf;
mc.shock.visible = false;
mc.rotation = 0;
Game.mc.y = Game.startpos;
mc.x = 0x0100;
mc.y = start_y;
mc.width = 80;
mc.height = 80;
hitsp.x = 0x0100;
hitsp.y = start_y;
hitsp.width = 80;
hitsp.height = 80;
dmtshow = false;
halfw = 40;
halfh = 40;
curhi = 0;
roundhi = 0;
clicky = 20;
hit = false;
camshake = false;
antigrav = false;
maxy = 50;
grav = 1;
clicky = 20;
mc.gotoAndStop(1);
xspeed = 0;
yspeed = 0;
targW = 128;
targH = 128;
oldh = 128;
speedw = 0;
speedh = 0;
absorbDelay = 0;
impact = 0;
squash = (((targW / 128) * 128) * 0.02);
freq = ((Math.random() * 0.05) + 0.05);
amp = (0.5 + (Math.random() * 3));
Game.sky.y = -1656;
makeFlag();
gstate = "norm";
}
public function gameOver():void{
antigrav = false;
SoundMan.heatfade = false;
heatison = false;
hs.alpha = 0;
Game.gameOver();
Game.mc.removeChild(mc);
Game.mc.removeChild(hitsp);
Game.mc.removeChild(dsp);
Game.mc.removeChild(hs);
hs.alpha = 0;
gstate = "gameover";
makeBigBoom();
}
public function setGrav():void{
antigrav = false;
maxy = 50;
clicky = 20;
grav = 1;
SoundMan.gravzone.play(0, 0, SoundMan.sfxtf);
}
function mpress(_arg1:MouseEvent=null){
var _local2:Number;
if ((((gstate == "norm")) || ((gstate == "balloon")))){
SoundMan.bounce1.play(0, 0, SoundMan.sfxtf);
_local2 = (-((hitsp.y - Game.mc.mouseY)) * 0.25);
if (_local2 < 0){
_local2 = 0;
};
yspeed = -((clicky + _local2));
xspeed = ((hitsp.x - Game.timeline.mouseX) * 0.5);
hitsp.width = (hitsp.width * 0.7);
hitsp.height = (hitsp.height * 1.3);
hit = false;
changeSize(-5);
gooloss = true;
Points.setHeight(besthi);
};
}
public function makeFloobyChain():void{
floob = new fsmall();
dtip.addChild(floob);
dtip.blendMode = "normal";
floobygot = true;
gstate = "norm";
}
}
}//package
Section 87
//fsmall (fsmall)
package {
import flash.display.*;
public dynamic class fsmall extends Sprite {
}
}//package
Section 88
//fuzz (fuzz)
package {
import flash.display.*;
public dynamic class fuzz extends Sprite {
}
}//package
Section 89
//Game (Game)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import collectables.*;
import mochi.*;
import gameutil.*;
import props.*;
import fx.*;
import flash.utils.*;
import flash.net.*;
import flash.ui.*;
public class Game extends Sprite {
public static var pdelay = 0;
public static var leafspots = [];
public static var s1;
public static var s2;
public static var sky:Sprite;
public static var mochiok:Boolean = true;
public static var tilespace:Number;
public static var gobj:Game;
public static var rp;
public static var timeline:MovieClip;
public static var gotarg;
public static var vspace;
public static var startx;
public static var pov;
private static var myContextMenu:ContextMenu;
public static var d;
public static var currentdomain;
public static var db;
private static var tp:Point;
public static var lp;
public static var ground;
public static var gstate:String = "waiting";
public static var LBmc;
public static var hudTimer:Timer;
public static var scoreboardShowing = false;
public static var mc:Sprite;
public static var darkM:DarkMatter;
public static var s1submitted = false;
public static var tree;
public static var levHeight:int;
public static var startpos;
public static var starSprite;
public static var sodat;
public static var s2submitted = false;
public static var oldstate;
private static var showfps:Boolean = false;
public static var vtiles;
public static var flub:FPlayer;
public static var playmode = "rise";
public static var bigcliff;
public static var flubfx:Sprite;
public static var gridw;
public static var poslist:Array = [];
public static var hud:MovieClip;
public static var flooby:FloobyAnim;
public function Game(_arg1:MovieClip){
tp = new Point();
timeline = _arg1;
timeline.stage.scaleMode = StageScaleMode.NO_SCALE;
timeline.showDefaultContextMenu = false;
timeline.stage.stageFocusRect = false;
mc = new Sprite();
gobj = this;
makeMenu();
checkDomain();
Points.init();
sodat = Shoman.loadSO();
}
public static function back2menu():void{
poslist = [];
gstate = "resetting";
timeline.removeEventListener(KeyboardEvent.KEY_DOWN, flub.keydown);
timeline.removeEventListener(KeyboardEvent.KEY_DOWN, flub.keyup);
hud.gover.menu_btn.removeEventListener(MouseEvent.MOUSE_UP, hud.gomenu);
hud.gover.sub_btn.removeEventListener(MouseEvent.MOUSE_UP, hud.subscore);
hud.mute_btn.removeEventListener(MouseEvent.MOUSE_UP, SoundMan.muteSfx);
hud.musicMute.removeEventListener(MouseEvent.MOUSE_UP, SoundMan.muteMusic);
timeline.removeChild(hud);
killall();
gobj.removeEventListener(Event.ENTER_FRAME, gameLoop);
mc = new Sprite();
timeline.gotoAndStop("menu");
}
public static function mochiscore():void{
var lbclose:Function;
if (flub.ea != null){
flub.ea.visible = false;
};
scoreboardShowing = true;
if (mochiok){
lbclose = function ():void{
if (flub.ea != null){
flub.ea.visible = true;
};
scoreboardShowing = false;
};
if (LBmc == null){
LBmc = new MovieClip();
timeline.addChild(LBmc);
} else {
if (!timeline.contains(LBmc)){
timeline.addChild(LBmc);
} else {
timeline.setChildIndex(LBmc, (timeline.numChildren - 1));
};
};
if (playmode != "fall"){
if (((!((Points.pname == "Player"))) && (!((Points.pname == "Guest"))))){
MochiScores.showLeaderboard({clip:LBmc, boardID:"ecf55237da56bac3", score:Points.bestHeight, name:Points.pname, onClose:lbclose});
} else {
MochiScores.showLeaderboard({clip:LBmc, boardID:"ecf55237da56bac3", score:Points.bestHeight, onClose:lbclose});
};
} else {
if (((!((Points.pname == "Player"))) && (!((Points.pname == "Guest"))))){
MochiScores.showLeaderboard({clip:LBmc, boardID:"bb1ee0c385f19d4b", score:Points.blocksBusted, name:Points.pname, onClose:lbclose});
} else {
MochiScores.showLeaderboard({clip:LBmc, boardID:"bb1ee0c385f19d4b", score:Points.blocksBusted, onClose:lbclose});
};
};
} else {
hud.gover.winbox.gotoAndStop(2);
};
}
private static function ffgClick(_arg1:ContextMenuEvent):void{
navigateToURL(new URLRequest("http://www.funfacegames.com?flubber_rcm"), "_blank");
}
public static function buildRandomLevel():void{
var _local1:int;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:Number;
var _local6:Boolean;
var _local7:int;
var _local8:Sprite;
var _local9:Sprite;
var _local10:Sprite;
var _local11:int;
var _local12:Sprite;
var _local13:Cloud;
var _local14:*;
var _local15:Sprite;
var _local16:FlubAdd;
levHeight = 70000;
gridw = 430;
tilespace = 143.3;
startx = 41;
vspace = 82;
vtiles = int((levHeight / vspace));
_local6 = false;
_local7 = 1;
sky = new bgsky();
sky.y = -1656;
timeline.addChild(sky);
_local8 = new text1();
_local8.x = 0x0100;
_local8.y = 8000;
_local8.cacheAsBitmap = true;
mc.addChild(_local8);
_local9 = new text2();
_local9.x = 0x0100;
_local9.y = 3500;
_local9.cacheAsBitmap = true;
mc.addChild(_local9);
_local10 = new text3();
_local10.x = 0x0100;
_local10.y = 600;
_local10.cacheAsBitmap = true;
mc.addChild(_local10);
darkM = new DarkMatter(0x0100, 300);
_local11 = ((levHeight * 0.7) - 6000);
starSprite = new Sprite();
_local3 = 0;
while (_local3 < 0x0100) {
_local1 = int((Math.random() * 0x0200));
_local2 = (Math.random() * _local11);
_local15 = new spark();
_local15.x = _local1;
_local15.y = _local2;
_local15.width = ((Math.random() * 7) + 1);
_local15.alpha = Math.max(((_local11 - _local15.y) * 0.0001), 0.2);
mc.addChild(_local15);
_local3++;
};
mc.addChild(starSprite);
_local12 = new moon();
_local12.x = 0;
_local12.y = 30000;
mc.addChild(_local12);
new TopBlock((_local12.x + 207), (_local12.y + 355), 0x0100);
new Cloud(_local12.x, _local12.y);
_local3 = 0;
while (_local3 < 19) {
_local1 = (0x0100 + ((Math.random() - 0.5) * (0x0200 * 6)));
_local2 = (20000 + (Math.random() * (levHeight * 0.65)));
_local13 = new Cloud(_local1, _local2);
_local3++;
};
new FlubAdd(123, (vspace * (vtiles - 30)));
poslist.push([123, (vspace * (vtiles - 30))]);
new FlubAdd(287, (vspace * (vtiles - 50)));
poslist.push([287, (vspace * (vtiles - 50))]);
new FlubAdd(369, (vspace * (vtiles - 70)));
poslist.push([369, (vspace * (vtiles - 70))]);
new FlubAdd(451, (vspace * (vtiles - 90)));
poslist.push([451, (vspace * (vtiles - 90))]);
new FlubAdd(287, (vspace * (vtiles - 110)));
poslist.push([287, (vspace * (vtiles - 110))]);
new Boost(0x0100, (levHeight - 1800));
_local3 = 0;
while (_local3 < 75) {
_local5 = int((Math.random() * 4));
_local1 = ((_local5 * tilespace) + startx);
_local2 = (vspace * int((Math.random() * (vtiles - 20))));
if (!searchpos([_local1, _local2])){
poslist.push([_local1, _local2]);
new bigBlock(_local1, _local2);
} else {
_local6 = false;
_local7 = 1;
while (_local6 == false) {
_local7++;
_local2 = (_local2 - vspace);
if (!searchpos([_local1, _local2])){
poslist.push([_local1, _local2]);
new bigBlock(_local1, _local2, true);
_local6 = true;
};
if (_local7 > 10){
break;
};
};
};
_local3++;
};
for each (_local14 in Platform.plist) {
mc.setChildIndex(_local14.sp, (mc.numChildren - 1));
};
bigcliff = new cliff();
bigcliff.y = (levHeight - 48);
mc.addChild(bigcliff);
new TopBlock((bigcliff.x + 402), (bigcliff.y - 242), 90);
new TopBlock((bigcliff.x + 465), (bigcliff.y - 560), 160);
tree = new treetrunk();
tree.x = 110;
tree.y = levHeight;
tree.cacheAsBitmap = true;
mc.addChild(tree);
leafspots = [new Point(tree.s1.x, tree.s1.y), new Point(tree.s2.x, tree.s2.y), new Point(tree.s3.x, tree.s3.y), new Point(tree.s4.x, tree.s4.y), new Point(tree.s5.x, tree.s5.y), new Point(tree.s6.x, tree.s6.y), new Point(tree.s7.x, tree.s7.y), new Point(tree.s8.x, tree.s8.y), new Point(tree.s9.x, tree.s9.y), new Point(tree.s10.x, tree.s10.y), new Point(tree.s11.x, tree.s11.y)];
ground = new groundPlatform();
ground.x = 300;
ground.y = (levHeight - ((ground.height / 2) * 0.9));
mc.addChild(ground);
ground.cacheAsBitmap = true;
_local4 = 10;
_local3 = 0;
while (_local3 < _local4) {
_local5 = int((Math.random() * 4));
_local1 = ((_local5 * tilespace) + startx);
_local2 = (int(((_local3 + 1) * (vtiles / (_local4 + 1)))) * vspace);
if (!searchpos([_local1, _local2])){
poslist.push([_local1, _local2]);
new Boost(_local1, _local2);
} else {
_local6 = false;
_local7 = 1;
while (_local6 == false) {
_local7++;
_local2 = (_local2 - vspace);
if (!searchpos([_local1, _local2])){
poslist.push([_local1, _local2]);
new Boost(_local1, _local2);
_local6 = true;
};
if (_local7 > 10){
break;
};
};
};
_local3++;
};
flubfx = new Sprite();
mc.addChild(flubfx);
_local4 = 22;
_local3 = 0;
while (_local3 < _local4) {
_local5 = int((Math.random() * 4));
_local1 = ((_local5 * tilespace) + startx);
_local2 = (int(((_local3 - 2) * (vtiles / (_local4 + 1)))) * vspace);
if (!searchpos([_local1, _local2])){
poslist.push([_local1, _local2]);
new FlubAdd(_local1, _local2);
} else {
_local6 = false;
_local7 = 1;
while (_local6 == false) {
_local7++;
_local2 = (_local2 - vspace);
if (!searchpos([_local1, _local2])){
poslist.push([_local1, _local2]);
new FlubAdd(_local1, _local2);
_local6 = true;
};
if (_local7 > 10){
break;
};
};
};
for each (_local16 in FlubAdd.flist) {
mc.setChildIndex(_local16.sp, (mc.numChildren - 1));
};
_local3++;
};
_local4 = 5;
_local3 = 0;
while (_local3 < _local4) {
_local5 = int((Math.random() * 4));
_local1 = ((_local5 * tilespace) + startx);
_local2 = (int(((_local3 + 1) * (vtiles / (_local4 + 1)))) * vspace);
if (!searchpos([_local1, _local2])){
poslist.push([_local1, _local2]);
new Balloon(_local1, _local2);
} else {
_local6 = false;
_local7 = 1;
while (_local6 == false) {
_local7++;
_local2 = (_local2 - vspace);
if (!searchpos([_local1, _local2])){
poslist.push([_local1, _local2]);
new Balloon(_local1, _local2);
_local6 = true;
};
if (_local7 > 10){
break;
};
};
};
_local3++;
};
s1 = new sign1();
s1.x = 0x0100;
s1.y = (levHeight - 330);
s1.cacheAsBitmap = true;
mc.addChild(s1);
new FlubAdd(128, (levHeight - 1400));
s2 = new sign2();
s2.x = 128;
s2.y = (levHeight - 1560);
s2.cacheAsBitmap = true;
mc.addChild(s2);
flooby = new FloobyAnim((_local12.x + 209), (_local12.y + 327));
db = new dialogBox();
db.x = (_local12.x + 221);
db.y = (_local12.y + 264);
mc.addChild(db);
db.addEventListener(MouseEvent.MOUSE_DOWN, dbadvance);
db.buttonMode = true;
mc.y = (mc.y - (levHeight - 600));
startpos = mc.y;
}
private static function checkPaddles():void{
d = ((522 - rp.x) * 0.1);
rp.x = (rp.x + d);
d = ((-10 - lp.x) * 0.1);
lp.x = (lp.x + d);
}
public static function abot_close(_arg1:MouseEvent):void{
hud.gover.winbox.submit_btn.removeEventListener(MouseEvent.MOUSE_UP, abot_sendHeight);
if (flub.ea != null){
flub.ea.visible = true;
};
scoreboardShowing = false;
}
private static function dbadvance(_arg1:MouseEvent):void{
if (db.currentFrame < 3){
db.gotoAndStop((db.currentFrame + 1));
} else {
flooby.gstate = "transfer";
db.removeEventListener(MouseEvent.MOUSE_DOWN, dbadvance);
mc.removeChild(db);
};
}
public static function leftPaddle(_arg1:int):void{
if (pdelay > 0.5){
SoundMan.springy.play(0, 0, SoundMan.sfxtf);
tp.x = 0;
tp.y = _arg1;
tp = mc.localToGlobal(tp);
lp.y = tp.y;
lp.x = 0;
lp.paddle.play();
pdelay = 0;
};
}
public static function go2abot_scores(_arg1:MouseEvent):void{
if (playmode == "rise"){
navigateToURL(new URLRequest("http://rankz.armorbot.com/flubber_rise"), "_blank");
} else {
navigateToURL(new URLRequest("http://rankz.armorbot.com/flubber_rise_reentry"), "_blank");
};
}
private static function showGOscreen():void{
if (hud.gover.y != gotarg){
d = (gotarg - hud.gover.y);
hud.gover.y = (hud.gover.y + (d * 0.1));
};
}
public static function makeMenu(){
var _local1:ContextMenuItem;
var _local2:ContextMenuItem;
myContextMenu = new ContextMenu();
myContextMenu.hideBuiltInItems();
myContextMenu.builtInItems.quality = true;
_local1 = new ContextMenuItem("Funface Games");
_local2 = new ContextMenuItem("Play More Games");
_local1.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, Game.ffgClick);
_local2.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, Game.armorClick);
myContextMenu.customItems.push(_local1, _local2);
timeline.contextMenu = myContextMenu;
}
public static function startGame():void{
var _local1:Sprite;
Points.resetGame();
if (playmode == "fall"){
Points.nothurt = false;
} else {
Points.nothurt = true;
};
s1submitted = false;
s2submitted = false;
timeline.stage.frameRate = 40;
buildRandomLevel();
timeline.addChild(mc);
flub = new FPlayer();
_local1 = new lowG();
_local1.x = 0x0100;
_local1.y = 10000;
mc.addChild(_local1);
hud = new hudbox();
hud.fps_txt.visible = false;
hud.btxt.best_txt.text = (0 + " m");
hud.htxt.height_txt.text = (0 + " m");
gotarg = -420;
timeline.addChild(hud);
hud.gover.visible = false;
lp = new left_paddle();
lp.x = -10;
timeline.addChild(lp);
rp = new right_paddle();
rp.x = 522;
timeline.addChild(rp);
mc.setChildIndex(flooby.sp, (mc.numChildren - 1));
gobj.addEventListener(Event.ENTER_FRAME, gameLoop);
gstate = "play";
}
private static function updateHud(_arg1:Event):void{
if (showfps){
hud.fps_txt.visible = true;
hud.fps_txt.text = (Tick.fps_txt + " fps");
} else {
hud.fps_txt.visible = false;
};
}
private static function armorClick(_arg1:ContextMenuEvent):void{
navigateToURL(new URLRequest("http://armorgames.com?gamereferral=FlubberRise"), "_blank");
}
public static function unPauseAll():void{
gstate = oldstate;
flub.unPauseMe();
darkM.unPauseMe();
flooby.unPauseMe();
Platform.unPauseAll();
Boost.unPauseAll();
Balloon.unPauseAll();
FlubAdd.unPauseAll();
Spike.unPauseAll();
Cloud.unPauseAll();
pov.removeEventListener(MouseEvent.MOUSE_DOWN, pauseOff);
pov.pause_ag_hit.removeEventListener(MouseEvent.MOUSE_UP, pauselink);
timeline.removeChild(pov);
}
public static function killall():void{
Particle.killAll();
while (starSprite.numChildren > 0) {
starSprite.removeChildAt(0);
};
mc.removeChild(starSprite);
timeline.removeChild(sky);
Cloud.killAll();
Platform.killAll();
Boost.killAll();
FlubAdd.killAll();
Balloon.killAll();
Spike.killAll();
timeline.removeChild(lp);
timeline.removeChild(rp);
while (mc.numChildren > 0) {
mc.removeChildAt(0);
};
timeline.removeChild(mc);
}
private static function pauseOff(_arg1:MouseEvent):void{
if (_arg1.currentTarget.name == "pov"){
unPauseAll();
};
}
public static function rightPaddle(_arg1:int):void{
if (pdelay > 0.5){
SoundMan.springy.play(0, 0, SoundMan.sfxtf);
tp.x = 0;
tp.y = _arg1;
tp = mc.localToGlobal(tp);
rp.y = tp.y;
rp.x = 0x0200;
rp.paddle.play();
pdelay = 0;
};
}
public static function dataOnLoad(_arg1:Event):void{
}
public static function searchpos(_arg1:Array):Boolean{
var _local2:Array;
for each (_local2 in poslist) {
if ((((_local2[1] == _arg1[1])) && ((_local2[2] == _arg1[2])))){
return (true);
};
};
return (false);
}
public static function gameLoop(_arg1:Event):void{
Tick.getFtime();
switch (gstate){
case "play":
pdelay = (pdelay + Tick.ftime);
flub.update();
Cloud.updateAll();
Platform.updateAll();
Particle.updateAll();
Boost.updateAll();
FlubAdd.updateAll();
Balloon.updateAll();
Spike.updateAll();
showGOscreen();
checkPaddles();
flooby.update();
darkM.update();
break;
case "gameover":
Cloud.updateAll();
Particle.updateAll();
Balloon.updateAll();
flub.update();
showGOscreen();
checkPaddles();
};
}
public static function pauseAll():void{
oldstate = gstate;
gstate = "paused";
flub.pauseMe();
darkM.pauseMe();
flooby.pauseMe();
Platform.pauseAll();
Boost.pauseAll();
Balloon.pauseAll();
FlubAdd.pauseAll();
Spike.pauseAll();
Cloud.pauseAll();
pov = new pauseOverlay();
pov.mouseChildren = true;
pov.name = "pov";
pov.x = 0x0100;
pov.y = 300;
pov.addEventListener(MouseEvent.MOUSE_UP, pauseOff);
timeline.addChild(pov);
pov.pause_ag_hit.buttonMode = true;
pov.pause_ag_hit.addEventListener(MouseEvent.MOUSE_UP, pauselink);
}
public static function resetGame():void{
var _local1:Sprite;
Points.resetGame();
if (playmode == "fall"){
Points.nothurt = false;
} else {
Points.nothurt = true;
};
gstate = "resetting";
s1submitted = false;
s2submitted = false;
hud.gover.winbox.gotoAndStop(1);
poslist = [];
gotarg = -420;
killall();
mc = new Sprite();
buildRandomLevel();
timeline.addChild(mc);
lp = new left_paddle();
lp.x = -10;
timeline.addChild(lp);
rp = new right_paddle();
rp.x = 522;
timeline.addChild(rp);
Game.mc.addChild(flub.mc);
Game.mc.addChild(flub.hitsp);
Game.mc.addChild(flub.dsp);
Game.mc.addChild(flub.hs);
_local1 = new lowG();
_local1.x = 0x0100;
_local1.y = 10000;
mc.addChild(_local1);
_local1.mouseEnabled = false;
_local1.mouseChildren = false;
timeline.setChildIndex(hud, (timeline.numChildren - 1));
if (FlubAdd.flist.length < 10){
};
flub.resetGame();
mc.setChildIndex(flooby.sp, (mc.numChildren - 1));
hud.gover.gotoAndStop(1);
gstate = "play";
}
public static function gameOver():void{
var _local1:String;
gstate = "gameover";
_local1 = (((("you reached:\n" + flub.roundhi) + " m\nand busted \n") + Points.blocksBusted) + "/75 blocks!");
hud.gover.winbox.htxt.text = _local1;
hud.gover.winbox.hshadow.text = _local1;
hud.gover.visible = true;
gotarg = 150;
}
public static function abot_sendHeight(_arg1:MouseEvent):void{
var _local2:URLRequest;
var _local3:URLVariables;
var _local4:Number;
var _local5:String;
var _local6:URLLoader;
if (!s1submitted){
if ((((hud.gover.winbox.abot_name.text == "")) || ((hud.gover.winbox.abot_name.text == "enter your name")))){
hud.gover.winbox.abot_name.text = "enter your name";
return;
};
Shoman.writeName(hud.gover.winbox.abot_name.text);
_local2 = new URLRequest("http://rankz.armorbot.com/submit/as3_v0.php");
_local2.method = URLRequestMethod.POST;
_local3 = new URLVariables();
_local3.flashkey = "cmhqRmtoeWg=";
_local3.SU0249 = "MzEwMWolZSVhJW4lcw==";
_local3.bmFtZTE = Shoman.myso.data.myname;
_local4 = Points.bestHeight;
_local5 = (_local4 + "Z");
_local3.c2NvcmUx = _local5.split("0").join("U");
_local3.c2NvcmUx = _local3.c2NvcmUx.split("").join("A");
_local3.c2NvcmUx = _local3.c2NvcmUx.split("AU").join("Y");
_local3.c2NvcmUx = _local3.c2NvcmUx.split("A1").join("B");
_local3.c2NvcmUx = _local3.c2NvcmUx.split(".").join("N");
_local2.data = _local3;
_local6 = new URLLoader();
_local6.dataFormat = URLLoaderDataFormat.TEXT;
_local6.addEventListener(Event.COMPLETE, dataOnLoad);
_local6.load(_local2);
hud.gover.winbox.abot_submit.removeEventListener(MouseEvent.MOUSE_UP, abot_sendHeight);
hud.gover.winbox.gotoAndStop(3);
s1submitted = true;
};
}
public static function abot_sendSmashes(_arg1:MouseEvent):void{
var _local2:URLRequest;
var _local3:URLVariables;
var _local4:Number;
var _local5:String;
var _local6:URLLoader;
if (!s2submitted){
if ((((hud.gover.winbox.abot_name.text == "")) || ((hud.gover.winbox.abot_name.text == "enter your name")))){
hud.gover.winbox.abot_name.text = "enter your name";
return;
};
Shoman.writeName(hud.gover.winbox.abot_name.text);
_local2 = new URLRequest("http://rankz.armorbot.com/submit/as3_v0.php");
_local2.method = URLRequestMethod.POST;
_local3 = new URLVariables();
_local3.flashkey = "a0d6aklJVFo=";
_local3.SU0249 = "MzEwMmolZSVhJW4lcw==";
_local3.bmFtZTE = Shoman.myso.data.myname;
_local4 = Points.blocksBusted;
_local5 = (_local4 + "Z");
_local3.c2NvcmUx = _local5.split("0").join("U");
_local3.c2NvcmUx = _local3.c2NvcmUx.split("").join("A");
_local3.c2NvcmUx = _local3.c2NvcmUx.split("AU").join("Y");
_local3.c2NvcmUx = _local3.c2NvcmUx.split("A1").join("B");
_local3.c2NvcmUx = _local3.c2NvcmUx.split(".").join("N");
_local2.data = _local3;
_local6 = new URLLoader();
_local6.dataFormat = URLLoaderDataFormat.TEXT;
_local6.addEventListener(Event.COMPLETE, dataOnLoad);
_local6.load(_local2);
hud.gover.winbox.abot_submit.removeEventListener(MouseEvent.MOUSE_UP, abot_sendHeight);
hud.gover.winbox.gotoAndStop(3);
s2submitted = true;
};
}
private static function checkDomain():void{
var _local1:Boolean;
var _local2:Array;
var _local3:String;
var _local4:Array;
_local1 = false;
currentdomain = timeline.loaderInfo.loaderURL;
if (currentdomain.substring(0, 5).indexOf("file:") != -1){
_local1 = true;
mochiok = true;
};
if (!_local1){
_local2 = [];
_local2.push("armorgames.com", "www.armorgames.com");
for each (_local3 in _local2) {
_local4 = currentdomain.substring((currentdomain.indexOf("http://") + 7)).split("/");
if (_local4[0].indexOf(_local3) == -1){
} else {
mochiok = false;
break;
};
};
};
}
public static function pauselink(_arg1:MouseEvent):void{
_arg1.stopPropagation();
navigateToURL(new URLRequest("http://armorgames.com?gamereferral=FlubberRise"), "_blank");
}
}
}//package
Section 90
//goo (goo)
package {
import flash.display.*;
public dynamic class goo extends Sprite {
}
}//package
Section 91
//gravThresh (gravThresh)
package {
import flash.media.*;
public dynamic class gravThresh extends Sound {
}
}//package
Section 92
//groundPlatform (groundPlatform)
package {
import flash.display.*;
public dynamic class groundPlatform extends Sprite {
}
}//package
Section 93
//heat (heat)
package {
import flash.display.*;
public dynamic class heat extends Sprite {
}
}//package
Section 94
//heatscar (heatscar)
package {
import flash.display.*;
public dynamic class heatscar extends Sprite {
}
}//package
Section 95
//heavymsg (heavymsg)
package {
import flash.display.*;
public dynamic class heavymsg extends MovieClip {
public function heavymsg(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
function frame3(){
this.stop();
}
function frame1(){
this.stop();
}
function frame2(){
this.stop();
}
}
}//package
Section 96
//hotness (hotness)
package {
import flash.display.*;
public dynamic class hotness extends Sprite {
}
}//package
Section 97
//hudbox (hudbox)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import gameutil.*;
import flash.media.*;
import flash.system.*;
import flash.text.*;
import flash.utils.*;
import flash.net.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class hudbox extends MovieClip {
public var htxt:MovieClip;
public var fps_txt:TextField;
public var mute_btn:MovieClip;
public var gover:MovieClip;
public var btxt:MovieClip;
public var musicMute:MovieClip;
public function hudbox(){
addFrameScript(0, frame1);
}
public function gomenu(_arg1:MouseEvent):void{
Game.back2menu();
}
public function subscore(_arg1:MouseEvent):void{
Game.mochiscore();
}
function frame1(){
gover.pa_btn.addEventListener(MouseEvent.MOUSE_UP, playagain);
gover.pa_btn.buttonMode = true;
gover.menu_btn.addEventListener(MouseEvent.MOUSE_UP, gomenu);
gover.menu_btn.buttonMode = true;
gover.sub_btn.addEventListener(MouseEvent.MOUSE_UP, subscore);
gover.sub_btn.buttonMode = true;
mute_btn.addEventListener(MouseEvent.MOUSE_UP, SoundMan.muteSfx);
mute_btn.buttonMode = true;
musicMute.addEventListener(MouseEvent.MOUSE_UP, SoundMan.muteMusic);
musicMute.buttonMode = true;
}
public function playagain(_arg1:MouseEvent):void{
Game.resetGame();
}
}
}//package
Section 98
//landfall (landfall)
package {
import flash.media.*;
public dynamic class landfall extends Sound {
}
}//package
Section 99
//lBolt (lBolt)
package {
import flash.display.*;
public dynamic class lBolt extends Sprite {
}
}//package
Section 100
//leaf (leaf)
package {
import flash.display.*;
public dynamic class leaf extends Sprite {
}
}//package
Section 101
//leaves (leaves)
package {
import flash.media.*;
public dynamic class leaves extends Sound {
}
}//package
Section 102
//left_paddle (left_paddle)
package {
import flash.display.*;
public dynamic class left_paddle extends MovieClip {
public var paddle:MovieClip;
}
}//package
Section 103
//lightningsnd (lightningsnd)
package {
import flash.media.*;
public dynamic class lightningsnd extends Sound {
}
}//package
Section 104
//lowG (lowG)
package {
import flash.display.*;
public dynamic class lowG extends Sprite {
}
}//package
Section 105
//mflag (mflag)
package {
import flash.display.*;
public dynamic class mflag extends MovieClip {
}
}//package
Section 106
//MochiAd (MochiAd)
package {
import flash.events.*;
import flash.display.*;
import flash.system.*;
import flash.utils.*;
import flash.net.*;
public class MochiAd {
public static function getVersion():String{
return ("2.7");
}
public static function showClickAwayAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_timeout:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var sendHostProgress:Boolean;
var options = _arg1;
DEFAULTS = {ad_timeout:2000, regpt:"o", method:"showClickAwayAd", res:"300x250", no_bg:true, ad_started:function ():void{
}, ad_finished:function ():void{
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
}, ad_skipped:function ():void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
options.ad_finished();
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
sendHostProgress = false;
mc.regContLC = function (_arg1:String):void{
mc._containerLCName = _arg1;
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Number;
var _local3:Boolean;
var _local4:Number;
if (!this.parent){
delete this.onEnterFrame;
return;
};
_local1 = this.parent._mochiad_ctr;
_local2 = (getTimer() - this.started);
_local3 = false;
if (!chk.showing){
_local4 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local4 > 0){
chk.showing = true;
_local3 = true;
chk.started = getTimer();
} else {
if (_local2 > chk.ad_timeout){
options.ad_failed();
_local3 = true;
};
};
};
if (this.root == null){
_local3 = true;
};
if (_local3){
delete this.onEnterFrame;
};
};
doOnEnterFrame(chk);
}
public static function _isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function _allowDomains(_arg1:String):String{
var _local2:String;
_local2 = _arg1.split("/")[2].split(":")[0];
Security.allowDomain("*");
Security.allowDomain(_local2);
Security.allowInsecureDomain("*");
Security.allowInsecureDomain(_local2);
return (_local2);
}
public static function unload(_arg1:Object):Boolean{
if (((_arg1.clip) && (_arg1.clip._mochiad))){
_arg1 = _arg1.clip;
};
if (_arg1.origFrameRate != undefined){
_arg1.stage.frameRate = _arg1.origFrameRate;
};
if (!_arg1._mochiad){
return (false);
};
if (_arg1._mochiad._containerLCName != undefined){
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "notify", {id:"unload"});
};
if (_arg1._mochiad.onUnload){
_arg1._mochiad.onUnload();
};
delete _arg1._mochiad_loaded;
delete _arg1._mochiad;
return (true);
}
public static function showInterLevelAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
}, ad_skipped:function ():void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
options.ad_finished();
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = (_arg1 - 250);
};
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Number;
var _local3:Boolean;
var _local4:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
_local1 = this.parent._mochiad_ctr;
_local2 = (getTimer() - this.started);
_local3 = false;
if (!chk.showing){
_local4 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local4 > 0){
chk.showing = true;
chk.started = getTimer();
MochiAd.adShowing(clip);
} else {
if (_local2 > chk.ad_timeout){
options.ad_failed();
_local3 = true;
};
};
};
if (_local2 > chk.ad_msec){
_local3 = true;
};
if (_local3){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function _parseOptions(_arg1:Object, _arg2:Object):Object{
var _local3:Object;
var _local4:String;
var _local5:Array;
var _local6:Number;
var _local7:Array;
_local3 = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
if (_arg1){
for (_local4 in _arg1) {
_local3[_local4] = _arg1[_local4];
};
};
if (_local3.clip == undefined){
throw (new Error("MochiAd is missing the 'clip' parameter. This should be a MovieClip, Sprite or an instance of a class that extends MovieClip or Sprite."));
};
_arg1 = _local3.clip.loaderInfo.parameters.mochiad_options;
if (_arg1){
_local5 = _arg1.split("&");
_local6 = 0;
while (_local6 < _local5.length) {
_local7 = _local5[_local6].split("=");
_local3[unescape(_local7[0])] = unescape(_local7[1]);
_local6++;
};
};
if (_local3.id == "test"){
};
return (_local3);
}
public static function _cleanup(_arg1:Object):void{
var idx:Number;
var k:String;
var lc:LocalConnection;
var f:Function;
var mc = _arg1;
if (("lc" in mc)){
lc = mc.lc;
f = function ():void{
try {
lc.client = null;
lc.close();
} catch(e:Error) {
};
};
setTimeout(f, 0);
};
idx = DisplayObjectContainer(mc).numChildren;
while (idx > 0) {
idx = (idx - 1);
DisplayObjectContainer(mc).removeChildAt(idx);
};
for (k in mc) {
delete mc[k];
};
}
public static function load(_arg1:Object):MovieClip{
var DEFAULTS:Object;
var clip:Object;
var depth:Number;
var mc:MovieClip;
var wh:Array;
var lv:URLVariables;
var k:String;
var server:String;
var hostname:String;
var lc:LocalConnection;
var name:String;
var loader:Loader;
var g:Function;
var req:URLRequest;
var v:Object;
var options = _arg1;
DEFAULTS = {server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
clip = options.clip;
if (!MochiAd._isNetworkAvailable()){
return (null);
};
try {
if (clip._mochiad_loaded){
return (null);
};
} catch(e:Error) {
throw (new Error("MochiAd requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."));
};
depth = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, "_mochiad", depth);
wh = MochiAd._getRes(options, clip);
options.res = ((wh[0] + "x") + wh[1]);
options.server = (options.server + options.id);
delete options.id;
clip._mochiad_loaded = true;
if (clip.loaderInfo.loaderURL.indexOf("http") == 0){
options.as3_swf = clip.loaderInfo.loaderURL;
};
lv = new URLVariables();
for (k in options) {
v = options[k];
if (!(v is Function)){
lv[k] = v;
};
};
server = lv.server;
delete lv.server;
hostname = _allowDomains(server);
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.lc = lc;
mc.lcName = name;
lv.lc = name;
lv.st = getTimer();
loader = new Loader();
g = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
MochiAd.unload(clip);
};
loader.contentLoaderInfo.addEventListener(Event.UNLOAD, g);
req = new URLRequest(((server + ".swf?cacheBust=") + new Date().getTime()));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader.load(req);
mc.addChild(loader);
mc._mochiad_ctr = loader;
return (mc);
}
public static function runMethod(_arg1:Object, _arg2:String, _arg3:Array):Object{
var _local4:Array;
var _local5:Number;
_local4 = _arg2.split(".");
_local5 = 0;
while (_local5 < (_local4.length - 1)) {
if ((((_arg1[_local4[_local5]] == undefined)) || ((_arg1[_local4[_local5]] == null)))){
return (undefined);
};
_arg1 = _arg1[_local4[_local5]];
_local5++;
};
if (typeof(_arg1[_local4[_local5]]) == "function"){
return (_arg1[_local4[_local5]].apply(_arg1, _arg3));
};
return (undefined);
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number):MovieClip{
var _local4:MovieClip;
_local4 = new MovieClip();
if (((false) && (_arg3))){
_arg1.addChildAt(_local4, _arg3);
} else {
_arg1.addChild(_local4);
};
_arg1[_arg2] = _local4;
_local4["_name"] = _arg2;
return (_local4);
}
public static function _getRes(_arg1:Object, _arg2:Object):Array{
var _local3:Object;
var _local4:Number;
var _local5:Number;
var _local6:Array;
_local3 = _arg2.getBounds(_arg2.root);
_local4 = 0;
_local5 = 0;
if (typeof(_arg1.res) != "undefined"){
_local6 = _arg1.res.split("x");
_local4 = parseFloat(_local6[0]);
_local5 = parseFloat(_local6[1]);
} else {
_local4 = (_local3.xMax - _local3.xMin);
_local5 = (_local3.yMax - _local3.yMin);
};
if ((((_local4 == 0)) || ((_local5 == 0)))){
_local4 = _arg2.stage.stageWidth;
_local5 = _arg2.stage.stageHeight;
};
return ([_local4, _local5]);
}
public static function adShowing(_arg1:Object):void{
_arg1.origFrameRate = _arg1.stage.frameRate;
_arg1.stage.frameRate = 30;
}
public static function getValue(_arg1:Object, _arg2:String):Object{
var _local3:Array;
var _local4:Number;
_local3 = _arg2.split(".");
_local4 = 0;
while (_local4 < (_local3.length - 1)) {
if ((((_arg1[_local3[_local4]] == undefined)) || ((_arg1[_local3[_local4]] == null)))){
return (undefined);
};
_arg1 = _arg1[_local3[_local4]];
_local4++;
};
return (_arg1[_local3[_local4]]);
}
public static function rpc(_arg1:Object, _arg2:Number, _arg3:Object):void{
var _local4:Object;
var _local5:Object;
switch (_arg3.id){
case "setValue":
MochiAd.setValue(_arg1, _arg3.objectName, _arg3.value);
break;
case "getValue":
_local4 = MochiAd.getValue(_arg1, _arg3.objectName);
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "rpcResult", _arg2, _local4);
break;
case "runMethod":
_local5 = MochiAd.runMethod(_arg1, _arg3.method, _arg3.args);
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "rpcResult", _arg2, _local5);
break;
};
}
public static function setValue(_arg1:Object, _arg2:String, _arg3:Object):void{
var _local4:Array;
var _local5:Number;
_local4 = _arg2.split(".");
_local5 = 0;
while (_local5 < (_local4.length - 1)) {
if ((((_arg1[_local4[_local5]] == undefined)) || ((_arg1[_local4[_local5]] == null)))){
return;
};
_arg1 = _arg1[_local4[_local5]];
_local5++;
};
_arg1[_local4[_local5]] = _arg3;
}
public static function showPreGameAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var bar:MovieClip;
var bar_color:Number;
var bar_background:Number;
var bar_outline:Number;
var backing_mc:MovieClip;
var backing:Object;
var inside_mc:MovieClip;
var inside:Object;
var outline_mc:MovieClip;
var outline:Object;
var complete:Boolean;
var unloaded:Boolean;
var f:Function;
var sendHostProgress:Boolean;
var fn:Function;
var r:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:0xFF8A00, background:16777161, outline:13994812, no_progress_bar:false, ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
}, ad_skipped:function ():void{
}, ad_progress:function (_arg1:Number):void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
if ("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def"){
options.ad_started();
fn = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
return;
};
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
var fn:Function;
MochiAd._cleanup(mc);
fn = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.x = (w * -0.5);
chk.y = (h * -0.5);
bar = createEmptyMovieClip(chk, "_mochiad_bar", 4);
if (options.no_progress_bar){
bar.visible = false;
delete options.no_progress_bar;
} else {
bar.x = 10;
bar.y = (h - 20);
};
bar_color = options.color;
delete options.color;
bar_background = options.background;
delete options.background;
bar_outline = options.outline;
delete options.outline;
backing_mc = createEmptyMovieClip(bar, "_outline", 1);
backing = backing_mc.graphics;
backing.beginFill(bar_background);
backing.moveTo(0, 0);
backing.lineTo((w - 20), 0);
backing.lineTo((w - 20), 10);
backing.lineTo(0, 10);
backing.lineTo(0, 0);
backing.endFill();
inside_mc = createEmptyMovieClip(bar, "_inside", 2);
inside = inside_mc.graphics;
inside.beginFill(bar_color);
inside.moveTo(0, 0);
inside.lineTo((w - 20), 0);
inside.lineTo((w - 20), 10);
inside.lineTo(0, 10);
inside.lineTo(0, 0);
inside.endFill();
inside_mc.scaleX = 0;
outline_mc = createEmptyMovieClip(bar, "_outline", 3);
outline = outline_mc.graphics;
outline.lineStyle(0, bar_outline, 100);
outline.moveTo(0, 0);
outline.lineTo((w - 20), 0);
outline.lineTo((w - 20), 10);
outline.lineTo(0, 10);
outline.lineTo(0, 0);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
complete = false;
unloaded = false;
f = function (_arg1:Event):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
complete = true;
if (unloaded){
MochiAd.unload(clip);
};
};
clip.loaderInfo.addEventListener(Event.COMPLETE, f);
if ((clip.root is MovieClip)){
r = (clip.root as MovieClip);
if (r.framesLoaded >= r.totalFrames){
complete = true;
};
};
mc.unloadAd = function ():void{
unloaded = true;
if (complete){
MochiAd.unload(clip);
};
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = _arg1;
};
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
mc.rpcTestFn = function (_arg1:String):Object{
return (_arg1);
};
mc.regContLC = function (_arg1:String):void{
mc._containerLCName = _arg1;
};
sendHostProgress = false;
mc.sendHostLoadProgress = function (_arg1:String):void{
sendHostProgress = true;
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Object;
var _local3:Number;
var _local4:Boolean;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Object;
var _local10:Number;
var _local11:Number;
if (((!(this.parent)) || (!(this.parent.parent)))){
delete this["onEnterFrame"];
return;
};
_local1 = this.parent.parent.root;
_local2 = this.parent._mochiad_ctr;
_local3 = (getTimer() - this.started);
_local4 = false;
_local5 = _local1.loaderInfo.bytesTotal;
_local6 = _local1.loaderInfo.bytesLoaded;
if (complete){
_local6 = Math.max(1, _local6);
_local5 = _local6;
};
_local7 = ((100 * _local6) / _local5);
_local8 = ((100 * _local3) / chk.ad_msec);
_local9 = this._mochiad_bar._inside;
_local10 = Math.min(100, Math.min(((_local7) || (0)), _local8));
_local10 = Math.max(this.last_pcnt, _local10);
this.last_pcnt = _local10;
_local9.scaleX = (_local10 * 0.01);
options.ad_progress(_local10);
if (sendHostProgress){
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"hostLoadPcnt", pcnt:_local7});
if (_local7 == 100){
sendHostProgress = false;
};
};
if (!chk.showing){
_local11 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local11 > 0){
chk.showing = true;
chk.started = getTimer();
MochiAd.adShowing(clip);
} else {
if ((((_local3 > chk.ad_timeout)) && ((_local7 == 100)))){
options.ad_failed();
_local4 = true;
};
};
};
if (_local3 > chk.ad_msec){
_local4 = true;
};
if (((complete) && (_local4))){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function showPreloaderAd(_arg1:Object):void{
MochiAd.showPreGameAd(_arg1);
}
public static function showTimedAd(_arg1:Object):void{
MochiAd.showInterLevelAd(_arg1);
}
public static function doOnEnterFrame(_arg1:MovieClip):void{
var f:Function;
var mc = _arg1;
f = function (_arg1:Object):void{
if (((("onEnterFrame" in mc)) && (mc.onEnterFrame))){
mc.onEnterFrame();
} else {
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
};
mc.addEventListener(Event.ENTER_FRAME, f);
}
}
}//package
Section 107
//MochiBot (MochiBot)
package {
import flash.display.*;
import flash.system.*;
import flash.net.*;
public dynamic class MochiBot extends Sprite {
public static function track(_arg1:Sprite, _arg2:String):MochiBot{
var _local3:MochiBot;
var _local4:String;
var _local5:URLVariables;
var _local6:String;
var _local7:URLRequest;
var _local8:Loader;
if (Security.sandboxType == "localWithFile"){
return (null);
};
_local3 = new (MochiBot);
_arg1.addChild(_local3);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
_local4 = "http://core.mochibot.com/my/core.swf";
_local5 = new URLVariables();
_local5["sb"] = Security.sandboxType;
_local5["v"] = Capabilities.version;
_local5["swfid"] = _arg2;
_local5["mv"] = "8";
_local5["fv"] = "9";
_local6 = _local3.root.loaderInfo.loaderURL;
if (_local6.indexOf("http") == 0){
_local5["url"] = _local6;
} else {
_local5["url"] = "local";
};
_local7 = new URLRequest(_local4);
_local7.contentType = "application/x-www-form-urlencoded";
_local7.method = URLRequestMethod.POST;
_local7.data = _local5;
_local8 = new Loader();
_local3.addChild(_local8);
_local8.load(_local7);
return (_local3);
}
}
}//package
Section 108
//moon (moon)
package {
import flash.display.*;
public dynamic class moon extends MovieClip {
}
}//package
Section 109
//MyEvents (MyEvents)
package {
import flash.events.*;
public class MyEvents extends EventDispatcher {
public static var READY:String = "ready";
public function triggerMe(_arg1:String){
dispatchEvent(new Event(MyEvents.READY));
}
}
}//package
Section 110
//nanorb (nanorb)
package {
import flash.display.*;
public dynamic class nanorb extends Sprite {
}
}//package
Section 111
//orbchaos (orbchaos)
package {
import flash.display.*;
public dynamic class orbchaos extends Sprite {
}
}//package
Section 112
//orbtrail (orbtrail)
package {
import flash.display.*;
public dynamic class orbtrail extends Sprite {
}
}//package
Section 113
//pauseOverlay (pauseOverlay)
package {
import flash.display.*;
public dynamic class pauseOverlay extends Sprite {
public var pause_ag_hit:MovieClip;
}
}//package
Section 114
//plasmid (plasmid)
package {
import flash.display.*;
public dynamic class plasmid extends Sprite {
}
}//package
Section 115
//pmgb (pmgb)
package {
import flash.display.*;
public dynamic class pmgb extends Sprite {
}
}//package
Section 116
//Points (Points)
package {
import com.kongregate.as3.client.events.*;
import com.kongregate.as3.client.*;
import fx.*;
public class Points {
public static var bestHeight:int = 0;
private static var subtimer:int = 0;
public static var lunar_rescue:Boolean = false;
public static var kready:Boolean;
public static var kong:KongregateAPI;
public static var kongame:Boolean = false;
public static var recordHeight:int = 0;
public static var game_complete = false;
public static var nothurt:Boolean = true;
public static var dark_matter = false;
public static var starsGot:int = 0;
public static var blocksBusted:int = 0;
public static var pname:String = "Player";
public static var low_g = false;
public static var kongplayer:Object;
public static function addBlockBust(_arg1:int):void{
blocksBusted++;
}
public static function getName():String{
if (kongame){
return (pname);
};
return ("Player");
}
public static function konguserready(_arg1:Object):void{
kongplayer = _arg1;
}
public static function sendallstats():void{
game_complete = true;
if (kongame){
kong.stats.submit("Re-Entry_Kills", blocksBusted);
kong.stats.submit("Game_Complete", 1);
if (nothurt){
kong.stats.submit("Perfect_Run", 1);
};
if (Game.flub.besthi > bestHeight){
bestHeight = Game.flub.besthi;
};
submitkongscore();
};
}
public static function submitkongstat(_arg1:String, _arg2:Number):void{
kong.stats.submit(_arg1, _arg2);
}
public static function getkonguser(){
kong.user.getPlayerInfo(konguserready);
}
public static function init():void{
kong = new KongregateAPI();
kong.name = "kongcomp";
Game.timeline.addChild(kong);
kong.addEventListener(KongregateEvent.COMPLETE, kongready);
}
public static function resetGame():void{
if ((((blocksBusted > 0)) && (kongame))){
kong.stats.submit("Re-Entry_Kills", blocksBusted);
};
if ((((bestHeight > 0)) && (kongame))){
submitkongscore();
};
bestHeight = 0;
blocksBusted = 0;
lunar_rescue = false;
low_g = false;
dark_matter = false;
game_complete = false;
}
public static function getkongscorelist():void{
kong.scores.requestList(gotscores);
}
public static function kongready(_arg1:KongregateEvent):void{
if (kong.loaded){
kongame = true;
kready = true;
kong.scores.setMode("normal");
pname = kong.user.getName();
};
}
public static function setMilestone(_arg1:String):void{
if (kongame){
kong.stats.submit(_arg1, 1);
};
}
public static function setHeight(_arg1:int):void{
subtimer++;
if (_arg1 > bestHeight){
bestHeight = _arg1;
if (bestHeight > recordHeight){
recordHeight = bestHeight;
};
if ((((kongame == true)) && ((subtimer > 50)))){
submitkongscore();
subtimer = 0;
};
};
}
public static function gotscores(_arg1:Object):Boolean{
var _local2:String;
var _local3:int;
var _local4:int;
if (_arg1.list == undefined){
return (false);
};
_local2 = ("High Scores, success=" + _arg1.success);
_local3 = 0;
while (_local3 < _arg1.list.length) {
_local4 = (_local3 + 1);
_local2 = (_local2 + ((((("\n" + _local4) + ". ") + _arg1.list[_local3].username) + " - ") + _arg1.list[_local3].score));
_local3++;
};
return (true);
}
public static function submitkongscore(_arg1:String=null):void{
if (_arg1 != null){
kong.scores.submit(bestHeight, _arg1);
} else {
kong.scores.submit(bestHeight);
};
}
}
}//package
Section 117
//pooparticle (pooparticle)
package {
import flash.display.*;
public dynamic class pooparticle extends Sprite {
}
}//package
Section 118
//pop (pop)
package {
import flash.media.*;
public dynamic class pop extends Sound {
}
}//package
Section 119
//popsnd (popsnd)
package {
import flash.media.*;
public dynamic class popsnd extends Sound {
}
}//package
Section 120
//redBalloon (redBalloon)
package {
import flash.display.*;
public dynamic class redBalloon extends Sprite {
public var droot:MovieClip;
}
}//package
Section 121
//right_paddle (right_paddle)
package {
import flash.display.*;
public dynamic class right_paddle extends MovieClip {
public var paddle:MovieClip;
}
}//package
Section 122
//shocksnd (shocksnd)
package {
import flash.media.*;
public dynamic class shocksnd extends Sound {
}
}//package
Section 123
//sign1 (sign1)
package {
import flash.display.*;
public dynamic class sign1 extends Sprite {
}
}//package
Section 124
//sign2 (sign2)
package {
import flash.display.*;
public dynamic class sign2 extends Sprite {
}
}//package
Section 125
//sign3 (sign3)
package {
import flash.display.*;
import flash.text.*;
public dynamic class sign3 extends Sprite {
public var name_txt:TextField;
}
}//package
Section 126
//singlespike (singlespike)
package {
import flash.display.*;
public dynamic class singlespike extends MovieClip {
}
}//package
Section 127
//skullEyes (skullEyes)
package {
import flash.display.*;
public dynamic class skullEyes extends MovieClip {
}
}//package
Section 128
//sonicBoom (sonicBoom)
package {
import flash.display.*;
public dynamic class sonicBoom extends MovieClip {
public var glowball:hotness;
}
}//package
Section 129
//spark (spark)
package {
import flash.display.*;
public dynamic class spark extends Sprite {
}
}//package
Section 130
//spring (spring)
package {
import flash.media.*;
public dynamic class spring extends Sound {
}
}//package
Section 131
//sring (sring)
package {
import flash.display.*;
public dynamic class sring extends Sprite {
}
}//package
Section 132
//stab (stab)
package {
import flash.media.*;
public dynamic class stab extends Sound {
}
}//package
Section 133
//Star (Star)
package {
import flash.display.*;
public dynamic class Star extends Sprite {
}
}//package
Section 134
//swoopfire (swoopfire)
package {
import flash.media.*;
public dynamic class swoopfire extends Sound {
}
}//package
Section 135
//text1 (text1)
package {
import flash.display.*;
public dynamic class text1 extends Sprite {
}
}//package
Section 136
//text2 (text2)
package {
import flash.display.*;
public dynamic class text2 extends Sprite {
}
}//package
Section 137
//text3 (text3)
package {
import flash.display.*;
public dynamic class text3 extends Sprite {
}
}//package
Section 138
//tipsp (tipsp)
package {
import flash.display.*;
public dynamic class tipsp extends Sprite {
}
}//package
Section 139
//titleScreen (titleScreen)
package {
import flash.display.*;
public dynamic class titleScreen extends MovieClip {
public var gd_btn:MovieClip;
public var tflub:MovieClip;
public var pmg_btn:MovieClip;
public var start_btn:MovieClip;
}
}//package
Section 140
//treetrunk (treetrunk)
package {
import flash.display.*;
public dynamic class treetrunk extends Sprite {
public var s1:MovieClip;
public var s3:MovieClip;
public var s5:MovieClip;
public var s6:MovieClip;
public var s8:MovieClip;
public var s2:MovieClip;
public var s7:MovieClip;
public var s9:MovieClip;
public var s4:MovieClip;
public var s10:MovieClip;
public var s11:MovieClip;
}
}//package
Section 141
//upSpike (upSpike)
package {
import flash.display.*;
public dynamic class upSpike extends MovieClip {
}
}//package
Section 142
//vj (vj)
package {
import flash.display.*;
public dynamic class vj extends MovieClip {
}
}//package