Section 1
//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 2
//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 3
//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 4
//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 5
//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 6
//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 7
//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 8
//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 9
//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 10
//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 11
//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 12
//KongregateAPI (com.kongregate.as3.client.KongregateAPI)
package com.kongregate.as3.client {
import flash.events.*;
import flash.display.*;
import com.kongregate.as3.client.services.*;
import com.kongregate.as3.client.events.*;
import flash.system.*;
import flash.net.*;
import flash.utils.*;
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 13
//ButtonContinue_7 (ma2_fla.ButtonContinue_7)
package ma2_fla {
import flash.display.*;
public dynamic class ButtonContinue_7 extends MovieClip {
public function ButtonContinue_7(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ma2_fla
Section 14
//ButtonLife_16 (ma2_fla.ButtonLife_16)
package ma2_fla {
import flash.display.*;
public dynamic class ButtonLife_16 extends MovieClip {
public function ButtonLife_16(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ma2_fla
Section 15
//ButtonMainMenu_12 (ma2_fla.ButtonMainMenu_12)
package ma2_fla {
import flash.display.*;
public dynamic class ButtonMainMenu_12 extends MovieClip {
public function ButtonMainMenu_12(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ma2_fla
Section 16
//ButtonMusic_13 (ma2_fla.ButtonMusic_13)
package ma2_fla {
import flash.display.*;
public dynamic class ButtonMusic_13 extends MovieClip {
public function ButtonMusic_13(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ma2_fla
Section 17
//ButtonPower_17 (ma2_fla.ButtonPower_17)
package ma2_fla {
import flash.display.*;
public dynamic class ButtonPower_17 extends MovieClip {
public function ButtonPower_17(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ma2_fla
Section 18
//ButtonSound_8 (ma2_fla.ButtonSound_8)
package ma2_fla {
import flash.display.*;
public dynamic class ButtonSound_8 extends MovieClip {
public function ButtonSound_8(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ma2_fla
Section 19
//ButtonWeapons_15 (ma2_fla.ButtonWeapons_15)
package ma2_fla {
import flash.display.*;
public dynamic class ButtonWeapons_15 extends MovieClip {
public function ButtonWeapons_15(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ma2_fla
Section 20
//Q1_9 (ma2_fla.Q1_9)
package ma2_fla {
import flash.display.*;
public dynamic class Q1_9 extends MovieClip {
public function Q1_9(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ma2_fla
Section 21
//Q2_10 (ma2_fla.Q2_10)
package ma2_fla {
import flash.display.*;
public dynamic class Q2_10 extends MovieClip {
public function Q2_10(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ma2_fla
Section 22
//Q3_11 (ma2_fla.Q3_11)
package ma2_fla {
import flash.display.*;
public dynamic class Q3_11 extends MovieClip {
public function Q3_11(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ma2_fla
Section 23
//MochiAd (mochi.as3.MochiAd)
package mochi.as3 {
import flash.events.*;
import flash.display.*;
import flash.system.*;
import flash.net.*;
import flash.utils.*;
public class MochiAd {
public static function getVersion():String{
return ("3.0 as3");
}
public static function showClickAwayAd(_arg1:Object):void{
var clip:Object;
var mc:MovieClip;
var chk:MovieClip;
var options = _arg1;
var DEFAULTS:Object = {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{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
var ad_timeout:Number = 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();
};
var wh:Array = MochiAd._getRes(options, clip);
var w:Number = wh[0];
var h:Number = 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);
};
var sendHostProgress:Boolean;
mc.regContLC = function (_arg1:String):void{
mc._containerLCName = _arg1;
};
chk["onEnterFrame"] = function ():void{
var _local4:Number;
if (!this.parent){
delete this.onEnterFrame;
return;
};
var _local1:Object = this.parent._mochiad_ctr;
var _local2:Number = (getTimer() - this.started);
var _local3:Boolean;
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 = _arg1.split("/")[2].split(":")[0];
if (Security.sandboxType == "application"){
return (_local2);
};
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 clip:Object;
var mc:MovieClip;
var chk:MovieClip;
var options = _arg1;
var DEFAULTS:Object = {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{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
var ad_msec:Number = 11000;
var ad_timeout:Number = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time:Number = 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();
};
var wh:Array = MochiAd._getRes(options, clip);
var w:Number = wh[0];
var h:Number = 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{
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
var _local1:Number = (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 = 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 _local4:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
var _local1:Object = this.parent._mochiad_ctr;
var _local2:Number = (getTimer() - this.started);
var _local3:Boolean;
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 _local4:String;
var _local5:Array;
var _local6:Number;
var _local7:Array;
var _local3:Object = {};
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"){
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
};
return (_local3);
}
public static function _cleanup(_arg1:Object):void{
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);
};
var idx:Number = 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 clip:Object;
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;
var DEFAULTS:Object = {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."));
};
var depth:Number = options.depth;
delete options.depth;
var mc:MovieClip = createEmptyMovieClip(clip, "_mochiad", depth);
var wh:Array = 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;
} else {
trace("[MochiAd] NOTE: Security Sandbox Violation errors below are normal");
};
var lv:URLVariables = 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.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, function (_arg1:IOErrorEvent):void{
trace("[MochiAds] Blocked URL");
});
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 = _arg2.split(".");
var _local5:Number = 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 = 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 _local6:Array;
var _local3:Object = _arg2.getBounds(_arg2.root);
var _local4:Number = 0;
var _local5:Number = 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 = _arg2.split(".");
var _local4:Number = 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;
default:
trace(("[mochiads rpc] unknown rpc id: " + _arg3.id));
};
}
public static function setValue(_arg1:Object, _arg2:String, _arg3:Object):void{
var _local4:Array = _arg2.split(".");
var _local5:Number = 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 clip:Object;
var mc:MovieClip;
var w:Number;
var h:Number;
var chk:MovieClip;
var complete:Boolean;
var unloaded:Boolean;
var sendHostProgress:Boolean;
var fn:Function;
var r:MovieClip;
var options = _arg1;
var DEFAULTS:Object = {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{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, 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;
var ad_msec:Number = 11000;
var ad_timeout:Number = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time:Number = 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);
var fn:Function = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
};
var wh:Array = 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);
var bar:MovieClip = 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);
};
var bar_color:Number = options.color;
delete options.color;
var bar_background:Number = options.background;
delete options.background;
var bar_outline:Number = options.outline;
delete options.outline;
var backing_mc:MovieClip = createEmptyMovieClip(bar, "_outline", 1);
var backing:Object = 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();
var inside_mc:MovieClip = createEmptyMovieClip(bar, "_inside", 2);
var inside:Object = 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;
var outline_mc:MovieClip = createEmptyMovieClip(bar, "_outline", 3);
var outline:Object = 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 = (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;
var f:Function = 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 = 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{
trace(("[MOCHIAD rpcTestFn] " + _arg1));
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 _local11:Number;
if (((!(this.parent)) || (!(this.parent.parent)))){
delete this["onEnterFrame"];
return;
};
var _local1:Object = this.parent.parent.root;
var _local2:Object = this.parent._mochiad_ctr;
var _local3:Number = (getTimer() - this.started);
var _local4:Boolean;
var _local5:Number = _local1.loaderInfo.bytesTotal;
var _local6:Number = _local1.loaderInfo.bytesLoaded;
if (complete){
_local6 = Math.max(1, _local6);
_local5 = _local6;
};
var _local7:Number = ((100 * _local6) / _local5);
var _local8:Number = ((100 * _local3) / chk.ad_msec);
var _local9:Object = this._mochiad_bar._inside;
var _local10:Number = 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{
trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0");
MochiAd.showPreGameAd(_arg1);
}
public static function showTimedAd(_arg1:Object):void{
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
MochiAd.showInterLevelAd(_arg1);
}
public static function doOnEnterFrame(_arg1:MovieClip):void{
var mc = _arg1;
var f:Function = 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 mochi.as3
Section 24
//Bala (Bala)
package {
import flash.events.*;
import flash.display.*;
public class Bala extends MovieClip {
public var atraves;
public var bspeed;
public var padre;
public var damage;
var tipe;
public var bmtimer;// = 0
var killed;// = false
public function Bala(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9){
stop();
padre = _arg1;
x = _arg2;
y = _arg3;
bspeed = _arg4;
damage = _arg5;
atraves = _arg9;
tipe = _arg8;
gotoAndStop(_arg8);
rotation = (((padre.main.canon.rotation + Math.floor((Math.random() * _arg6))) - (_arg6 / 2)) + _arg7);
if (rotation > 180){
y = (y + (79 * Math.cos(((Math.PI / 180) * rotation))));
x = (x - (79 * Math.sin(((Math.PI / 180) * rotation))));
} else {
y = (y - (79 * Math.cos(((Math.PI / 180) * rotation))));
x = (x + (79 * Math.sin(((Math.PI / 180) * rotation))));
};
addEventListener(Event.ENTER_FRAME, MBala);
}
public function MBala(_arg1:Event):void{
if (rotation > 180){
y = (y + (bspeed * Math.cos(((Math.PI / 180) * rotation))));
x = (x - (bspeed * Math.sin(((Math.PI / 180) * rotation))));
} else {
y = (y - (bspeed * Math.cos(((Math.PI / 180) * rotation))));
x = (x + (bspeed * Math.sin(((Math.PI / 180) * rotation))));
};
if (tipe == 4){
} else {
if (bmtimer < 50){
bmtimer = (bmtimer + 1);
} else {
kill();
};
if (y < padre.main.limity1){
kill();
};
if (y > padre.main.limity2){
kill();
};
if (x < padre.main.limitx1){
kill();
};
if (x > padre.main.limitx2){
kill();
};
};
var _local2:int;
while (_local2 < Enemy.list.length) {
if (this.hitTestObject(Enemy.list[_local2])){
Enemy.list[_local2].tocado(damage);
if (atraves == 0){
kill();
};
break;
};
_local2++;
};
}
public function kill(){
if (killed == false){
killed = true;
removeEventListener(Event.ENTER_FRAME, MBala);
padre.main.removeChild(this);
};
}
}
}//package
Section 25
//Barra (Barra)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class Barra extends MovieClip {
var area2:MMapArea2;
public var padre;
var area:MMapArea;
public var armas:MovieClip;
var mmp:mmPlayer;
public var lvlt:TextField;
public var expbar:MovieClip;
public var prog:MovieClip;
public var minimap:MovieClip;
public var popup:MovieClip;
public var vida:MovieClip;
public var pointst:TextField;
public function Barra(_arg1){
padre = _arg1;
addEventListener(Event.ENTER_FRAME, bar);
armas.stop();
expbar.stop();
area = new MMapArea();
area2 = new MMapArea2();
mmp = new mmPlayer();
addChild(area);
addChild(area2);
addChild(mmp);
area.x = (x + 590);
area.y = (y + 430);
mmp.x = area.x;
mmp.y = area.y;
area.width = ((padre.main.limitx2 * 2) / 10);
area.height = ((padre.main.limity2 * 2) / 10);
area2.width = 70;
area2.height = 50;
}
public function bar(_arg1:Event):void{
padre.main.setChildIndex(this, (padre.main.numChildren - 1));
mmp.x = (area.x + (padre.main.player.x / 10));
mmp.y = (area.y + (padre.main.player.y / 10));
area2.x = ((area.x - (padre.main.x / 10)) + 35);
area2.y = ((area.y - (padre.main.y / 10)) + 25);
}
}
}//package
Section 26
//Canon (Canon)
package {
import flash.display.*;
public class Canon extends MovieClip {
public var padre;
public var myDegrees;
public var myRadians;
public function Canon(_arg1){
padre = _arg1;
}
public function CanonControl():void{
x = padre.main.player.x;
y = padre.main.player.y;
myRadians = Math.atan2(((root.mouseY - padre.main.player.y) - padre.main.y), ((root.mouseX - padre.main.player.x) - padre.main.x));
myDegrees = Math.round(((myRadians * 180) / Math.PI));
this.rotation = (myDegrees + 90);
}
}
}//package
Section 27
//Enemy (Enemy)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Enemy extends MovieClip {
var mme:mmEnemy;
var padre;
var speed;
public var xChange;
public var yChange;
var bdamage;
var variation;
var atak;
public var enemigo:MovieClip;
public var myDegrees;
var exp;
public var e:Explosion;
public var myRadians;
public var xMove;
public var yMove;
public var shootTimer:Timer;
var btipe;
var puntos;
public var tipe;
var life;// = 50
var isdispar;
public static var list:Array = [];
public function Enemy(_arg1, _arg2, _arg3, _arg4){
padre = _arg1;
tipe = _arg4;
list.push(this);
this.cacheAsBitmap = true;
this.enemigo.stop();
if (tipe == 20){
x = 500;
y = 500;
} else {
x = _arg2;
y = _arg3;
};
this.gotoAndStop(tipe);
mme = new mmEnemy();
padre.main.bar.addChild(mme);
addEventListener(Event.ENTER_FRAME, MEne);
switch (_arg4){
case 1:
life = 50;
speed = 3;
puntos = 50;
atak = 5;
exp = 1;
break;
case 2:
life = 100;
speed = 1;
puntos = 150;
exp = 2;
atak = 10;
variation = 10;
btipe = 1;
bdamage = 3;
initShootingInterval(2000);
break;
case 3:
life = 150;
speed = 1;
puntos = 200;
exp = 3;
atak = 15;
variation = 5;
btipe = 2;
bdamage = 5;
initShootingInterval(3000);
break;
case 4:
life = 250;
speed = 1;
puntos = 150;
atak = 15;
exp = 4;
break;
case 5:
life = 500;
speed = 2;
puntos = 350;
atak = 20;
exp = 5;
variation = 15;
btipe = 3;
bdamage = 10;
initShootingInterval(2000);
break;
case 6:
life = 700;
speed = 1;
puntos = 500;
atak = 25;
exp = 10;
variation = 25;
btipe = 3;
bdamage = 7;
initShootingInterval(1200);
break;
case 7:
life = 15000;
speed = 1;
puntos = 1250;
atak = 80;
exp = 100;
variation = 35;
btipe = 3;
bdamage = 20;
initShootingInterval(250);
break;
case 8:
life = 1300;
speed = 2.5;
puntos = 700;
atak = 20;
exp = 20;
variation = 5;
btipe = 2;
bdamage = 10;
initShootingInterval(8000);
break;
case 9:
life = 800;
speed = 3;
puntos = 450;
atak = 15;
exp = 8;
break;
case 10:
life = 5000;
speed = 1.5;
puntos = 800;
atak = 20;
exp = 25;
variation = 10;
btipe = 1;
bdamage = 15;
initShootingInterval(7000);
break;
case 11:
life = 500;
speed = 1;
puntos = 700;
atak = 10;
exp = 30;
variation = 25;
btipe = 1;
bdamage = 3;
initShootingInterval(200);
break;
case 12:
life = 2000;
speed = 2;
puntos = 1700;
atak = 10;
exp = 35;
variation = 10;
btipe = 3;
bdamage = 15;
initShootingInterval(5000);
break;
case 13:
life = 35000;
speed = 0.5;
puntos = 1700;
atak = 200;
exp = 500;
variation = 40;
btipe = 4;
bdamage = 15;
initShootingInterval(300);
break;
case 14:
life = 3000;
speed = 2;
puntos = 3700;
atak = 30;
exp = 70;
variation = 10;
btipe = 2;
bdamage = 20;
initShootingInterval(5000);
break;
case 15:
life = 2000;
speed = 3;
puntos = 2000;
atak = 30;
exp = 40;
break;
case 16:
life = 7500;
speed = 1.5;
puntos = 3500;
atak = 30;
exp = 170;
variation = 10;
btipe = 3;
bdamage = 50;
initShootingInterval(3000);
break;
case 17:
life = 18500;
speed = 1;
puntos = 8000;
atak = 45;
exp = 100;
variation = 5;
btipe = 3;
bdamage = 30;
initShootingInterval(1000);
break;
case 18:
life = 25000;
speed = 0.5;
puntos = 1800;
atak = 30;
exp = 130;
break;
case 19:
life = 30000;
speed = 1;
puntos = 12000;
atak = 45;
exp = 300;
variation = 5;
btipe = 2;
bdamage = 20;
initShootingInterval(500);
break;
case 20:
life = 5000000;
speed = 0;
puntos = 200000;
atak = 1;
exp = 0;
variation = 0;
btipe = 5;
bdamage = 50;
initShootingInterval(15000);
break;
};
}
public function kill(){
var _local2:sexplosion2;
var _local3:sexplosion1;
padre.main.bar.removeChild(mme);
padre.main.score = (padre.main.score + puntos);
padre.main.ekilled = (padre.main.ekilled + 1);
padre.main.expp = (padre.main.expp + exp);
if (padre.main.levelsup < padre.main.explevel){
padre.main.levelea = true;
};
if (tipe == 1){
e = new Explosion(x, y, 2, padre);
padre.main.addChild(e);
_local2 = new sexplosion2();
if (padre.main.sonido == 1){
_local2.play();
};
} else {
e = new Explosion(x, y, 1, padre);
padre.main.addChild(e);
_local3 = new sexplosion1();
if (padre.main.sonido == 1){
_local3.play();
};
};
if (variation > 0){
shootTimer.stop();
shootTimer.removeEventListener("timer", shoot);
};
removeEventListener(Event.ENTER_FRAME, MEne);
padre.main.removeChild(this);
var _local1:int;
while (_local1 < list.length) {
if (list[_local1] == this){
list.splice(_local1, 1);
};
_local1++;
};
}
public function MEne(_arg1:Event):void{
if (padre.main.gpause == 0){
if (tipe == 20){
x = 0;
y = 0;
enemigo.vidab.gotoAndStop(Math.round(((life * 100) / 5000000)));
} else {
myRadians = Math.atan2((padre.main.player.y - y), (padre.main.player.x - x));
myDegrees = Math.round(((myRadians * 180) / Math.PI));
rotation = (myDegrees + 90);
if (rotation > 180){
y = (y + (speed * Math.cos(((Math.PI / 180) * rotation))));
x = (x - (speed * Math.sin(((Math.PI / 180) * rotation))));
} else {
y = (y - (speed * Math.cos(((Math.PI / 180) * rotation))));
x = (x + (speed * Math.sin(((Math.PI / 180) * rotation))));
};
};
mme.x = (padre.main.bar.area.x + (x / 10));
mme.y = (padre.main.bar.area.y + (y / 10));
if (life <= 0){
kill();
};
if (this.enemigo.currentFrame == 1){
this.enemigo.stop();
};
} else {
stop();
};
}
public function shoot(_arg1:Event){
var _local2:*;
if (padre.main.gpause == 0){
_local2 = new EnemyBullet(x, y, variation, padre, btipe, bdamage);
padre.main.addChild(_local2);
};
}
public function tocado(_arg1){
life = (life - _arg1);
this.enemigo.gotoAndPlay(2);
var _local2:impact = new impact();
if (padre.main.sonido == 1){
_local2.play();
};
}
public function initShootingInterval(_arg1){
var _local2:int = (Math.floor((Math.random() * 500)) + _arg1);
shootTimer = new Timer(_local2, 0);
shootTimer.addEventListener("timer", shoot);
shootTimer.start();
}
public static function damageAll(){
var _local1:int = (Enemy.list.length - 1);
while (_local1 >= 0) {
Enemy.list[_local1].tocado(100);
_local1--;
};
}
public static function killAll(){
var _local1:int = (Enemy.list.length - 1);
while (_local1 >= 0) {
Enemy.list[_local1].kill();
_local1--;
};
}
}
}//package
Section 28
//EnemyBullet (EnemyBullet)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class EnemyBullet extends MovieClip {
public var myRadians;
public var speed;
var ebtimer;// = 0
public var bulletdamage;// = 5
public var variation;
public var padre;
public var myDegrees;
public function EnemyBullet(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6){
bulletdamage = _arg6;
this.gotoAndStop(_arg5);
padre = _arg4;
x = _arg1;
y = _arg2;
speed = 4;
variation = (Math.floor((Math.random() * _arg3)) - (_arg3 / 2));
var _local7:* = new gun3();
if (padre.main.sonido == 1){
_local7.play();
};
myRadians = Math.atan2((padre.main.player.y - y), (padre.main.player.x - x));
myDegrees = Math.round(((myRadians * 180) / Math.PI));
rotation = ((myDegrees + 90) + variation);
if (rotation > 180){
y = (y + (20 * Math.cos(((Math.PI / 180) * rotation))));
x = (x - (20 * Math.sin(((Math.PI / 180) * rotation))));
} else {
y = (y - (20 * Math.cos(((Math.PI / 180) * rotation))));
x = (x + (20 * Math.sin(((Math.PI / 180) * rotation))));
};
addEventListener(Event.ENTER_FRAME, enterFrame);
}
public function enterFrame(_arg1:Event){
var _local2:impact;
if (padre.main.gpause == 0){
if (this.hitTestObject(padre.main.player)){
_local2 = new impact();
if (padre.main.sonido == 1){
_local2.play();
};
padre.main.player.cuerpo.play();
padre.main.damagesc.play();
padre.main.mylife = (padre.main.mylife - bulletdamage);
kill();
};
if (rotation > 180){
y = (y + (speed * Math.cos(((Math.PI / 180) * rotation))));
x = (x - (speed * Math.sin(((Math.PI / 180) * rotation))));
} else {
y = (y - (speed * Math.cos(((Math.PI / 180) * rotation))));
x = (x + (speed * Math.sin(((Math.PI / 180) * rotation))));
};
ebtimer++;
if (ebtimer > 250){
kill();
};
};
}
public function kill(){
removeEventListener(Event.ENTER_FRAME, enterFrame);
padre.main.removeChild(this);
}
}
}//package
Section 29
//Explosion (Explosion)
package {
import flash.events.*;
import flash.display.*;
public class Explosion extends MovieClip {
public var explo:MovieClip;
public var pu:PowerUp;
public var padre;
var aleator;
public function Explosion(_arg1, _arg2, _arg3, _arg4){
padre = _arg4;
this.gotoAndStop(_arg3);
x = _arg1;
y = _arg2;
addEventListener(Event.ENTER_FRAME, enterFrame);
}
public function enterFrame(_arg1:Event){
if (this.explo.currentFrame == this.explo.totalFrames){
this.explo.stop();
aleator = Math.floor((Math.random() * 10));
if (aleator == 3){
pu = new PowerUp(padre, x, y, (Math.floor((Math.random() * 9)) + 1));
padre.main.addChild(pu);
padre.main.setChildIndex(pu, 5);
};
removeEventListener(Event.ENTER_FRAME, enterFrame);
padre.main.removeChild(this);
};
}
}
}//package
Section 30
//game_over (game_over)
package {
import flash.events.*;
import flash.display.*;
public class game_over extends Sprite {
public var main_menu_button:SimpleButton;
public var main_class:the_game;
public var level_select_button:SimpleButton;
public var last_level:int;
public var play_again_button:SimpleButton;
public function game_over(_arg1:the_game, _arg2:int){
last_level = _arg2;
main_class = _arg1;
play_again_button.addEventListener(MouseEvent.CLICK, play_again_button_clicked);
level_select_button.addEventListener(MouseEvent.CLICK, level_select_button_clicked);
main_menu_button.addEventListener(MouseEvent.CLICK, on_main_menu_button_clicked);
}
public function level_select_button_clicked(_arg1:MouseEvent){
main_class.select_the_level();
}
public function on_main_menu_button_clicked(_arg1:MouseEvent){
main_class.show_splash();
}
public function play_again_button_clicked(_arg1:MouseEvent){
main_class.play_the_game(last_level);
}
}
}//package
Section 31
//game_won (game_won)
package {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import flash.text.*;
public class game_won extends Sprite {
public var next_level_button:SimpleButton;
public var shared:SharedObject;
public var main_menu_button:SimpleButton;
public var main_class:the_game;
public var level_select_button:SimpleButton;
public var last_level:int;
public function game_won(_arg1:the_game, _arg2:int, _arg3:int){
shared = SharedObject.getLocal("mtlarn2");
shared.data.level_passed = (_arg2 + 1);
shared.data.explevel = _arg3;
shared.close();
last_level = _arg2;
main_class = _arg1;
next_level_button.addEventListener(MouseEvent.CLICK, next_level_button_clicked);
level_select_button.addEventListener(MouseEvent.CLICK, level_select_button_clicked);
main_menu_button.addEventListener(MouseEvent.CLICK, on_main_menu_button_clicked);
}
public function next_level_button_clicked(_arg1:MouseEvent){
main_class.play_the_game((last_level + 1));
}
public function level_select_button_clicked(_arg1:MouseEvent){
main_class.select_the_level();
}
public function on_main_menu_button_clicked(_arg1:MouseEvent){
main_class.show_splash();
}
}
}//package
Section 32
//gun1 (gun1)
package {
import flash.media.*;
public dynamic class gun1 extends Sound {
}
}//package
Section 33
//gun2 (gun2)
package {
import flash.media.*;
public dynamic class gun2 extends Sound {
}
}//package
Section 34
//gun3 (gun3)
package {
import flash.media.*;
public dynamic class gun3 extends Sound {
}
}//package
Section 35
//gun5 (gun5)
package {
import flash.media.*;
public dynamic class gun5 extends Sound {
}
}//package
Section 36
//how_to_play (how_to_play)
package {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public class how_to_play extends Sprite {
var shared:SharedObject;
public var reset:SimpleButton;
public var back_button:SimpleButton;
public var main_class:the_game;
public var play_button:SimpleButton;
public function how_to_play(_arg1:the_game){
main_class = _arg1;
play_button.addEventListener(MouseEvent.CLICK, on_play_button_clicked);
back_button.addEventListener(MouseEvent.CLICK, on_back_button_clicked);
reset.addEventListener(MouseEvent.CLICK, button_clicked);
}
public function button_clicked(_arg1:MouseEvent){
shared = SharedObject.getLocal("mtlarn2");
shared.data.explevel = 1;
shared.data.level_passed = 1;
shared.close();
}
public function on_play_button_clicked(_arg1:MouseEvent){
main_class.select_the_level();
}
public function on_back_button_clicked(_arg1:MouseEvent){
main_class.show_splash();
}
}
}//package
Section 37
//impact (impact)
package {
import flash.media.*;
public dynamic class impact extends Sound {
}
}//package
Section 38
//Key (Key)
package {
import flash.events.*;
import flash.display.*;
public class Key {
private static var initialized:Boolean = false;
private static var keysDown:Object = new Object();
public static function initialize(_arg1:Stage){
if (!initialized){
_arg1.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
_arg1.addEventListener(KeyboardEvent.KEY_UP, keyReleased);
_arg1.addEventListener(Event.DEACTIVATE, clearKeys);
initialized = true;
};
}
private static function clearKeys(_arg1:Event):void{
keysDown = new Object();
}
public static function isDown(_arg1:uint):Boolean{
return (Boolean((_arg1 in keysDown)));
}
private static function keyPressed(_arg1:KeyboardEvent):void{
keysDown[_arg1.keyCode] = true;
}
private static function keyReleased(_arg1:KeyboardEvent):void{
if ((_arg1.keyCode in keysDown)){
delete keysDown[_arg1.keyCode];
};
}
}
}//package
Section 39
//lasershot1 (lasershot1)
package {
import flash.media.*;
public dynamic class lasershot1 extends Sound {
}
}//package
Section 40
//level_selection (level_selection)
package {
import flash.events.*;
import flash.display.*;
public class level_selection extends Sprite {
public var main_class:the_game;
private var level_thumb:level_thumbnail;
public var main_menu_button:SimpleButton;
public function level_selection(_arg1:the_game){
main_class = _arg1;
var _local2 = 1;
while (_local2 <= 5) {
level_thumb = new level_thumbnail(_local2, main_class);
addChild(level_thumb);
_local2++;
};
main_menu_button.addEventListener(MouseEvent.CLICK, on_main_menu_button_clicked);
}
public function on_main_menu_button_clicked(_arg1:MouseEvent){
main_class.show_splash();
}
}
}//package
Section 41
//level_thumbnail (level_thumbnail)
package {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import flash.text.*;
public class level_thumbnail extends Sprite {
public var leveltext:TextField;
public var shared:SharedObject;
public var main_class:the_game;
public var level_number:int;
public function level_thumbnail(_arg1:int, _arg2:the_game){
shared = SharedObject.getLocal("mtlarn2");
if (shared.data.level_passed == undefined){
shared.data.level_passed = 1;
};
if (shared.data.level_passed < _arg1){
alpha = 0.5;
} else {
this.buttonMode = true;
this.mouseChildren = false;
addEventListener(MouseEvent.CLICK, on_level_clicked);
};
main_class = _arg2;
level_number = _arg1;
y = ((_arg1 * 60) + 130);
x = -80;
leveltext.text = ("Arena " + _arg1);
shared.close();
}
public function on_level_clicked(_arg1:MouseEvent){
main_class.play_the_game(level_number);
}
}
}//package
Section 42
//LvlUMenu (LvlUMenu)
package {
import flash.events.*;
import flash.display.*;
public class LvlUMenu extends MovieClip {
public var armaslvlu:MovieClip;
public var padre;
public var powerlvlu:MovieClip;
public var lifelvlu:MovieClip;
public function LvlUMenu(_arg1){
addFrameScript(0, frame1);
padre = _arg1;
x = (-(padre.main.x) + 450);
y = (-(padre.main.y) + 150);
}
function frame1(){
armaslvlu.addEventListener(MouseEvent.ROLL_OVER, onRollOverHandler);
armaslvlu.addEventListener(MouseEvent.ROLL_OUT, onRollOutHandler);
armaslvlu.addEventListener(MouseEvent.CLICK, onClickHandler);
powerlvlu.addEventListener(MouseEvent.ROLL_OVER, onRollOverHandler3);
powerlvlu.addEventListener(MouseEvent.ROLL_OUT, onRollOutHandler3);
powerlvlu.addEventListener(MouseEvent.CLICK, onClickHandler3);
lifelvlu.addEventListener(MouseEvent.ROLL_OVER, onRollOverHandler7);
lifelvlu.addEventListener(MouseEvent.ROLL_OUT, onRollOutHandler7);
lifelvlu.addEventListener(MouseEvent.CLICK, onClickHandler7);
armaslvlu.buttonMode = true;
armaslvlu.useHandCursor = true;
powerlvlu.buttonMode = true;
powerlvlu.useHandCursor = true;
lifelvlu.buttonMode = true;
lifelvlu.useHandCursor = true;
}
public function onClickHandler(_arg1:MouseEvent){
if (padre.main.weapons < 5){
padre.main.gpause = 0;
padre.main.removeChild(this);
padre.main.weapons++;
if (padre.main.levelsup < padre.main.explevel){
padre.main.LvlUp();
};
};
}
public function onClickHandler3(_arg1:MouseEvent){
padre.main.gpause = 0;
padre.main.removeChild(this);
padre.main.power++;
if (padre.main.levelsup < padre.main.explevel){
padre.main.LvlUp();
};
}
public function onClickHandler7(_arg1:MouseEvent){
padre.main.gpause = 0;
padre.main.removeChild(this);
padre.main.maxlife = (padre.main.maxlife + 100);
padre.main.mylife = (padre.main.mylife + 100);
if (padre.main.mylife > padre.main.maxlife){
padre.main.mylife = padre.main.maxlife;
};
if (padre.main.levelsup < padre.main.explevel){
padre.main.LvlUp();
};
}
public function onRollOutHandler(_arg1:MouseEvent){
armaslvlu.gotoAndStop(1);
}
public function onRollOverHandler3(_arg1:MouseEvent){
powerlvlu.gotoAndStop(2);
}
public function onRollOverHandler(_arg1:MouseEvent){
armaslvlu.gotoAndStop(2);
}
public function onRollOutHandler3(_arg1:MouseEvent){
powerlvlu.gotoAndStop(1);
}
public function onRollOverHandler7(_arg1:MouseEvent){
lifelvlu.gotoAndStop(2);
}
public function onRollOutHandler7(_arg1:MouseEvent){
lifelvlu.gotoAndStop(1);
}
}
}//package
Section 43
//lvlup (lvlup)
package {
import flash.media.*;
public dynamic class lvlup extends Sound {
}
}//package
Section 44
//Mirilla (Mirilla)
package {
import flash.display.*;
public class Mirilla extends MovieClip {
public function Mirilla(){
stop();
}
}
}//package
Section 45
//MMapArea (MMapArea)
package {
import flash.display.*;
public dynamic class MMapArea extends MovieClip {
}
}//package
Section 46
//MMapArea2 (MMapArea2)
package {
import flash.display.*;
public dynamic class MMapArea2 extends MovieClip {
}
}//package
Section 47
//mmEnemy (mmEnemy)
package {
import flash.display.*;
public dynamic class mmEnemy extends MovieClip {
}
}//package
Section 48
//mmPlayer (mmPlayer)
package {
import flash.display.*;
public dynamic class mmPlayer extends MovieClip {
}
}//package
Section 49
//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{
if (Security.sandboxType == "localWithFile"){
return (null);
};
var _local3:MochiBot = new (MochiBot);
_arg1.addChild(_local3);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
var _local4 = "http://core.mochibot.com/my/core.swf";
var _local5:URLVariables = new URLVariables();
_local5["sb"] = Security.sandboxType;
_local5["v"] = Capabilities.version;
_local5["swfid"] = _arg2;
_local5["mv"] = "8";
_local5["fv"] = "9";
var _local6:String = _local3.root.loaderInfo.loaderURL;
if (_local6.indexOf("http") == 0){
_local5["url"] = _local6;
} else {
_local5["url"] = "local";
};
var _local7:URLRequest = new URLRequest(_local4);
_local7.contentType = "application/x-www-form-urlencoded";
_local7.method = URLRequestMethod.POST;
_local7.data = _local5;
var _local8:Loader = new Loader();
_local3.addChild(_local8);
_local8.load(_local7);
return (_local3);
}
}
}//package
Section 50
//music (music)
package {
import flash.media.*;
public dynamic class music extends Sound {
}
}//package
Section 51
//Nuke (Nuke)
package {
import flash.events.*;
import flash.display.*;
public class Nuke extends MovieClip {
public var padre;
public function Nuke(_arg1, _arg2, _arg3){
addFrameScript(59, frame60);
padre = _arg1;
x = _arg2;
y = _arg3;
var _local4:snuke = new snuke();
if (padre.main.sonido == 1){
_local4.play();
};
addEventListener(Event.ENTER_FRAME, enterFrame);
}
public function enterFrame(_arg1:Event){
if (currentFrame == totalFrames){
stop();
removeEventListener(Event.ENTER_FRAME, enterFrame);
padre.main.removeChild(this);
};
}
function frame60(){
stop();
}
}
}//package
Section 52
//PauseMenu (PauseMenu)
package {
import flash.events.*;
import flash.display.*;
public class PauseMenu extends MovieClip {
public var bmenu:MovieClip;
public var padre;
public var sound:MovieClip;
public var q1:MovieClip;
public var q2:MovieClip;
public var q3:MovieClip;
public var music:MovieClip;
public var empezar:MovieClip;
public function PauseMenu(_arg1){
addFrameScript(0, frame1);
padre = _arg1;
x = (-(padre.main.x) + 450);
y = (-(padre.main.y) + 150);
}
public function onRollOverHandler6(_arg1:MouseEvent){
q3.gotoAndStop(2);
}
public function onRollOutHandler6(_arg1:MouseEvent){
q3.gotoAndStop(1);
}
public function onRollOutHandler8(_arg1:MouseEvent){
music.gotoAndStop(1);
}
public function onRollOutHandler5(_arg1:MouseEvent){
q2.gotoAndStop(1);
}
public function onRollOverHandler4(_arg1:MouseEvent){
q1.gotoAndStop(2);
}
public function onRollOverHandler5(_arg1:MouseEvent){
q2.gotoAndStop(2);
}
function frame1(){
empezar.addEventListener(MouseEvent.ROLL_OVER, onRollOverHandler);
empezar.addEventListener(MouseEvent.ROLL_OUT, onRollOutHandler);
empezar.addEventListener(MouseEvent.CLICK, onClickHandler);
sound.addEventListener(MouseEvent.ROLL_OVER, onRollOverHandler3);
sound.addEventListener(MouseEvent.ROLL_OUT, onRollOutHandler3);
sound.addEventListener(MouseEvent.CLICK, onClickHandler3);
music.addEventListener(MouseEvent.ROLL_OVER, onRollOverHandler8);
music.addEventListener(MouseEvent.ROLL_OUT, onRollOutHandler8);
music.addEventListener(MouseEvent.CLICK, onClickHandler8);
q1.addEventListener(MouseEvent.ROLL_OVER, onRollOverHandler4);
q1.addEventListener(MouseEvent.ROLL_OUT, onRollOutHandler4);
q1.addEventListener(MouseEvent.CLICK, onClickHandler4);
q2.addEventListener(MouseEvent.ROLL_OVER, onRollOverHandler5);
q2.addEventListener(MouseEvent.ROLL_OUT, onRollOutHandler5);
q2.addEventListener(MouseEvent.CLICK, onClickHandler5);
q3.addEventListener(MouseEvent.ROLL_OVER, onRollOverHandler6);
q3.addEventListener(MouseEvent.ROLL_OUT, onRollOutHandler6);
q3.addEventListener(MouseEvent.CLICK, onClickHandler6);
bmenu.addEventListener(MouseEvent.ROLL_OVER, onRollOverHandler7);
bmenu.addEventListener(MouseEvent.ROLL_OUT, onRollOutHandler7);
bmenu.addEventListener(MouseEvent.CLICK, onClickHandler7);
empezar.buttonMode = true;
empezar.useHandCursor = true;
music.buttonMode = true;
music.useHandCursor = true;
sound.buttonMode = true;
sound.useHandCursor = true;
q1.buttonMode = true;
q1.useHandCursor = true;
q2.buttonMode = true;
q2.useHandCursor = true;
q3.buttonMode = true;
q3.useHandCursor = true;
bmenu.buttonMode = true;
bmenu.useHandCursor = true;
}
public function onClickHandler(_arg1:MouseEvent){
padre.main.gpause = 0;
padre.main.removeChild(this);
}
public function onClickHandler3(_arg1:MouseEvent){
if (padre.main.sonido == 1){
padre.main.sonido = 0;
} else {
padre.main.sonido = 1;
};
}
public function onClickHandler4(_arg1:MouseEvent){
stage.quality = "high";
padre.main.auto = false;
}
public function onClickHandler5(_arg1:MouseEvent){
stage.quality = "medium";
padre.main.auto = false;
}
public function onClickHandler6(_arg1:MouseEvent){
stage.quality = "low";
padre.main.auto = false;
}
public function onClickHandler7(_arg1:MouseEvent){
padre.main.stopPlay();
var _local2:int;
while (_local2 < Enemy.list.length) {
Enemy.list[_local2].kill();
_local2++;
};
var _local3:int;
while (_local3 < Enemy.list.length) {
Enemy.list[_local3].kill();
_local3++;
};
var _local4:int;
while (_local4 < Enemy.list.length) {
Enemy.list[_local4].kill();
_local4++;
};
var _local5:int;
while (_local5 < Enemy.list.length) {
Enemy.list[_local5].kill();
_local5++;
};
padre.main.main_class.show_game_over(padre.main.current_level);
}
public function onClickHandler8(_arg1:MouseEvent){
if (padre.main.musicon == 1){
padre.main.musicon = 0;
padre.main.stopPlay();
} else {
padre.main.musicon = 1;
padre.main.startPlay();
};
}
public function onRollOutHandler(_arg1:MouseEvent){
empezar.gotoAndStop(1);
}
public function onRollOverHandler3(_arg1:MouseEvent){
sound.gotoAndStop(2);
}
public function onRollOverHandler(_arg1:MouseEvent){
empezar.gotoAndStop(2);
}
public function onRollOutHandler3(_arg1:MouseEvent){
sound.gotoAndStop(1);
}
public function onRollOutHandler4(_arg1:MouseEvent){
q1.gotoAndStop(1);
}
public function onRollOverHandler7(_arg1:MouseEvent){
bmenu.gotoAndStop(2);
}
public function onRollOverHandler8(_arg1:MouseEvent){
music.gotoAndStop(2);
}
public function onRollOutHandler7(_arg1:MouseEvent){
bmenu.gotoAndStop(1);
}
}
}//package
Section 53
//Player (Player)
package {
import flash.display.*;
public class Player extends MovieClip {
public var btimer;// = 0
public var padre;
public var speed;
public var shooting;// = false
public var weapon;// = 1
public var spread;// = 0
public var bala:Bala;
public var paus:PauseMenu;
public var maxspread;
public var cuerpo:MovieClip;
public function Player(_arg1){
padre = _arg1;
x = 100;
y = 150;
speed = 3;
this.stop();
cuerpo.stop();
}
public function Controla(){
var _local1:gun1;
var _local2:gun2;
var _local3:gun3;
var _local4:gun5;
var _local5:gun5;
if (cuerpo.currentFrame == 1){
cuerpo.stop();
};
if (((Key.isDown(80)) || (Key.isDown(112)))){
if (padre.main.gpause == false){
padre.main.gpause = true;
paus = new PauseMenu(padre);
padre.main.addChild(paus);
};
};
if (x < (padre.main.limitx1 + 50)){
x = (padre.main.limitx1 + 50);
};
if (x > (padre.main.limitx2 - 50)){
x = (padre.main.limitx2 - 50);
};
if (y < (padre.main.limity1 + 50)){
y = (padre.main.limity1 + 50);
};
if (y > (padre.main.limity2 - 50)){
y = (padre.main.limity2 - 50);
};
if (padre.main.levelea == true){
if (Key.isDown(70)){
padre.main.LvlUp();
};
};
if (Key.isDown(49)){
weapon = 1;
padre.main.bar.armas.gotoAndStop(1);
};
if (Key.isDown(50)){
if (padre.main.weapons > 1){
weapon = 2;
padre.main.bar.armas.gotoAndStop(2);
};
};
if (Key.isDown(51)){
if (padre.main.weapons > 2){
weapon = 3;
padre.main.bar.armas.gotoAndStop(3);
};
};
if (Key.isDown(52)){
if (padre.main.weapons > 3){
weapon = 4;
padre.main.bar.armas.gotoAndStop(4);
};
};
if (Key.isDown(53)){
if (padre.main.weapons > 4){
weapon = 5;
padre.main.bar.armas.gotoAndStop(5);
};
};
if (((Key.isDown(39)) || (Key.isDown(68)))){
x = (x + speed);
if (((Key.isDown(38)) || (Key.isDown(87)))){
y = (y - speed);
if (this.rotation == 45){
} else {
if (this.rotation < 45){
this.rotation = (this.rotation + 3);
} else {
this.rotation = (this.rotation - 3);
};
};
} else {
if (((Key.isDown(40)) || (Key.isDown(83)))){
y = (y + speed);
if (this.rotation == 135){
} else {
if (this.rotation < 135){
this.rotation = (this.rotation + 3);
} else {
this.rotation = (this.rotation - 3);
};
};
} else {
if (this.rotation == 90){
} else {
if (this.rotation < 90){
this.rotation = (this.rotation + 3);
} else {
this.rotation = (this.rotation - 3);
};
};
};
};
} else {
if (((Key.isDown(37)) || (Key.isDown(65)))){
x = (x - speed);
this.play();
if (((Key.isDown(38)) || (Key.isDown(87)))){
y = (y - speed);
if (this.rotation == -45){
} else {
if (this.rotation < -45){
this.rotation = (this.rotation + 3);
} else {
this.rotation = (this.rotation - 3);
};
};
} else {
if (((Key.isDown(40)) || (Key.isDown(83)))){
y = (y + speed);
if (this.rotation == -135){
} else {
if (this.rotation < -135){
this.rotation = (this.rotation + 3);
} else {
if (this.rotation > 45){
this.rotation = (this.rotation + 3);
} else {
this.rotation = (this.rotation - 3);
};
};
};
} else {
if (this.rotation == -90){
} else {
if (this.rotation < -90){
this.rotation = (this.rotation + 3);
} else {
this.rotation = (this.rotation - 3);
};
};
};
};
} else {
if (((Key.isDown(38)) || (Key.isDown(87)))){
y = (y - speed);
this.play();
if (this.rotation == 0){
} else {
if (this.rotation < 0){
this.rotation = (this.rotation + 3);
} else {
this.rotation = (this.rotation - 3);
};
};
} else {
if (((Key.isDown(40)) || (Key.isDown(83)))){
y = (y + speed);
this.play();
if (this.rotation == 180){
} else {
if (this.rotation < 180){
if (this.rotation < 0){
this.rotation = (this.rotation - 3);
} else {
this.rotation = (this.rotation + 3);
};
} else {
this.rotation = (this.rotation - 3);
};
};
} else {
this.stop();
};
};
};
};
if (shooting == true){
if (btimer == 0){
switch (weapon){
case 1:
maxspread = 10;
bala = new Bala(padre, padre.main.player.x, padre.main.player.y, 20, (20 * padre.main.power), spread, 0, 1, 0);
padre.main.addChild(bala);
btimer = 5;
if (spread < maxspread){
spread++;
};
_local1 = new gun1();
if (padre.main.sonido == 1){
_local1.play();
};
break;
case 2:
bala = new Bala(padre, padre.main.player.x, padre.main.player.y, 20, (30 * padre.main.power), 1, -10, 1, 0);
padre.main.addChild(bala);
bala = new Bala(padre, padre.main.player.x, padre.main.player.y, 20, (30 * padre.main.power), 1, -5, 1, 0);
padre.main.addChild(bala);
bala = new Bala(padre, padre.main.player.x, padre.main.player.y, 20, (30 * padre.main.power), 1, 0, 1, 0);
padre.main.addChild(bala);
bala = new Bala(padre, padre.main.player.x, padre.main.player.y, 20, (30 * padre.main.power), 1, 5, 1, 0);
padre.main.addChild(bala);
bala = new Bala(padre, padre.main.player.x, padre.main.player.y, 20, (30 * padre.main.power), 1, 10, 1, 0);
padre.main.addChild(bala);
btimer = 25;
_local2 = new gun2();
if (padre.main.sonido == 1){
_local2.play();
};
break;
case 3:
bala = new Bala(padre, padre.main.player.x, padre.main.player.y, 15, (40 * padre.main.power), 1, 0, 2, 0);
padre.main.addChild(bala);
btimer = 5;
_local3 = new gun3();
if (padre.main.sonido == 1){
_local3.play();
};
break;
case 4:
bala = new Bala(padre, padre.main.player.x, padre.main.player.y, 85, (100 * padre.main.power), spread, 0, 3, 1);
padre.main.addChild(bala);
btimer = 25;
_local4 = new gun5();
spread = (spread + 10);
if (padre.main.sonido == 1){
_local4.play();
};
break;
case 5:
maxspread = 20;
bala = new Bala(padre, padre.main.player.x, padre.main.player.y, 30, (50 * padre.main.power), spread, 0, 1, 0);
padre.main.addChild(bala);
btimer = 5;
if (spread < maxspread){
spread = (spread + 3);
};
_local5 = new gun5();
if (padre.main.sonido == 1){
_local5.play();
};
break;
};
} else {
btimer = (btimer - 1);
if (weapon == 4){
if (spread > 0){
spread--;
};
};
};
} else {
if (btimer > 0){
btimer = (btimer - 1);
};
if (spread > 0){
spread--;
};
};
}
}
}//package
Section 54
//PowerUp (PowerUp)
package {
import flash.events.*;
import flash.display.*;
public class PowerUp extends MovieClip {
var putimer;// = 0
var nuke:Nuke;
var tipo;
var padre;
public function PowerUp(_arg1, _arg2, _arg3, _arg4){
padre = _arg1;
tipo = _arg4;
x = _arg2;
y = _arg3;
gotoAndStop(tipo);
addEventListener(Event.ENTER_FRAME, Pup);
}
public function Pup(_arg1:Event):void{
var _local2:spowerup;
if (putimer > 500){
removeEventListener(Event.ENTER_FRAME, Pup);
padre.main.removeChild(this);
} else {
putimer++;
};
if (padre.main.player.hitTestObject(this)){
_local2 = new spowerup();
if (padre.main.sonido == 1){
_local2.play();
};
switch (tipo){
case 1:
nuke = new Nuke(padre, x, y);
padre.main.addChild(nuke);
Enemy.damageAll();
break;
case 2:
padre.main.expp = (padre.main.expp + (Math.floor((Math.random() * 50)) + 25));
break;
default:
if (padre.main.mylife < (padre.main.maxlife - 15)){
padre.main.mylife = (padre.main.mylife + 15);
break;
} else {
padre.main.mylife = padre.main.maxlife;
break;
};
};
removeEventListener(Event.ENTER_FRAME, Pup);
padre.main.removeChild(this);
};
}
}
}//package
Section 55
//sexplosion1 (sexplosion1)
package {
import flash.media.*;
public dynamic class sexplosion1 extends Sound {
}
}//package
Section 56
//sexplosion2 (sexplosion2)
package {
import flash.media.*;
public dynamic class sexplosion2 extends Sound {
}
}//package
Section 57
//snuke (snuke)
package {
import flash.media.*;
public dynamic class snuke extends Sound {
}
}//package
Section 58
//splash (splash)
package {
import flash.events.*;
import flash.display.*;
public class splash extends Sprite {
public var main_class:the_game;
public var how_to_button:SimpleButton;
public var play_button:SimpleButton;
public function splash(_arg1:the_game){
main_class = _arg1;
play_button.addEventListener(MouseEvent.CLICK, on_play_button_clicked);
how_to_button.addEventListener(MouseEvent.CLICK, on_how_to_button_clicked);
}
public function on_play_button_clicked(_arg1:MouseEvent){
main_class.select_the_level();
}
public function on_how_to_button_clicked(_arg1:MouseEvent){
main_class.show_how_to_play();
}
}
}//package
Section 59
//spowerup (spowerup)
package {
import flash.media.*;
public dynamic class spowerup extends Sound {
}
}//package
Section 60
//the_game (the_game)
package {
import flash.display.*;
import com.kongregate.as3.client.*;
import mochi.as3.*;
public dynamic class the_game extends MovieClip {
public var how_to_play_screen:how_to_play;
public var splash_screen:splash;
public var game_over_screen:game_over;
public var congratz_screen:game_won;
var kongregate:KongregateAPI;
public var level_select_screen:level_selection;
public var play_screen:the_game_itself;
public function the_game(){
kongregate = new KongregateAPI();
super();
addFrameScript(0, frame1);
Key.initialize(stage);
show_splash();
this.addChild(kongregate);
stage.quality = "low";
}
private function remove_movie_clip(_arg1){
if (_arg1){
removeChild(_arg1);
};
return (null);
}
function frame1(){
MochiAd.showPreGameAd({clip:root, id:"f599462a5ee99562", res:"700x500"});
MochiBot.track(this, "9bc8d661");
}
public function show_how_to_play(){
how_to_play_screen = new how_to_play(this);
splash_screen = remove_movie_clip(splash_screen);
addChild(how_to_play_screen);
}
public function show_splash(){
splash_screen = new splash(this);
how_to_play_screen = remove_movie_clip(how_to_play_screen);
level_select_screen = remove_movie_clip(level_select_screen);
game_over_screen = remove_movie_clip(game_over_screen);
congratz_screen = remove_movie_clip(congratz_screen);
addChild(splash_screen);
}
public function play_the_game(_arg1){
play_screen = new the_game_itself(this, _arg1);
level_select_screen = remove_movie_clip(level_select_screen);
game_over_screen = remove_movie_clip(game_over_screen);
congratz_screen = remove_movie_clip(congratz_screen);
addChild(play_screen);
}
public function select_the_level(){
play_screen = remove_movie_clip(play_screen);
level_select_screen = new level_selection(this);
splash_screen = remove_movie_clip(splash_screen);
how_to_play_screen = remove_movie_clip(how_to_play_screen);
game_over_screen = remove_movie_clip(game_over_screen);
congratz_screen = remove_movie_clip(congratz_screen);
addChild(level_select_screen);
}
public function show_congratz(_arg1, _arg2){
congratz_screen = new game_won(this, _arg1, _arg2);
play_screen = remove_movie_clip(play_screen);
addChild(congratz_screen);
}
public function show_game_over(_arg1){
game_over_screen = new game_over(this, _arg1);
play_screen = remove_movie_clip(play_screen);
addChild(game_over_screen);
}
}
}//package
Section 61
//the_game_itself (the_game_itself)
package {
import flash.events.*;
import flash.display.*;
import flash.media.*;
import flash.net.*;
import flash.text.*;
import flash.utils.*;
import flash.ui.*;
public class the_game_itself extends MovieClip {
public var porcentaje;// = 0
public var lum:LvlUMenu;
public var power;// = 1
public var explevel;// = 1
public var enemy:Enemy;
var numgen;
public var score;// = 0
public var bar:Barra;
var song:music;
public var porcentajet;
public var lai;// = 1
public var tiempo;// = 0
public var enemyTimer:Timer;
public var levelea;// = false
public var ekilled;// = 0
public var rondas:Array;
public var numrondas;
var zona;
public var limitx1;
public var limitx2;
public var canon:Canon;
public var main;
public var tempx;
public var current_level:int;
var timere;// = 50
var myChannel:SoundChannel;
public var auto;// = true
public var tempy;
public var limity1;
public var limity2;
public var mylife;// = 100
public var mir:Mirilla;
public var levelsup;// = 1
public var weapons;// = 1
public var musicon;// = true
public var maxlife;// = 100
public var player:Player;
public var sonido;// = 1
public var shared:SharedObject;
public var gpause;// = false
public var expp;// = 0
public var main_class:the_game;
public var damagesc:MovieClip;
public function the_game_itself(_arg1, _arg2){
rondas = [0, 10, 1, 100];
numrondas = (rondas.length - 1);
song = new music();
myChannel = new SoundChannel();
super();
stop();
if (sonido == 1){
startPlay();
};
damagesc.stop();
main = this;
shared = SharedObject.getLocal("mtlarn2");
if (shared.data.explevel == undefined){
shared.data.explevel = 1;
} else {
explevel = shared.data.explevel;
};
shared.close();
var _local3:int;
while (_local3 < Enemy.list.length) {
Enemy.list[_local3].kill();
_local3++;
};
this.cacheAsBitmap = true;
current_level = _arg2;
this.gotoAndStop(_arg2);
switch (_arg2){
case 1:
limity1 = -500;
limity2 = 500;
limitx1 = -500;
limitx2 = 500;
rondas = [0, 1, 1, 25, 3, 1, 100, 5, 1, 50, 5, 1, 100, 10, 1, 150, 3, 2, 0, 3, 1, 200, 10, 1, 0, 3, 2, 250, 8, 2, 250, 15, 1, 300, 10, 2, 250, 3, 2, 10, 3, 3, 200, 5, 3, 0, 5, 1, 350, 10, 3, 300, 10, 1, 20, 10, 3, 250, 1, 5, 50, 3, 4, 150, 10, 3, 0, 4, 4, 300, 3, 5, 300, 10, 2, 200, 10, 4, 300, 5, 5, 350, 15, 1, 100, 20, 4, 250, 10, 3, 200, 10, 1, 50, 5, 2, 100, 5, 5, 250, 10, 2, 250, 3, 6, 200, 12, 4, 200, 5, 6, 250, 20, 1, 250, 20, 2, 300, 15, 4, 300, 10, 6, 350, 20, 3, 250, 10, 1, 100, 10, 4, 150, 5, 5, 250, 5, 6, 200, 20, 1, 150, 1, 7, 50, 5, 1, 100, 5, 1, 100, 15, 1, 500, 15, 1, 3000, 0, 1, 100];
numrondas = (rondas.length - 1);
break;
case 2:
limity1 = -650;
limity2 = 650;
limitx1 = -450;
limitx2 = 450;
rondas = [0, 5, 5, 100, 10, 1, 200, 1, 8, 100, 3, 8, 350, 5, 8, 500, 5, 6, 200, 10, 5, 250, 10, 6, 350, 2, 9, 100, 2, 9, 100, 5, 9, 100, 3, 8, 300, 1, 12, 300, 5, 11, 450, 20, 3, 500, 3, 12, 500, 10, 1, 50, 10, 2, 50, 10, 4, 150, 1, 7, 250, 7, 11, 350, 10, 8, 300, 10, 9, 350, 1, 10, 200, 10, 9, 200, 5, 10, 500, 10, 12, 500, 1, 13, 350, 5, 1, 500, 20, 1, 1000, 0, 1, 500];
numrondas = (rondas.length - 1);
break;
case 3:
limity1 = -400;
limity2 = 400;
limitx1 = -500;
limitx2 = 500;
rondas = [0, 3, 15, 150, 1, 14, 100, 2, 14, 250, 3, 14, 0, 2, 15, 400, 10, 12, 300, 7, 10, 350, 10, 11, 400, 8, 6, 400, 1, 16, 100, 2, 16, 400, 3, 15, 300, 5, 14, 350, 5, 16, 550, 20, 6, 550, 15, 3, 250, 10, 1, 0, 10, 2, 200, 10, 1, 0, 5, 5, 20, 10, 12, 450, 5, 16, 600, 5, 15, 350, 3, 14, 0, 2, 15, 100, 1, 16, 350, 20, 1, 100, 5, 15, 250, 1, 7, 300, 15, 12, 1600, 0, 1, 100];
numrondas = (rondas.length - 1);
break;
case 4:
limity1 = -500;
limity2 = 500;
limitx1 = -500;
limitx2 = 500;
rondas = [0, 5, 1, 100, 1, 16, 100, 1, 17, 250, 3, 18, 400, 3, 17, 500, 5, 18, 500, 5, 15, 250, 10, 11, 350, 10, 1, 50, 10, 1, 50, 10, 1, 50, 10, 5, 200, 3, 7, 500, 10, 9, 200, 5, 17, 200, 1, 13, 700, 20, 3, 250, 3, 16, 0, 3, 17, 500, 5, 18, 20, 4, 14, 450, 20, 1, 50, 4, 18, 650, 2, 19, 800, 3, 17, 650, 2, 18, 0, 2, 19, 700, 20, 6, 680, 5, 4, 500, 30, 2, 0, 10, 5, 700, 2, 7, 950, 0, 1, 100];
numrondas = (rondas.length - 1);
break;
case 5:
limity1 = -500;
limity2 = 500;
limitx1 = -500;
limitx2 = 500;
rondas = [0, 1, 20, 50, 7, 2, 200, 2, 17, 300, 20, 1, 500, 15, 1, 100, 5, 17, 300, 15, 3, 550, 10, 18, 700, 10, 1, 100, 5, 19, 600, 14, 2, 200, 30, 1, 400, 2, 7, 300, 10, 1, 300, 4, 14, 400, 7, 2, 200, 2, 17, 300, 20, 1, 500, 15, 1, 100, 5, 17, 300, 15, 3, 550, 10, 18, 700, 10, 1, 100, 5, 19, 600, 14, 2, 200, 30, 1, 400, 2, 7, 300, 10, 1, 300, 4, 14, 400, 7, 2, 200, 2, 17, 300, 20, 1, 500, 15, 1, 100, 5, 17, 300, 15, 3, 550, 10, 18, 700, 10, 1, 100, 5, 19, 600, 14, 2, 200, 30, 1, 400, 2, 7, 300, 10, 1, 300, 4, 14, 10000, 0, 1, 500];
numrondas = (rondas.length - 1);
break;
};
porcentajet = Math.round(((lai * 100) / numrondas));
main_class = _arg1;
elementos();
addEventListener(Event.ENTER_FRAME, juegando);
enemyTimer = new Timer(50);
enemyTimer.addEventListener(TimerEvent.TIMER, EnGen);
enemyTimer.start();
}
public function on_die_button_clicked(_arg1:MouseEvent){
main_class.show_game_over(current_level);
}
function startPlay():void{
myChannel = song.play(0, 10);
}
function onMouse_Up(_arg1:Event):void{
player.shooting = false;
}
public function LvlUp(){
bar.popup.gotoAndStop(1);
lum = new LvlUMenu(this);
main.addChild(lum);
lum.x = (-(x) + 450);
lum.y = (-(y) + 150);
levelsup++;
gpause = true;
}
function EnGen(_arg1:Event):void{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
if (gpause == false){
tiempo = (tiempo + 0.1);
if (lai < numrondas){
if (timere == 0){
numgen = rondas[lai];
_local2 = 0;
while (_local2 < numgen) {
zona = (Math.floor((Math.random() * 4)) + 1);
switch (zona){
case 1:
enemy = new Enemy(this, (Math.floor(((Math.random() * limitx2) - 50)) + 50), (limity1 + 50), rondas[(lai + 1)]);
break;
case 2:
enemy = new Enemy(this, (Math.floor(((Math.random() * limitx2) - 50)) + 50), (limity2 - 50), rondas[(lai + 1)]);
break;
case 3:
enemy = new Enemy(this, (limitx1 + 50), (Math.floor(((Math.random() * limity2) - 50)) + 50), rondas[(lai + 1)]);
break;
case 4:
enemy = new Enemy(this, (limitx2 - 50), (Math.floor(((Math.random() * limity2) - 50)) + 50), rondas[(lai + 1)]);
break;
};
addChild(enemy);
_local2++;
};
timere = rondas[(lai + 2)];
lai = (lai + 3);
setChildIndex(mir, (numChildren - 1));
} else {
timere--;
if ((((((Enemy.list.length <= 0)) && ((lai > 2)))) && ((timere > 50)))){
timere = 30;
};
};
} else {
main_class.kongregate.stats.submit("EnemiesKilled", ekilled);
main_class.kongregate.stats.submit("ExpLevel", explevel);
main_class.kongregate.stats.submit("MaxArena", current_level);
if (current_level == 5){
main_class.kongregate.stats.submit("GameCompleted", 1);
};
main_class.kongregate.stats.submit("MaxScore", score);
main_class.kongregate.scores.submit(score);
stopPlay();
_local3 = 0;
while (_local3 < Enemy.list.length) {
Enemy.list[_local3].kill();
_local3++;
};
_local4 = 0;
while (_local4 < Enemy.list.length) {
Enemy.list[_local4].kill();
_local4++;
};
_local5 = 0;
while (_local5 < Enemy.list.length) {
Enemy.list[_local5].kill();
_local5++;
};
_local6 = 0;
while (_local6 < Enemy.list.length) {
Enemy.list[_local6].kill();
_local6++;
};
gpause = true;
Mouse.show();
main_class.show_congratz(current_level, explevel);
};
};
}
public function on_win_button_clicked(_arg1:MouseEvent){
main_class.show_congratz(current_level, explevel);
}
function elementos(){
player = new Player(this);
addChild(player);
canon = new Canon(this);
addChild(canon);
mir = new Mirilla();
addChild(mir);
bar = new Barra(this);
addChild(bar);
main_class.stage.addEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
main_class.stage.addEventListener(MouseEvent.MOUSE_UP, onMouse_Up);
}
public function juegando(_arg1:Event){
var _local2:int;
var _local3:lvlup;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
bar.prog.gotoAndStop(Math.round(((lai * 100) / numrondas)));
if (damagesc.currentFrame == 1){
damagesc.stop();
};
if (gpause == false){
if (levelea == false){
bar.popup.gotoAndStop(1);
} else {
bar.popup.gotoAndStop(2);
};
player.Controla();
canon.CanonControl();
tempx = (-(player.x) + 350);
tempy = (-(player.y) + 250);
bar.vida.gotoAndStop(Math.round((100 - ((mylife * 100) / maxlife))));
bar.expbar.gotoAndStop(Math.round(((expp * 100) / (explevel * 100))));
if (Math.round(expp) > Math.round((explevel * 100))){
explevel++;
_local3 = new lvlup();
if (sonido == 1){
_local3.play();
};
expp = (expp - ((explevel - 1) * 100));
if (expp < 0){
expp = 0;
};
};
if (levelsup < explevel){
levelea = true;
} else {
levelea = false;
};
bar.pointst.text = score;
bar.lvlt.text = explevel;
if (tempx < (limitx1 + 700)){
x = (limitx1 + 700);
bar.x = -(x);
} else {
if (tempx > limitx2){
x = limitx2;
bar.x = -(x);
} else {
x = tempx;
bar.x = -(x);
};
};
if (tempy < (limity1 + 500)){
y = (limity1 + 500);
bar.y = -(y);
} else {
if (tempy > limity2){
y = limity2;
bar.y = -(y);
} else {
y = tempy;
bar.y = -(y);
};
};
Mouse.hide();
mir.x = mouseX;
mir.y = mouseY;
mir.gotoAndStop(player.spread);
_local2 = 0;
while (_local2 < Enemy.list.length) {
if (player.hitTestObject(Enemy.list[_local2])){
mylife = (mylife - Enemy.list[_local2].atak);
player.cuerpo.play();
damagesc.play();
if (Enemy.list[_local2].tipe == 20){
} else {
Enemy.list[_local2].kill();
};
};
_local2++;
};
if (Math.round(mylife) <= 0){
main_class.kongregate.stats.submit("EnemiesKilled", ekilled);
main_class.kongregate.stats.submit("ExpLevel", explevel);
main_class.kongregate.stats.submit("MaxArena", current_level);
if (current_level == 5){
main_class.kongregate.stats.submit("GameCompleted", 1);
};
main_class.kongregate.stats.submit("MaxScore", score);
main_class.kongregate.scores.submit(score);
stopPlay();
_local4 = 0;
while (_local4 < Enemy.list.length) {
Enemy.list[_local4].kill();
_local4++;
};
_local5 = 0;
while (_local5 < Enemy.list.length) {
Enemy.list[_local5].kill();
_local5++;
};
_local6 = 0;
while (_local6 < Enemy.list.length) {
Enemy.list[_local6].kill();
_local6++;
};
_local7 = 0;
while (_local7 < Enemy.list.length) {
Enemy.list[_local7].kill();
_local7++;
};
gpause = true;
Mouse.show();
main_class.show_game_over(current_level);
};
} else {
Mouse.show();
};
}
function stopPlay():void{
myChannel.stop();
}
function onMouse_Down(_arg1:Event):void{
player.shooting = true;
}
}
}//package