[Tools][Expand/Collapse All]Note that automatic extraction of ActionScript 3 is still pretty much unsupported by swfchan. AS1/AS2 works okay most of the time.Section 1 (1.21 KiB) ●
//Action_4 (BunnyCharm_fla.Action_4)
package BunnyCharm_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.system.*;
import flash.net.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Action_4 extends MovieClip {
public function Action_4(){
super();
addFrameScript(0, frame1);
}
public function onComplete(event:Event):void{
MovieClip(parent).gotoAndPlay("loaded");
}
public function progressHandler(event:ProgressEvent):void{
var PercentLoaded:int;
PercentLoaded = Math.round(((event.target.bytesLoaded / event.target.bytesTotal) * 100));
MovieClip(parent).gotoAndStop(PercentLoaded);
}
function frame1(){
MovieClip(root).stop();
if (root.loaderInfo.bytesLoaded == root.loaderInfo.bytesTotal){
MovieClip(parent).gotoAndPlay("loaded");
};
root.loaderInfo.addEventListener(ProgressEvent.PROGRESS, progressHandler);
root.loaderInfo.addEventListener(Event.COMPLETE, onComplete);
}
}
}//package BunnyCharm_fla
Section 2 (444 B)
//akButton_314 (BunnyCharm_fla.akButton_314)
package BunnyCharm_fla {
import flash.display.*;
public dynamic class akButton_314 extends MovieClip {
public var block:MovieClip;
public var selected:MovieClip;
public var marcoBoton:MovieClip;
public function akButton_314(){
super();
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package BunnyCharm_fla
Section 3 (578 B)
//animacion_GAMAGA_11 (BunnyCharm_fla.animacion_GAMAGA_11)
package BunnyCharm_fla {
import flash.display.*;
import com.kongregate.as3.client.*;
public dynamic class animacion_GAMAGA_11 extends MovieClip {
public var uiCanvas:UICanvas;
public var kongregate:KongregateAPI;
public function animacion_GAMAGA_11(){
super();
addFrameScript(226, frame227);
}
function frame227(){
kongregate = new KongregateAPI();
this.addChild(kongregate);
uiCanvas = new UICanvas(kongregate);
parent.addChild(uiCanvas);
stop();
}
}
}//package BunnyCharm_fla
Section 4 (332 B)
//axionConquista_mc_50 (BunnyCharm_fla.axionConquista_mc_50)
package BunnyCharm_fla {
import flash.display.*;
public dynamic class axionConquista_mc_50 extends MovieClip {
public function axionConquista_mc_50(){
super();
addFrameScript(9, frame10);
}
function frame10(){
stop();
}
}
}//package BunnyCharm_fla
Section 5 (389 B)
//baseButton_291 (BunnyCharm_fla.baseButton_291)
package BunnyCharm_fla {
import flash.display.*;
public dynamic class baseButton_291 extends MovieClip {
public var marcoBoton:MovieClip;
public function baseButton_291(){
super();
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package BunnyCharm_fla
Section 6 (464 B)
//berettaButton_316 (BunnyCharm_fla.berettaButton_316)
package BunnyCharm_fla {
import flash.display.*;
public dynamic class berettaButton_316 extends MovieClip {
public var block:MovieClip;
public var selected:MovieClip;
public var marcoBoton:MovieClip;
public function berettaButton_316(){
super();
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package BunnyCharm_fla
Section 7 (385 B)
//boxButton_309 (BunnyCharm_fla.boxButton_309)
package BunnyCharm_fla {
import flash.display.*;
public dynamic class boxButton_309 extends MovieClip {
public var marcoBoton:MovieClip;
public function boxButton_309(){
super();
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package BunnyCharm_fla
Section 8 (325 B)
//Cuatic_178 (BunnyCharm_fla.Cuatic_178)
package BunnyCharm_fla {
import flash.display.*;
public dynamic class Cuatic_178 extends MovieClip {
public var slogan:MovieClip;
public function Cuatic_178(){
super();
addFrameScript(84, frame85);
}
function frame85(){
stop();
}
}
}//package BunnyCharm_fla
Section 9 (299 B)
//DamageIcon_279 (BunnyCharm_fla.DamageIcon_279)
package BunnyCharm_fla {
import flash.display.*;
import flash.text.*;
public dynamic class DamageIcon_279 extends MovieClip {
public var damagePoints:TextField;
public function DamageIcon_279(){
super();
}
}
}//package BunnyCharm_fla
Section 10 (321 B)
//dedoMuerte1_mc_66 (BunnyCharm_fla.dedoMuerte1_mc_66)
package BunnyCharm_fla {
import flash.display.*;
public dynamic class dedoMuerte1_mc_66 extends MovieClip {
public function dedoMuerte1_mc_66(){
super();
addFrameScript(82, frame83);
}
function frame83(){
stop();
}
}
}//package BunnyCharm_fla
Section 11 (325 B)
//dedoMuerte3_mc_136 (BunnyCharm_fla.dedoMuerte3_mc_136)
package BunnyCharm_fla {
import flash.display.*;
public dynamic class dedoMuerte3_mc_136 extends MovieClip {
public function dedoMuerte3_mc_136(){
super();
addFrameScript(82, frame83);
}
function frame83(){
stop();
}
}
}//package BunnyCharm_fla
Section 12 (357 B)
//dedoMuerteDedal_mccopy_118 (BunnyCharm_fla.dedoMuerteDedal_mccopy_118)
package BunnyCharm_fla {
import flash.display.*;
public dynamic class dedoMuerteDedal_mccopy_118 extends MovieClip {
public function dedoMuerteDedal_mccopy_118(){
super();
addFrameScript(82, frame83);
}
function frame83(){
stop();
}
}
}//package BunnyCharm_fla
Section 13 (329 B)
//dedoMuerteIndice_86 (BunnyCharm_fla.dedoMuerteIndice_86)
package BunnyCharm_fla {
import flash.display.*;
public dynamic class dedoMuerteIndice_86 extends MovieClip {
public function dedoMuerteIndice_86(){
super();
addFrameScript(82, frame83);
}
function frame83(){
stop();
}
}
}//package BunnyCharm_fla
Section 14 (333 B)
//dedoMuerteRunner_153 (BunnyCharm_fla.dedoMuerteRunner_153)
package BunnyCharm_fla {
import flash.display.*;
public dynamic class dedoMuerteRunner_153 extends MovieClip {
public function dedoMuerteRunner_153(){
super();
addFrameScript(82, frame83);
}
function frame83(){
stop();
}
}
}//package BunnyCharm_fla
Section 15 (337 B)
//dedoMuerteShooter_105 (BunnyCharm_fla.dedoMuerteShooter_105)
package BunnyCharm_fla {
import flash.display.*;
public dynamic class dedoMuerteShooter_105 extends MovieClip {
public function dedoMuerteShooter_105(){
super();
addFrameScript(82, frame83);
}
function frame83(){
stop();
}
}
}//package BunnyCharm_fla
Section 16 (460 B)
//desertButton_311 (BunnyCharm_fla.desertButton_311)
package BunnyCharm_fla {
import flash.display.*;
public dynamic class desertButton_311 extends MovieClip {
public var block:MovieClip;
public var selected:MovieClip;
public var marcoBoton:MovieClip;
public function desertButton_311(){
super();
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package BunnyCharm_fla
Section 17 (405 B)
//DinamyteButton_301 (BunnyCharm_fla.DinamyteButton_301)
package BunnyCharm_fla {
import flash.display.*;
public dynamic class DinamyteButton_301 extends MovieClip {
public var marcoBoton:MovieClip;
public function DinamyteButton_301(){
super();
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package BunnyCharm_fla
Section 18 (370 B)
//ExpBar_281 (BunnyCharm_fla.ExpBar_281)
package BunnyCharm_fla {
import flash.display.*;
public dynamic class ExpBar_281 extends MovieClip {
public var barMask:MovieClip;
public function ExpBar_281(){
super();
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package BunnyCharm_fla
Section 19 (456 B)
//flameButton_317 (BunnyCharm_fla.flameButton_317)
package BunnyCharm_fla {
import flash.display.*;
public dynamic class flameButton_317 extends MovieClip {
public var block:MovieClip;
public var selected:MovieClip;
public var marcoBoton:MovieClip;
public function flameButton_317(){
super();
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package BunnyCharm_fla
Section 20 (382 B)
//HealthBar_284 (BunnyCharm_fla.HealthBar_284)
package BunnyCharm_fla {
import flash.display.*;
public dynamic class HealthBar_284 extends MovieClip {
public var barMask:MovieClip;
public function HealthBar_284(){
super();
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package BunnyCharm_fla
Section 21 (361 B)
//impactoEnergia_mc_31 (BunnyCharm_fla.impactoEnergia_mc_31)
package BunnyCharm_fla {
import flash.display.*;
public dynamic class impactoEnergia_mc_31 extends MovieClip {
public function impactoEnergia_mc_31(){
super();
addFrameScript(9, frame10);
}
function frame10(){
stop();
parent.removeChild(this);
}
}
}//package BunnyCharm_fla
Section 22 (401 B)
//informacionJugador_195 (BunnyCharm_fla.informacionJugador_195)
package BunnyCharm_fla {
import flash.display.*;
import flash.text.*;
public dynamic class informacionJugador_195 extends MovieClip {
public var playerName:TextField;
public var playerLevel:TextField;
public var playerScore:TextField;
public function informacionJugador_195(){
super();
}
}
}//package BunnyCharm_fla
Section 23 (285 B)
//loadED_5 (BunnyCharm_fla.loadED_5)
package BunnyCharm_fla {
import flash.display.*;
public dynamic class loadED_5 extends MovieClip {
public function loadED_5(){
super();
addFrameScript(39, frame40);
}
function frame40(){
stop();
}
}
}//package BunnyCharm_fla
Section 24 (1.16 KiB) ●
//MainTimeline (BunnyCharm_fla.MainTimeline)
package BunnyCharm_fla {
import flash.events.*;
import flash.display.*;
import com.kongregate.as3.client.*;
import flash.net.*;
public dynamic class MainTimeline extends MovieClip {
public var uiCanvas:UICanvas;
public var introButton:SimpleButton;
public var kongregate:KongregateAPI;
public function MainTimeline(){
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4);
}
function frame3(){
stop();
introButton.addEventListener(MouseEvent.CLICK, click);
}
function frame1(){
MochiBot.track(this, "9277cb99");
NewgroundsAPI.linkAPI(this);
NewgroundsAPI.connectMovie(7808);
stage.showDefaultContextMenu = false;
stop();
}
function frame4(){
kongregate = new KongregateAPI();
this.addChild(kongregate);
uiCanvas = new UICanvas(kongregate);
addChild(uiCanvas);
stage.showDefaultContextMenu = false;
stop();
}
function frame2(){
}
public function click(e:MouseEvent):void{
navigateToURL(new URLRequest("http://www.gamelaunchproject.com"), "_blank");
introButton.removeEventListener(MouseEvent.CLICK, click);
}
}
}//package BunnyCharm_fla
Section 25 (333 B)
//mano2Muerte01_mc_168 (BunnyCharm_fla.mano2Muerte01_mc_168)
package BunnyCharm_fla {
import flash.display.*;
public dynamic class mano2Muerte01_mc_168 extends MovieClip {
public function mano2Muerte01_mc_168(){
super();
addFrameScript(49, frame50);
}
function frame50(){
stop();
}
}
}//package BunnyCharm_fla
Section 26 (329 B)
//manoMuerte01_mc_160 (BunnyCharm_fla.manoMuerte01_mc_160)
package BunnyCharm_fla {
import flash.display.*;
public dynamic class manoMuerte01_mc_160 extends MovieClip {
public function manoMuerte01_mc_160(){
super();
addFrameScript(49, frame50);
}
function frame50(){
stop();
}
}
}//package BunnyCharm_fla
Section 27 (389 B)
//mineButton_299 (BunnyCharm_fla.mineButton_299)
package BunnyCharm_fla {
import flash.display.*;
public dynamic class mineButton_299 extends MovieClip {
public var marcoBoton:MovieClip;
public function mineButton_299(){
super();
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package BunnyCharm_fla
Section 28 (413 B)
//mineButtonfreeze_305 (BunnyCharm_fla.mineButtonfreeze_305)
package BunnyCharm_fla {
import flash.display.*;
public dynamic class mineButtonfreeze_305 extends MovieClip {
public var marcoBoton:MovieClip;
public function mineButtonfreeze_305(){
super();
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package BunnyCharm_fla
Section 29 (393 B)
//MisilButton_294 (BunnyCharm_fla.MisilButton_294)
package BunnyCharm_fla {
import flash.display.*;
public dynamic class MisilButton_294 extends MovieClip {
public var marcoBoton:MovieClip;
public function MisilButton_294(){
super();
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package BunnyCharm_fla
Section 30 (298 B)
//navBer_204 (BunnyCharm_fla.navBer_204)
package BunnyCharm_fla {
import flash.display.*;
public dynamic class navBer_204 extends MovieClip {
public var downWindow:SimpleButton;
public var upWindow:SimpleButton;
public function navBer_204(){
super();
}
}
}//package BunnyCharm_fla
Section 31 (1.83 KiB) ●
//NG_AD_OBJECT_WITH_PRELOADER_1 (BunnyCharm_fla.NG_AD_OBJECT_WITH_PRELOADER_1)
package BunnyCharm_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.system.*;
import flash.net.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class NG_AD_OBJECT_WITH_PRELOADER_1 extends MovieClip {
public var ng_ad:MovieClip;
public var NG_Button:SimpleButton;
public function NG_AD_OBJECT_WITH_PRELOADER_1(){
super();
addFrameScript(0, frame1);
}
public function loadNGSite(event:Event){
NewgroundsAPI.loadNewgrounds();
}
public function startAd(ngad_url){
var ad_loader:URLLoader;
ad_loader = new URLLoader(new URLRequest(ngad_url));
ad_loader.addEventListener(Event.COMPLETE, ad_Loaded);
}
function frame1(){
Security.allowDomain("70.87.128.99");
Security.allowInsecureDomain("70.87.128.99");
Security.allowDomain("ads.shizmoo.com");
Security.allowInsecureDomain("ads.shizmoo.com");
Security.allowDomain("www.cpmstar.com");
Security.allowInsecureDomain("www.cpmstar.com");
Security.allowDomain("server.cpmstar.com");
Security.allowInsecureDomain("server.cpmstar.com");
if (NewgroundsAPI.getAdURL()){
startAd(NewgroundsAPI.getAdURL());
};
NewgroundsAPI.addEventListener(NewgroundsAPI.ADS_APPROVED, startAd);
NG_Button.addEventListener(MouseEvent.CLICK, loadNGSite);
stop();
}
public function ad_Loaded(event:Event){
var url:*;
var ad_loader:Loader;
url = String(event.target.data);
ad_loader = new Loader();
ad_loader.load(new URLRequest(url));
ng_ad.addChild(ad_loader);
}
}
}//package BunnyCharm_fla
Section 32 (476 B)
//NG_TANK_9 (BunnyCharm_fla.NG_TANK_9)
package BunnyCharm_fla {
import flash.events.*;
import flash.display.*;
public dynamic class NG_TANK_9 extends MovieClip {
public var NG_Logo:SimpleButton;
public function NG_TANK_9(){
super();
addFrameScript(0, frame1);
}
public function loadNGSite(event:Event){
NewgroundsAPI.loadNewgrounds();
}
function frame1(){
NG_Logo.addEventListener(MouseEvent.CLICK, loadNGSite);
}
}
}//package BunnyCharm_fla
Section 33 (278 B)
//obj01_289 (BunnyCharm_fla.obj01_289)
package BunnyCharm_fla {
import flash.display.*;
import flash.text.*;
public dynamic class obj01_289 extends MovieClip {
public var actualLevel:TextField;
public function obj01_289(){
super();
}
}
}//package BunnyCharm_fla
Section 34 (294 B)
//RangeIcon_280 (BunnyCharm_fla.RangeIcon_280)
package BunnyCharm_fla {
import flash.display.*;
import flash.text.*;
public dynamic class RangeIcon_280 extends MovieClip {
public var rangePoints:TextField;
public function RangeIcon_280(){
super();
}
}
}//package BunnyCharm_fla
Section 35 (460 B)
//rocketButton_318 (BunnyCharm_fla.rocketButton_318)
package BunnyCharm_fla {
import flash.display.*;
public dynamic class rocketButton_318 extends MovieClip {
public var block:MovieClip;
public var selected:MovieClip;
public var marcoBoton:MovieClip;
public function rocketButton_318(){
super();
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package BunnyCharm_fla
Section 36 (295 B)
//SpeedIcon_278 (BunnyCharm_fla.SpeedIcon_278)
package BunnyCharm_fla {
import flash.display.*;
import flash.text.*;
public dynamic class SpeedIcon_278 extends MovieClip {
public var healthPoints:TextField;
public function SpeedIcon_278(){
super();
}
}
}//package BunnyCharm_fla
Section 37 (809 B)
//TextInfo_319 (BunnyCharm_fla.TextInfo_319)
package BunnyCharm_fla {
import flash.display.*;
public dynamic class TextInfo_319 extends MovieClip {
public var unlockable:MovieClip;
public function TextInfo_319(){
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10);
}
function frame10(){
stop();
}
function frame3(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame1(){
unlockable.alpha = 0;
stop();
}
function frame4(){
stop();
}
function frame5(){
stop();
}
function frame9(){
stop();
}
function frame8(){
stop();
}
function frame2(){
unlockable.alpha = 0;
stop();
}
}
}//package BunnyCharm_fla
Section 38 (393 B)
//towerButton_293 (BunnyCharm_fla.towerButton_293)
package BunnyCharm_fla {
import flash.display.*;
public dynamic class towerButton_293 extends MovieClip {
public var marcoBoton:MovieClip;
public function towerButton_293(){
super();
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package BunnyCharm_fla
Section 39 (393 B)
//toxicButton_303 (BunnyCharm_fla.toxicButton_303)
package BunnyCharm_fla {
import flash.display.*;
public dynamic class toxicButton_303 extends MovieClip {
public var marcoBoton:MovieClip;
public function toxicButton_303(){
super();
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package BunnyCharm_fla
Section 40 (357 B)
//UPPoints_288 (BunnyCharm_fla.UPPoints_288)
package BunnyCharm_fla {
import flash.display.*;
import flash.text.*;
public dynamic class UPPoints_288 extends MovieClip {
public var totalPoints:TextField;
public function UPPoints_288(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BunnyCharm_fla
Section 41 (448 B)
//uziButton_315 (BunnyCharm_fla.uziButton_315)
package BunnyCharm_fla {
import flash.display.*;
public dynamic class uziButton_315 extends MovieClip {
public var block:MovieClip;
public var selected:MovieClip;
public var marcoBoton:MovieClip;
public function uziButton_315(){
super();
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package BunnyCharm_fla
Section 42 (388 B)
//WaveBar_170 (BunnyCharm_fla.WaveBar_170)
package BunnyCharm_fla {
import flash.display.*;
public dynamic class WaveBar_170 extends MovieClip {
public function WaveBar_170(){
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package BunnyCharm_fla
Section 43 (599 B)
//X_LOAD_2 (BunnyCharm_fla.X_LOAD_2)
package BunnyCharm_fla {
import flash.events.*;
import flash.display.*;
public dynamic class X_LOAD_2 extends MovieClip {
public var NGButton:SimpleButton;
public function X_LOAD_2(){
super();
addFrameScript(100, frame101, 150, frame151, 164, frame165);
}
function frame151(){
NGButton.addEventListener(MouseEvent.CLICK, PlayMovie);
}
function frame165(){
stop();
}
public function PlayMovie(event:Event){
gotoAndStop("end");
MovieClip(root).play();
}
function frame101(){
play();
}
}
}//package BunnyCharm_fla
Section 44 (369 B)
//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 45 (453 B)
//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 46 (883 B)
//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 47 (354 B)
//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 48 (357 B)
//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 49 (292 B)
//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 50 (274 B)
//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 51 (651 B)
//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 52 (482 B)
//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 53 (599 B)
//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 54 (343 B)
//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 55 (4.94 KiB) ●
//KongregateAPI (com.kongregate.as3.client.KongregateAPI)
package com.kongregate.as3.client {
import flash.events.*;
import flash.display.*;
import com.kongregate.as3.client.services.*;
import flash.utils.*;
import com.kongregate.as3.client.events.*;
import flash.system.*;
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 56 (4.25 KiB) ●
//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 function MochiScores(){
super();
}
public static function showLeaderboard(options:Object=null):void{
var options = options;
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();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
};
} else {
options = {};
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
if (options.onClose != null){
onCloseHandler = options.onClose;
} else {
onCloseHandler = function ():void{
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.play();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onClose.");
};
};
};
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(callbackObj:Object, callbackMethod:Object=null):void{
MochiServices.send("scores_getPlayerInfo", null, callbackObj, callbackMethod);
}
public static function requestList(callbackObj:Object, callbackMethod:Object=null):void{
MochiServices.send("scores_requestList", null, callbackObj, callbackMethod);
}
public static function scoresArrayToObjects(scores:Object):Object{
var so:Object;
var i:Number;
var j:Number;
var o:Object;
var row_obj:Object;
var item:String;
var param:String;
so = {};
for (item in scores) {
if (typeof(scores[item]) == "object"){
if (((!((scores[item].cols == null))) && (!((scores[item].rows == null))))){
so[item] = [];
o = scores[item];
j = 0;
while (j < o.rows.length) {
row_obj = {};
i = 0;
while (i < o.cols.length) {
row_obj[o.cols[i]] = o.rows[j][i];
i++;
};
so[item].push(row_obj);
j++;
};
} else {
so[item] = {};
for (param in scores[item]) {
so[item][param] = scores[item][param];
};
};
} else {
so[item] = scores[item];
};
};
return (so);
}
public static function submit(score:Number, name:String, callbackObj:Object=null, callbackMethod:Object=null):void{
MochiServices.send("scores_submit", {score:score, name:name}, callbackObj, callbackMethod);
}
public static function onClose(args:Object=null):void{
if (args != null){
if (args.error != null){
if (args.error == true){
if (onErrorHandler != null){
if (args.errorCode == null){
args.errorCode = "IOError";
};
onErrorHandler(args.errorCode);
MochiServices.doClose();
return;
};
};
};
};
onCloseHandler();
MochiServices.doClose();
}
public static function setBoardID(boardID:String):void{
MochiScores.boardID = boardID;
MochiServices.send("scores_setBoardID", {boardID:boardID});
}
}
}//package mochi
Section 57 (16.45 KiB) ● ● ●
//MochiServices (mochi.MochiServices)
package mochi {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.system.*;
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 function MochiServices(){
super();
}
public static function isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function send(methodName:String, args:Object=null, callbackObject:Object=null, callbackMethod:Object=null):void{
if (_connected){
_sendChannel.send(_sendChannelName, "onReceive", {methodName:methodName, args:args, callbackID:_clip._nextcallbackID});
} else {
if ((((_clip == null)) || (!(_connecting)))){
onError("NotConnected");
handleError(args, callbackObject, callbackMethod);
flush(true);
return;
};
_clip._queue.push({methodName:methodName, args:args, callbackID:_clip._nextcallbackID});
};
if (_clip != null){
if (((!((_clip._callbacks == null))) && (!((_clip._nextcallbackID == null))))){
_clip._callbacks[_clip._nextcallbackID] = {callbackObject:callbackObject, callbackMethod:callbackMethod};
_clip._nextcallbackID++;
};
};
}
public static function get connected():Boolean{
return (_connected);
}
private static function flush(error:Boolean):void{
var request:Object;
var callback:Object;
if (_clip != null){
if (_clip._queue != null){
while (_clip._queue.length > 0) {
request = _clip._queue.shift();
callback = null;
if (request != null){
if (request.callbackID != null){
callback = _clip._callbacks[request.callbackID];
};
delete _clip._callbacks[request.callbackID];
if (((error) && (!((callback == null))))){
handleError(request.args, callback.callbackObject, callback.callbackMethod);
};
};
};
};
};
}
private static function clickMovie(url:String, cb:Function):MovieClip{
var avm1_bytecode:Array;
var b:int;
var header:Array;
var footer:Array;
var mc:MovieClip;
var lc:LocalConnection;
var lc_name:String;
var ba:ByteArray;
var cpool:ByteArray;
var actionLength:uint;
var fileLength:uint;
var loader:Loader;
avm1_bytecode = [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];
header = [104, 0, 31, 64, 0, 7, 208, 0, 0, 12, 1, 0, 67, 2, 0xFF, 0xFF, 0xFF, 63, 3];
footer = [0, 64, 0, 0, 0];
mc = new MovieClip();
lc = new LocalConnection();
lc_name = ((("_click_" + Math.floor((Math.random() * 999999))) + "_") + Math.floor(new Date().getTime()));
lc = new LocalConnection();
mc.lc = lc;
mc.click = cb;
lc.client = mc;
lc.connect(lc_name);
ba = new ByteArray();
cpool = new ByteArray();
cpool.endian = Endian.LITTLE_ENDIAN;
cpool.writeShort(1);
cpool.writeUTFBytes(((url + " ") + lc_name));
cpool.writeByte(0);
actionLength = ((avm1_bytecode.length + cpool.length) + 4);
fileLength = (actionLength + 35);
ba.endian = Endian.LITTLE_ENDIAN;
ba.writeUTFBytes("FWS");
ba.writeByte(8);
ba.writeUnsignedInt(fileLength);
for each (b in header) {
ba.writeByte(b);
};
ba.writeUnsignedInt(actionLength);
ba.writeByte(136);
ba.writeShort(cpool.length);
ba.writeBytes(cpool);
for each (b in avm1_bytecode) {
ba.writeByte(b);
};
for each (b in footer) {
ba.writeByte(b);
};
loader = new Loader();
loader.loadBytes(ba);
mc.addChild(loader);
return (mc);
}
private static function init(id:String, clip:Object):void{
_id = id;
if (clip != null){
_container = clip;
loadCommunicator(id, _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(url:String, burl:String, btn:DisplayObjectContainer, onClick: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 = url;
var burl = burl;
var btn = btn;
var onClick = onClick;
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 (ev:Object):void{
netup = false;
ev.target.removeEventListener(ev.type, arguments.callee);
};
complete = function (ev:Object):void{
netup = true;
ev.target.removeEventListener(ev.type, arguments.callee);
};
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, err);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.load(req);
setURL = function ():void{
var u:String;
var avm1Click:DisplayObject;
if (netup){
u = (url + s);
} else {
u = burl;
};
avm1Click = clickMovie(u, onClick);
btn.addChild(avm1Click);
avm1Click.scaleX = (0.01 * btn.width);
avm1Click.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);
_listenChannel.close();
_rcvChannel.close();
//unresolved jump
var _slot1 = error;
};
if (_timer != null){
_timer.stop();
//unresolved jump
var _slot1 = error;
};
}
public static function allowDomains(server:String):String{
var hostname:String;
Security.allowDomain("*");
Security.allowInsecureDomain("*");
if (server.indexOf("http://") != -1){
hostname = server.split("/")[2].split(":")[0];
Security.allowDomain(hostname);
Security.allowInsecureDomain(hostname);
};
return (hostname);
}
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(container:Object=null, doAdd:Boolean=true):void{
if (container != null){
if ((container is Sprite)){
_container = container;
};
};
if (doAdd){
if ((_container is Sprite)){
Sprite(_container).addChild(_clip);
};
};
}
private static function onStatus(event:StatusEvent):void{
switch (event.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 (pkg:Object):void{
var cb:String;
var cblst:Object;
var method:*;
var methodName:String;
var obj:Object;
var pkg = pkg;
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];
} else {
trace((("Error: Method " + method) + " does not exist."));
};
};
if (method != undefined){
method.apply(obj, pkg.args);
//unresolved jump
var _slot1 = error;
trace(((("Error invoking callback method '" + methodName) + "': ") + pkg.toString()));
} else {
if (obj != null){
obj(pkg.args);
//unresolved jump
var _slot1 = error;
trace(("Error invoking method on object: " + pkg.toString()));
};
};
delete this.client._callbacks[cb];
};
_clip.onError = function ():void{
MochiServices.onError("IOError");
};
_rcvChannel.connect(_rcvChannelName);
trace("connected!");
_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 (args:Object):void{
MochiServices.comChannelName = args.newChannel;
};
_listenChannel.allowDomain("*", "localhost");
_listenChannel.allowInsecureDomain("*", "localhost");
_listenChannel.connect(_listenChannelName);
trace("Waiting for MochiAds services to connect...");
}
private static function handleError(args:Object, callbackObject:Object, callbackMethod:Object):void{
var args = args;
var callbackObject = callbackObject;
var callbackMethod = callbackMethod;
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)))){
var _local5 = callbackObject;
_local5[callbackMethod](args);
//unresolved jump
var _slot1 = error;
} else {
if (callbackMethod != null){
callbackMethod.apply(args);
//unresolved jump
var _slot1 = error;
};
};
};
}
public static function get clip():Object{
return (_container);
}
public static function set comChannelName(val:String):void{
if (val != null){
if (val.length > 3){
_sendChannelName = (val + "_fromgame");
_rcvChannelName = val;
initComChannels();
};
};
}
private static function loadCommunicator(id:String, clip:Object):MovieClip{
var clipname:String;
var f:Function;
var req:URLRequest;
var id = id;
var clip = clip;
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 (ev:Object):void{
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
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(e:Event):void{
var e = e;
if (MochiServices.clip != null){
if (MochiServices.childClip != null){
if (MochiServices.clip.numChildren > 1){
MochiServices.clip.setChildIndex(MochiServices.childClip, (MochiServices.clip.numChildren - 1));
};
//unresolved jump
var _slot1 = errorObject;
trace("Warning: Depth sort error.");
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
};
};
}
public static function connect(id:String, clip:Object, onError:Object=null):void{
var id = id;
var clip = clip;
var onError = onError;
if ((clip is DisplayObject)){
if (((!(_connected)) && ((_clip == null)))){
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
};
} else {
trace("Error, MochiServices requires a Sprite, Movieclip or instance of the stage.");
};
if (onError != null){
MochiServices.onError = onError;
} else {
if (MochiServices.onError == null){
MochiServices.onError = function (errorCode:String):void{
trace(errorCode);
};
};
};
}
public static function createEmptyMovieClip(parent:Object, name:String, depth:Number, doAdd:Boolean=true):MovieClip{
var mc:MovieClip;
var parent = parent;
var name = name;
var depth = depth;
var doAdd = doAdd;
mc = new MovieClip();
if (doAdd){
if (((false) && (depth))){
parent.addChildAt(mc, depth);
} else {
parent.addChild(mc);
};
};
parent[name] = mc;
//unresolved jump
var _slot1 = e;
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(e:TimerEvent):void{
if ((getTimer() - _startTime) > 10000){
if (!_connected){
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
MochiServices.disconnect();
MochiServices.onError("IOError");
};
_timer.stop();
};
}
}
}//package mochi
Section 58 (531 B)
//achBar (achBar)
package {
import flash.display.*;
import flash.text.*;
public dynamic class achBar extends MovieClip {
public var scoreS:TextField;
public var titleC:TextField;
public var titleS:TextField;
public var progressC:TextField;
public var descriptionC:TextField;
public var descriptionS:TextField;
public var scoreC:TextField;
public function achBar(){
super();
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 59 (4.21 KiB) ●
//AchievesWindow (AchievesWindow)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class AchievesWindow extends MovieClip {
public var masc:MovieClip;
public var padre:UICanvas;
public var okButton:SimpleButton;
public var navLevel:int;// = 0
public var oSelected:Number;
public var downButton:SimpleButton;
public var achieves:Array;
public var upButton:SimpleButton;
var interval:Timer;
public var achProgress:Array;
public var back:SimpleButton;
public var navBar:MovieClip;
public function AchievesWindow(padre:UICanvas){
var i:int;
navLevel = 0;
achieves = new Array();
achProgress = new Array();
super();
this.padre = padre;
i = 1;
while (i < 13) {
achieves.push(generateAchievement(i));
achProgress.push(achieves[(i - 1)].progressC);
i++;
};
okButton = back;
upButton = navBar.upWindow;
downButton = navBar.downWindow;
x = 275;
y = 200;
interval = new Timer((1000 / 24), 0);
okButton.addEventListener(MouseEvent.CLICK, backClick);
okButton.addEventListener(MouseEvent.ROLL_OVER, backOver);
okButton.addEventListener(MouseEvent.ROLL_OUT, backOut);
okButton.enabled = false;
upButton.addEventListener(MouseEvent.CLICK, upClick);
downButton.addEventListener(MouseEvent.CLICK, downClick);
alpha = 0;
}
public function backOut(event:MouseEvent):void{
}
public function downClick(event:MouseEvent):void{
var i:*;
if (navLevel < 20){
navLevel++;
i = 0;
while (i < achieves.length) {
achieves[i].y = (achieves[i].y - (achieves[i].height / 2));
i++;
};
};
}
function fadeOut(event:TimerEvent):void{
alpha = (alpha - 0.1);
okButton.enabled = false;
if (alpha <= 0){
interval.removeEventListener(TimerEvent.TIMER, fadeOut);
padre.addMainMenu();
padre.removeChild(this);
};
}
public function backOver(event:MouseEvent):void{
}
public function initAchievements(){
var i:*;
i = 0;
while (i < achieves.length) {
if (padre.local_data.data.achScoreList[i] > 0){
achieves[i].gotoAndStop("on");
achProgress[i].text = "Completed";
} else {
achieves[i].gotoAndStop("off");
if (padre.achieveSystem.achObjective[i] < 1000){
achProgress[i].text = ((padre.local_data.data.achCount[i] + "/") + padre.achieveSystem.achObjective[i]);
} else {
achProgress[i].text = (((padre.local_data.data.achCount[i] + "/") + (padre.achieveSystem.achObjective[i] / 1000)) + "k");
};
};
i++;
};
}
public function generateAchievement(value:Number){
var newAchieveBar:MovieClip;
newAchieveBar = new achBar();
if (value < 10){
newAchieveBar.titleC.text = Text[("AchieveTitle0" + value)];
newAchieveBar.titleS.text = Text[("AchieveTitle0" + value)];
newAchieveBar.descriptionC.text = Text[("AchieveDescription0" + value)];
} else {
newAchieveBar.titleC.text = Text[("AchieveTitle" + value)];
newAchieveBar.titleS.text = Text[("AchieveTitle" + value)];
newAchieveBar.descriptionC.text = Text[("AchieveDescription" + value)];
};
newAchieveBar.scoreC.text = (padre.local_data.data.achScoreList[(value - 1)] + "");
newAchieveBar.progressC.text = (padre.local_data.data.achCount[(value - 1)] + "");
newAchieveBar.descriptionS.text = "Achievement Completed!";
newAchieveBar.scoreS.text = (padre.achieveSystem.achActualScore[(value - 1)] + "");
newAchieveBar.y = (-57.5 + (62.5 * (value - 1)));
this.masc.addChild(newAchieveBar);
return (newAchieveBar);
}
function exitWindow(){
interval.addEventListener(TimerEvent.TIMER, fadeOut);
}
function fadeIn(event:TimerEvent):void{
alpha = (alpha + 0.1);
if (alpha >= 1){
okButton.enabled = true;
interval.removeEventListener(TimerEvent.TIMER, fadeIn);
};
}
public function upClick(event:MouseEvent):void{
var i:*;
if (navLevel > 0){
navLevel--;
i = 0;
while (i < achieves.length) {
achieves[i].y = (achieves[i].y + (achieves[i].height / 2));
i++;
};
};
}
public function backClick(event:MouseEvent):void{
exitWindow();
}
function enterWindow(){
interval.addEventListener(TimerEvent.TIMER, fadeIn);
interval.start();
}
}
}//package
Section 60 (3.89 KiB) ●
//AchieveSystem (AchieveSystem)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class AchieveSystem {
public var interval:Timer;
public var padre:UICanvas;
public var achieveScore:Number;// = 0
public var achObjective:Array;
public var madeIt:Boolean;
public var achCount:Array;
public var achScoreList:Array;
public var nivelEscalar:Array;
public var achieveLevel:Number;// = 1
public var achMes:MovieClip;
public var contador:int;// = 20
public var achActualScore:Array;
public function AchieveSystem(){
achScoreList = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
achCount = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
achObjective = [1, 1, 1, 1, 5000, 3000, 3000, 3000, 3000, 3000, 3000, 25000];
achActualScore = [100, 200, 300, 600, 200, 400, 500, 600, 700, 800, 900, 1200];
nivelEscalar = [500, 1500, 3500, 6500, 10000];
achieveLevel = 1;
achieveScore = 0;
contador = 20;
super();
}
public function initAchievements(){
interval = new Timer((1000 / 24), 0);
if (padre.local_data.data.achScoreList == undefined){
padre.local_data.data.achScoreList = achScoreList;
padre.local_data.data.achieveScore = achieveScore;
padre.local_data.data.achieveLevel = achieveLevel;
padre.local_data.data.achCount = achCount;
padre.local_data.flush();
};
}
public function achMessage(value:int, nextLevel:Boolean){
exitWindow();
}
public function exitWindow(){
interval.delay = (1000 / 24);
interval.addEventListener(TimerEvent.TIMER, fadeOut);
contador = (1500 / 24);
interval.start();
}
public function saveAchievement(value:Number){
padre.local_data.data.achScoreList[value] = achActualScore[value];
padre.local_data.data.achieveScore = (padre.local_data.data.achieveScore + achActualScore[value]);
if ((((padre.local_data.data.achieveScore < nivelEscalar[0])) && ((padre.local_data.data.achieveLevel == 1)))){
padre.local_data.data.achieveLevel = 1;
};
if ((((((padre.local_data.data.achieveScore >= nivelEscalar[0])) && ((padre.local_data.data.achieveScore < nivelEscalar[1])))) && ((padre.local_data.data.achieveLevel < 2)))){
padre.local_data.data.achieveLevel = 2;
achMessage(0, true);
};
if ((((((padre.local_data.data.achieveScore >= nivelEscalar[1])) && ((padre.local_data.data.achieveScore < nivelEscalar[2])))) && ((padre.local_data.data.achieveLevel < 3)))){
padre.local_data.data.achieveLevel = 3;
achMessage(0, true);
};
if ((((((padre.local_data.data.achieveScore >= nivelEscalar[2])) && ((padre.local_data.data.achieveScore < nivelEscalar[3])))) && ((padre.local_data.data.achieveLevel < 4)))){
padre.local_data.data.achieveLevel = 4;
achMessage(0, true);
};
if ((((((padre.local_data.data.achieveScore >= nivelEscalar[3])) && ((padre.local_data.data.achieveScore < nivelEscalar[4])))) && ((padre.local_data.data.achieveLevel < 5)))){
padre.local_data.data.achieveLevel = 5;
achMessage(0, true);
};
padre.local_data.flush();
}
public function achControl(value:int){
var _local2 = padre.local_data.data.achCount;
var _local3 = value;
var _local4 = (_local2[_local3] + 1);
_local2[_local3] = _local4;
if (padre.local_data.data.achCount[value] >= achObjective[value]){
if (padre.local_data.data.achScoreList[value] == 0){
saveAchievement(value);
padre.scoreSystem.submitScore(5, padre.local_data.data.achieveScore);
achMessage(value, false);
};
padre.local_data.data.achCount[value] = achObjective[value];
};
}
function fadeOut(event:TimerEvent):void{
contador--;
if (contador <= 0){
achMes.alpha = (achMes.alpha - 0.1);
if (achMes.alpha <= 0){
interval.removeEventListener(TimerEvent.TIMER, fadeOut);
padre.main.removeChild(achMes);
};
};
}
}
}//package
Section 61 (245 B)
//AchMessageMC (AchMessageMC)
package {
import flash.display.*;
import flash.text.*;
public dynamic class AchMessageMC extends MovieClip {
public var levelStatus:TextField;
public function AchMessageMC(){
super();
}
}
}//package
Section 62 (9.09 KiB) ● ●
//AStar (AStar)
package {
public class AStar {
public static const PENDIENTE:int = 0;
public static const IMPOSIBLE:int = 3;
public static const CERRADO:int = 2;
public static const ABIERTO:int = 1;
private static var bases:Array;
public static var lista:AStarNode;
public static var levelData:Array;
public static var isRoad:Boolean = false;
private static var camino:Array;
public function AStar(){
super();
}
private static function agregarVecinos(i:int, j:int, costo:int, baseDestino:int){
var n:AStarNode;
if ((i - 1) >= 0){
n = levelData[(i - 1)][j];
if (n.estado == PENDIENTE){
addNode(n, i, j, (costo + 32), baseDestino);
} else {
if (n.estado == ABIERTO){
if (n.costoHastaAqui > (costo + 32)){
n.updateData((costo + 10), i, j, baseDestino);
};
};
};
};
if ((i + 1) < levelData[0].length){
n = levelData[(i + 1)][j];
if (n.estado == PENDIENTE){
addNode(n, i, j, (costo + 32), baseDestino);
} else {
if (n.estado == ABIERTO){
if (n.costoHastaAqui > (costo + 32)){
n.updateData((costo + 32), i, j, baseDestino);
};
};
};
};
if ((j - 1) >= 0){
n = levelData[i][(j - 1)];
if (n.estado == PENDIENTE){
addNode(n, i, j, (costo + 32), baseDestino);
} else {
if (n.estado == ABIERTO){
if (n.costoHastaAqui > (costo + 32)){
n.updateData((costo + 32), i, j, baseDestino);
};
};
};
};
if ((j + 1) < levelData[0].length){
n = levelData[i][(j + 1)];
if (n.estado == PENDIENTE){
addNode(n, i, j, (costo + 32), baseDestino);
} else {
if (n.estado == ABIERTO){
if (n.costoHastaAqui > (costo + 32)){
n.updateData((costo + 32), i, j, baseDestino);
};
};
};
};
if (((((i - 1) >= 0)) && (((j - 1) >= 0)))){
if (((!((levelData[(i - 1)][j].estado == IMPOSIBLE))) && (!((levelData[i][(j - 1)].estado == IMPOSIBLE))))){
n = levelData[(i - 1)][(j - 1)];
if (n.estado == PENDIENTE){
addNode(n, i, j, (costo + 45), baseDestino);
} else {
if (n.estado == ABIERTO){
if (n.costoHastaAqui > (costo + 45)){
n.updateData((costo + 45), i, j, baseDestino);
};
};
};
};
};
if (((((i - 1) >= 0)) && (((j + 1) < levelData[0].length)))){
if (((!((levelData[(i - 1)][j].estado == IMPOSIBLE))) && (!((levelData[i][(j + 1)].estado == IMPOSIBLE))))){
n = levelData[(i - 1)][(j + 1)];
if (n.estado == PENDIENTE){
addNode(n, i, j, (costo + 45), baseDestino);
} else {
if (n.estado == ABIERTO){
if (n.costoHastaAqui > (costo + 45)){
n.updateData((costo + 45), i, j, baseDestino);
};
};
};
};
};
if (((((i + 1) < levelData.length)) && (((j + 1) < levelData[0].length)))){
if (((!((levelData[(i + 1)][j].estado == IMPOSIBLE))) && (!((levelData[i][(j + 1)].estado == IMPOSIBLE))))){
n = levelData[(i + 1)][(j + 1)];
if (n.estado == PENDIENTE){
addNode(n, i, j, (costo + 45), baseDestino);
} else {
if (n.estado == ABIERTO){
if (n.costoHastaAqui > (costo + 45)){
n.updateData((costo + 45), i, j, baseDestino);
};
};
};
};
};
if (((((i + 1) < levelData.length)) && (((j - 1) >= 0)))){
if (((!((levelData[(i + 1)][j].estado == IMPOSIBLE))) && (!((levelData[i][(j - 1)].estado == IMPOSIBLE))))){
n = levelData[(i + 1)][(j - 1)];
if (n.estado == PENDIENTE){
addNode(n, i, j, (costo + 45), baseDestino);
} else {
if (n.estado == ABIERTO){
if (n.costoHastaAqui > (costo + 45)){
n.updateData((costo + 45), i, j, baseDestino);
};
};
};
};
};
}
private static function findLowestAndRemoveIt():AStarNode{
var n:AStarNode;
var minimo:int;
var minNode:AStarNode;
n = null;
n = lista;
minimo = int.MAX_VALUE;
minNode = null;
while (n != null) {
if (n.total <= minimo){
if ((((Math.random() < 0.5)) || ((minimo == int.MAX_VALUE)))){
minimo = n.total;
minNode = n;
};
};
n = n.nextNode;
};
if (minNode != null){
if (minNode.prevNode != null){
minNode.prevNode.nextNode = minNode.nextNode;
} else {
lista = minNode.nextNode;
};
if (minNode.nextNode != null){
minNode.nextNode.prevNode = minNode.prevNode;
};
};
return (minNode);
}
public static function updateEstimate(estimatedBase:int, modX:int, modY:int, newI:int, newJ:int){
var i:int;
var j:int;
i = 0;
while (i < levelData.length) {
j = 0;
while (j < levelData[i].length) {
if (levelData[i][j].estado != IMPOSIBLE){
if ((((i == 7)) && ((j == 7)))){
};
if (j < newJ){
levelData[i][j].estimadoDesdeAqui[estimatedBase] = (levelData[i][j].estimadoDesdeAqui[estimatedBase] + modX);
} else {
if (j > newJ){
levelData[i][j].estimadoDesdeAqui[estimatedBase] = (levelData[i][j].estimadoDesdeAqui[estimatedBase] - modX);
} else {
levelData[i][j].estimadoDesdeAqui[estimatedBase] = (levelData[i][j].estimadoDesdeAqui[estimatedBase] - Math.abs(modX));
};
};
if (i < newI){
levelData[i][j].estimadoDesdeAqui[estimatedBase] = (levelData[i][j].estimadoDesdeAqui[estimatedBase] + modY);
} else {
if (i > newI){
levelData[i][j].estimadoDesdeAqui[estimatedBase] = (levelData[i][j].estimadoDesdeAqui[estimatedBase] - modY);
} else {
levelData[i][j].estimadoDesdeAqui[estimatedBase] = (levelData[i][j].estimadoDesdeAqui[estimatedBase] - Math.abs(modY));
};
};
};
j++;
};
i++;
};
}
private static function addNode(n:AStarNode, padreI:int, padreJ:int, costo:int, baseDestino:int){
n.estado = ABIERTO;
n.origenI = padreI;
n.origenJ = padreJ;
n.costoHastaAqui = costo;
n.calcularTotal(baseDestino);
n.prevNode = null;
n.nextNode = lista;
if (lista != null){
lista.prevNode = n;
};
lista = n;
}
private static function initializaData(baseDestino:int){
var i:int;
var j:int;
i = 0;
while (i < levelData.length) {
j = 0;
while (j < levelData[i].length) {
if (levelData[i][j].estado != IMPOSIBLE){
levelData[i][j].estado = PENDIENTE;
levelData[i][j].costoHastaAqui = 0;
if (baseDestino == Parametros.MaximaCantidadDeBases){
};
levelData[i][j].calcularTotal(baseDestino);
};
j++;
};
i++;
};
lista = null;
}
private static function search(baseDestino:int){
var nodo:AStarNode;
while (lista != null) {
nodo = findLowestAndRemoveIt();
if ((((nodo.i == bases[baseDestino].i)) && ((nodo.j == bases[baseDestino].j)))){
isRoad = true;
return;
};
agregarVecinos(nodo.i, nodo.j, nodo.costoHastaAqui, baseDestino);
};
isRoad = false;
return (null);
}
public static function buildData(nivel:Array, p:Player){
var playerI:int;
var playerJ:int;
var i:int;
var j:int;
var h:int;
levelData = new Array(nivel.length);
bases = p.bases;
playerI = Math.floor((p.posicion.X / Parametros.TamanyoTile));
playerJ = Math.floor((p.posicion.Y / Parametros.TamanyoTile));
i = 0;
while (i < nivel.length) {
levelData[i] = new Array(nivel[i].length);
j = 0;
while (j < nivel[i].length) {
levelData[i][j] = new AStarNode(i, j);
if (nivel[i][j] >= 1){
levelData[i][j].estado = IMPOSIBLE;
};
h = 0;
while (h < bases.length) {
levelData[i][j].estimadoDesdeAqui[h] = ((Math.abs((bases[h].j - j)) + Math.abs((bases[h].i - i))) * Parametros.TamanyoTile);
h++;
};
levelData[i][j].estimadoDesdeAqui[Parametros.MaximaCantidadDeBases] = ((Math.abs((playerI - i)) + Math.abs((playerJ - j))) * Parametros.TamanyoTile);
j++;
};
i++;
};
}
public static function findPath(x:Number, y:Number, baseDestino:int):Array{
var originI:int;
var originJ:int;
var n:AStarNode;
originI = int((y / 32));
if (originI < 0){
originI = 0;
} else {
if (originI >= levelData.length){
originI = (levelData.length - 1);
};
};
originJ = int((x / 32));
if (originJ < 0){
originJ = 0;
} else {
if (originJ >= levelData[0].length){
originJ = (levelData[0].length - 1);
};
};
camino = new Array();
initializaData(baseDestino);
levelData[originI][originJ].estado = ABIERTO;
levelData[originI][originJ].origenI = (levelData[originI][originJ].origenJ = -1);
levelData[originI][originJ].costoHastaAqui = 0;
levelData[originI][originJ].calcularTotal(baseDestino);
lista = levelData[originI][originJ];
lista.prevNode = (lista.nextNode = null);
search(baseDestino);
n = levelData[bases[baseDestino].i][bases[baseDestino].j];
while (((((!((n.origenI == -1))) && (!((n.origenJ == -1))))) && (isRoad))) {
camino.push(n.i);
camino.push(n.j);
n = levelData[n.origenI][n.origenJ];
};
camino.push(n.i);
camino.push(n.j);
return (camino);
}
}
}//package
Section 63 (806 B)
//AStarNode (AStarNode)
package {
public class AStarNode {
public var total:int;
public var costoHastaAqui:int;
public var prevNode:AStarNode;
public var estimadoDesdeAqui:Array;
public var origenI:int;
public var origenJ:int;
public var nextNode:AStarNode;
public var estado:int;
public var i:int;
public var j:int;
public function AStarNode(i:int, j:int){
super();
this.i = i;
this.j = j;
estimadoDesdeAqui = new Array((Parametros.MaximaCantidadDeBases + 1));
}
public function updateData(costo:int, i:int, j:int, baseDestino:int){
this.costoHastaAqui = costo;
origenI = i;
origenJ = j;
calcularTotal(baseDestino);
}
public function calcularTotal(baseDestino:int){
total = (costoHastaAqui + estimadoDesdeAqui[baseDestino]);
}
}
}//package
Section 64 (148 B)
//Auch (Auch)
package {
import flash.media.*;
public dynamic class Auch extends Sound {
public function Auch(){
super();
}
}
}//package
Section 65 (178 B)
//AutoBarrel (AutoBarrel)
package {
import flash.display.*;
public dynamic class AutoBarrel extends MovieClip {
public function AutoBarrel(){
super();
}
}
}//package
Section 66 (7.01 KiB) ● ●
//Bala (Bala)
package {
import flash.display.*;
import flash.utils.*;
public class Bala extends ObjetoListaEnlazada {
public var level:CanvasScenario;
public var padre:MovieClip;
public var speed:Number;// = 15
public var radioDisparo:Number;// = 100
public var interval:Timer;
public var radioObjetivo:Number;
public var posicion:Vector2D;
public var movieClip:MovieClip;
public var tipoMuerte:int;
public var killIt:Boolean;// = false
public var isPlayer:Boolean;// = false
public var velocidad:Vector2D;
public function Bala(level:CanvasScenario, x:Number, y:Number, map:MovieClip, radio:Number, pointerX:Number, pointerY:Number, isPlayer:Boolean){
var deltaX:*;
var deltaY:*;
var divisor:Number;
var angulo:Number;
speed = 15;
radioDisparo = 100;
killIt = false;
isPlayer = false;
super();
this.level = level;
padre = map;
posicion = new Vector2D();
posicion.X = x;
posicion.Y = y;
movieClip = new bala_mc();
level.padre.layerParticle.addChild(movieClip);
movieClip.x = posicion.X;
movieClip.y = posicion.Y;
if (isPlayer == false){
speed = 2;
};
this.velocidad = new Vector2D();
deltaX = ((pointerX - padre.x) - x);
deltaY = ((pointerY - padre.y) - y);
divisor = Math.sqrt(((deltaX * deltaX) + (deltaY * deltaY)));
this.velocidad.X = ((speed * deltaX) / divisor);
this.velocidad.Y = ((speed * deltaY) / divisor);
radioObjetivo = (radioDisparo = radio);
this.isPlayer = isPlayer;
angulo = Math.atan((velocidad.Y / velocidad.X));
if ((x + map.x) > pointerX){
movieClip.rotation = (((angulo * 180) / 3.14) + 180);
} else {
movieClip.rotation = ((angulo * 180) / 3.14);
};
if (isPlayer == true){
switch (level.player.currentWeapon){
case 0:
level.padre.padre.soundSystem.gunA.play(0, 1, level.padre.padre.soundSystem.volPrincipal);
movieClip.gotoAndStop(1);
break;
case 1:
level.padre.padre.soundSystem.gunD.play(0, 1, level.padre.padre.soundSystem.volPrincipal);
movieClip.gotoAndStop(1);
break;
case 2:
level.padre.padre.soundSystem.shotgun.play(0, 1, level.padre.padre.soundSystem.volPrincipal);
movieClip.gotoAndStop(2);
break;
case 3:
level.padre.padre.soundSystem.gunB.play(0, 1, level.padre.padre.soundSystem.volPrincipal);
movieClip.gotoAndStop(3);
break;
case 4:
level.padre.padre.soundSystem.gunC.play(0, 1, level.padre.padre.soundSystem.volPrincipal);
movieClip.gotoAndStop(4);
break;
case 5:
level.padre.padre.soundSystem.gunF.play(0, 1, level.padre.padre.soundSystem.volPrincipal);
movieClip.gotoAndStop(9);
break;
};
} else {
movieClip.gotoAndStop("enemigo1");
};
this.movieClip.x = (this.movieClip.x + (velocidad.X / 2));
this.movieClip.y = (this.movieClip.y + (velocidad.Y / 2));
}
public function update(){
var animDin:MovieClip;
var _local2:Number;
if (level.padre.isRun){
this.movieClip.x = (this.movieClip.x + velocidad.X);
this.movieClip.y = (this.movieClip.y + velocidad.Y);
radioDisparo = (radioDisparo - speed);
if (level.collisionMap[Math.floor((movieClip.y / 32))][Math.floor((movieClip.x / 32))] == 1){
killIt = true;
if (isPlayer == true){
tipoMuerte = 1;
} else {
tipoMuerte = 3;
};
};
if (killIt == false){
if (isPlayer == true){
} else {
if (((((((((!((level.player.movieClip == null))) && ((movieClip.x > (level.player.movieClip.x - 10))))) && ((movieClip.x < (level.player.movieClip.x + 10))))) && ((movieClip.y > (level.player.movieClip.y - 16))))) && ((movieClip.y < (level.player.movieClip.y + 16))))){
level.player.sufrirDanyo(0.05);
killIt = true;
tipoMuerte = 3;
};
};
if ((((radioDisparo <= (radioObjetivo / 1.2))) && ((killIt == false)))){
movieClip.alpha = (movieClip.alpha / 1.5);
if (radioDisparo <= 0){
killIt = true;
};
};
};
if (killIt){
trace(("asdsasdsad " + tipoMuerte));
switch (tipoMuerte){
case 1:
switch (level.player.currentWeapon){
case 0:
case 1:
case 2:
case 3:
case 4:
_local2 = Math.floor((Math.random() * 4));
switch (_local2){
case 0:
level.padre.padre.soundSystem.rebote1.play(0, 1, level.padre.padre.soundSystem.volPrincipal);
break;
case 1:
level.padre.padre.soundSystem.rebote2.play(0, 1, level.padre.padre.soundSystem.volPrincipal);
break;
case 2:
level.padre.padre.soundSystem.rebote3.play(0, 1, level.padre.padre.soundSystem.volPrincipal);
break;
case 3:
level.padre.padre.soundSystem.rebote4.play(0, 1, level.padre.padre.soundSystem.volPrincipal);
break;
case 4:
level.padre.padre.soundSystem.rebote4.play(0, 1, level.padre.padre.soundSystem.volPrincipal);
break;
};
animDin = new muerteBalaMC();
animDin.x = movieClip.x;
animDin.y = movieClip.y;
padre.addChild(animDin);
animDin.scaleX = (animDin.scaleX * 0.25);
animDin.scaleY = (animDin.scaleY * 0.25);
animDin.alpha = 1;
animDin.play();
break;
case 5:
level.padre.padre.soundSystem.exploRocket.play(0, 1, level.padre.padre.soundSystem.volPrincipal);
animDin = new explocion_mc();
animDin.x = movieClip.x;
animDin.y = movieClip.y;
padre.addChild(animDin);
animDin.scaleX = (animDin.scaleX * 0.5);
animDin.scaleY = (animDin.scaleY * 0.5);
animDin.alpha = 1;
animDin.play();
break;
};
break;
case 2:
switch (level.player.currentWeapon){
case 4:
trace("asdsasdsad");
animDin = new ImpactoEnEnemigo();
animDin.x = movieClip.x;
animDin.y = movieClip.y;
padre.addChild(animDin);
animDin.alpha = 1;
animDin.play();
break;
case 5:
level.padre.padre.soundSystem.exploRocket.play(0, 1, level.padre.padre.soundSystem.volPrincipal);
animDin = new explocion_mc();
animDin.x = movieClip.x;
animDin.y = movieClip.y;
padre.addChild(animDin);
animDin.scaleX = (animDin.scaleX * 0.5);
animDin.scaleY = (animDin.scaleY * 0.5);
animDin.alpha = 1;
animDin.play();
break;
};
break;
case 3:
level.padre.padre.soundSystem.impactoEnemigo1.play(0, 1, level.padre.padre.soundSystem.volPrincipal);
animDin = new muerteBalaMC();
animDin.x = movieClip.x;
animDin.y = movieClip.y;
padre.addChild(animDin);
animDin.scaleX = (animDin.scaleX * 0.25);
animDin.scaleY = (animDin.scaleY * 0.25);
animDin.alpha = 1;
animDin.play();
break;
};
this.level.padre.layerParticle.removeChild(this.movieClip);
};
};
}
}
}//package
Section 67 (708 B)
//bala_mc (bala_mc)
package {
import flash.display.*;
public dynamic class bala_mc extends MovieClip {
public function bala_mc(){
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10, 10, frame11);
}
function frame10(){
stop();
}
function frame3(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame1(){
stop();
}
function frame4(){
stop();
}
function frame5(){
stop();
}
function frame9(){
stop();
}
function frame8(){
stop();
}
function frame2(){
stop();
}
function frame11(){
stop();
}
}
}//package
Section 68 (162 B)
//BalaMC (BalaMC)
package {
import flash.display.*;
public dynamic class BalaMC extends MovieClip {
public function BalaMC(){
super();
}
}
}//package
Section 69 (162 B)
//Barrel (Barrel)
package {
import flash.display.*;
public dynamic class Barrel extends MovieClip {
public function Barrel(){
super();
}
}
}//package
Section 70 (5.28 KiB) ● ●
//Base (Base)
package {
import flash.display.*;
public class Base {
public var barra:MovieClip;
public var rayCounter:int;
public var level:CanvasScenario;
public var _domMask:MovieClip;
public var id:int;
public var fireWeapon:Function;
public var movieClip:MovieClip;
public var isConquered:Boolean;
public var isAttacked:Boolean;
public var radioDisparoSq:Number;// = 2500
public var machineGunCounter:int;// = 0
public var rayMC:MovieClip;
public var currentRotacion:Number;
public var conqObjective:int;// = 200
public var energiaInicial:Number;
public var domMC:MovieClip;
public var posicion:Vector2D;
public var i:int;
public var j:int;
public var deltaAim:Vector2D;
public var energia:Number;// = 0
public var isConquering:Boolean;
public var conqProgress:int;
public function Base(id:int, i:int, j:int, level:CanvasScenario, isPlayer:Boolean){
energia = 0;
radioDisparoSq = (Parametros.RadioDisparoBase * Parametros.RadioDisparoBase);
machineGunCounter = 0;
conqObjective = 200;
super();
isConquering = false;
isConquered = false;
isAttacked = false;
this.id = id;
this.i = i;
this.j = j;
posicion = new Vector2D();
posicion.X = ((j * Parametros.TamanyoTile) + (Parametros.TamanyoTile / 2));
posicion.Y = ((i * Parametros.TamanyoTile) + (Parametros.TamanyoTile / 2));
this.level = level;
if (isPlayer == false){
domMC = new domCircle();
domMC.x = (j * Parametros.TamanyoTile);
domMC.y = (i * Parametros.TamanyoTile);
level.map.addChild(domMC);
domMC.visible = true;
_domMask = domMC.domMask;
_domMask.scaleX = (conqProgress / conqObjective);
conqObjective = 2000;
};
deltaAim = new Vector2D();
movieClip = new BaseMC();
movieClip.visible = false;
movieClip.x = posicion.X;
movieClip.y = posicion.Y;
barra = new EnergyBar();
barra.visible = false;
barra.y = (movieClip.y + (movieClip.height / 2));
barra.x = movieClip.x;
level.map.addChild(barra);
level.map.addChild(movieClip);
rayMC = new Rayo();
rayMC.visible = false;
level.map.addChild(rayMC);
fireWeapon = fireMachineGun;
}
function fireRay(){
deltaAim.normalize(20);
rayMC.x = (deltaAim.X + movieClip.x);
rayMC.y = (deltaAim.Y + movieClip.y);
currentRotacion = (90 - (Math.atan2(-(deltaAim.Y), deltaAim.X) * (180 / Math.PI)));
rayMC.rotation = currentRotacion;
if (currentRotacion < -22.5){
currentRotacion = (currentRotacion + 360);
};
currentRotacion = (currentRotacion + 22.5);
currentRotacion = ((Math.floor((currentRotacion / 45)) * 10) + 1);
movieClip.gotoAndStop(currentRotacion);
rayMC.visible = true;
rayCounter = 2;
deltaAim.X = (deltaAim.X * 5);
deltaAim.Y = (deltaAim.Y * 5);
}
public function revivir(){
movieClip.visible = true;
energia = (energiaInicial = Parametros.EnergiaInicialBase);
barra.green.scaleX = 1;
barra.green.visible = true;
barra.visible = true;
level.collisionMap[i][j] = 1;
}
public function update(){
if (rayCounter > 0){
rayCounter--;
} else {
rayMC.visible = false;
};
fireWeapon();
}
function fireMachineGun(){
var objetivo:Enemigo;
if (machineGunCounter <= 0){
objetivo = level.getCloserEnemy(posicion, radioDisparoSq);
if (objetivo != null){
deltaAim.subAndAssign(objetivo.posicion, posicion);
level.newAddBullet(posicion.X, posicion.Y, 150, objetivo.posicion.X, objetivo.posicion.Y, false);
machineGunCounter = Parametros.BaseMachineGunReload;
};
} else {
if (machineGunCounter > 0){
machineGunCounter--;
};
};
}
public function reset(){
isConquered = false;
isConquering = false;
conqProgress = 0;
domMC.gotoAndStop(1);
_domMask.scaleX = (conqProgress / conqObjective);
}
public function sufrirDanyo(danyo:Number){
energia = (energia - danyo);
if (energia > 0){
barra.green.scaleX = (energia / energiaInicial);
} else {
barra.green.visible = false;
movieClip.visible = false;
rayMC.visible = false;
barra.visible = false;
level.collisionMap[i][j] = 0;
level.torretaDestruida(id);
};
}
public function setPosicion(x:Number, y:Number, i:int, j:int){
this.i = i;
this.j = j;
this.posicion.X = x;
this.posicion.Y = y;
}
public function conquestProgress(isPositive:Boolean){
if (isPositive){
conqProgress = (conqProgress + 10);
_domMask.scaleX = (conqProgress / conqObjective);
if (conqProgress >= conqObjective){
if (level.padre.player.domination == (level.baseEsperada.length - 1)){
level.padre.hudMenu.conqueringMessage(false);
level.padre.hudMenu.pointControledMessage(true);
} else {
level.padre.hudMenu.conqueringMessage(false);
level.padre.hudMenu.pointControledMessage(false);
};
isConquered = true;
conqProgress = conqObjective;
domMC.gotoAndStop(3);
level.player.updateExperience(5);
level.padre.hudMenu._totalPoints.text = ("" + level.player.points);
level.padre.hudMenu.upgradeUpgrade(level.player.points);
} else {
isConquered = false;
};
} else {
isConquered = false;
if (conqProgress > 0){
if (conqProgress <= 0){
conqProgress = 0;
};
_domMask.scaleX = (conqProgress / conqObjective);
};
};
}
}
}//package
Section 71 (579 B)
//BaseMC (BaseMC)
package {
import flash.display.*;
public dynamic class BaseMC extends MovieClip {
public function BaseMC(){
super();
addFrameScript(0, frame1, 10, frame11, 20, frame21, 30, frame31, 40, frame41, 50, frame51, 60, frame61, 70, frame71);
}
function frame71(){
stop();
}
function frame1(){
stop();
}
function frame21(){
stop();
}
function frame31(){
stop();
}
function frame11(){
stop();
}
function frame41(){
stop();
}
function frame51(){
stop();
}
function frame61(){
stop();
}
}
}//package
Section 72 (186 B)
//bolaFuego_mc (bolaFuego_mc)
package {
import flash.display.*;
public dynamic class bolaFuego_mc extends MovieClip {
public function bolaFuego_mc(){
super();
}
}
}//package
Section 73 (198 B)
//bombaMinaGas_mc (bombaMinaGas_mc)
package {
import flash.display.*;
public dynamic class bombaMinaGas_mc extends MovieClip {
public function bombaMinaGas_mc(){
super();
}
}
}//package
Section 74 (206 B)
//bombaMinaHielo_mc (bombaMinaHielo_mc)
package {
import flash.display.*;
public dynamic class bombaMinaHielo_mc extends MovieClip {
public function bombaMinaHielo_mc(){
super();
}
}
}//package
Section 75 (152 B)
//Bonus (Bonus)
package {
import flash.media.*;
public dynamic class Bonus extends Sound {
public function Bonus(){
super();
}
}
}//package
Section 76 (714 B)
//BonusObtained (BonusObtained)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public dynamic class BonusObtained extends MovieClip {
public var actualTic:Number;
public var interval:Timer;
public function BonusObtained(){
super();
addFrameScript(0, frame1);
}
function frame1(){
actualTic = 3;
interval = new Timer(1000, 0);
interval.addEventListener(TimerEvent.TIMER, tic);
interval.start();
}
public function tic(event:TimerEvent):void{
this.actualTic--;
if (this.actualTic == 0){
this.interval.stop();
this.interval.removeEventListener(TimerEvent.TIMER, this.tic);
this.parent.removeChild(this);
};
}
}
}//package
Section 77 (154 B)
//Boss (Boss)
package {
import flash.display.*;
public dynamic class Boss extends MovieClip {
public function Boss(){
super();
}
}
}//package
Section 78 (178 B)
//boxTrap_mc (boxTrap_mc)
package {
import flash.display.*;
public dynamic class boxTrap_mc extends MovieClip {
public function boxTrap_mc(){
super();
}
}
}//package
Section 79 (148 B)
//BumA (BumA)
package {
import flash.media.*;
public dynamic class BumA extends Sound {
public function BumA(){
super();
}
}
}//package
Section 80 (7.92 KiB) ● ●
//Canvas (Canvas)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
public class Canvas extends MovieClip {
public var layerScenario:MovieClip;
public var layerParticle:MovieClip;
public var canvasScenario:CanvasScenario;
public var gameOverMC:MovieClip;
public var padre:UICanvas;
var mouseInLevel:Vector2D;
public var layerTraps:MovieClip;
public var isRun:Boolean;
public var dificultad:int;
var difference:int;// = 33
public var cursor:MovieClip;
public var isWin:Boolean;
var lastDate:uint;// = 0
var newDate:Date;
public var intervalo:Timer;
public var layerEnemies:MovieClip;
public var ingame:Boolean;
public var layerPlayer:MovieClip;
var mouseInScreen:Vector2D;
public var FrameRate:Number;// = 30
public var player:Player;
public var layerHud:MovieClip;
public var hudMenu:HudMenu;
public static const APPLICATION_HEIGHT:Number = 410;
public static const APPLICATION_WIDTH:Number = (700 - HUD_WIDTH);
public static const FRAME_RATE:int = 25;
public static const HUD_WIDTH:Number = 0;
public function Canvas(){
FrameRate = 30;
lastDate = 0;
difference = 33;
super();
layerScenario = new MovieClip();
this.addChild(layerScenario);
layerTraps = new MovieClip();
this.addChild(layerTraps);
layerEnemies = new MovieClip();
this.addChild(layerEnemies);
layerPlayer = new MovieClip();
this.addChild(layerPlayer);
layerParticle = new MovieClip();
this.addChild(layerParticle);
layerHud = new MovieClip();
this.addChild(layerHud);
ingame = true;
isWin = false;
isRun = true;
}
public function Load(dificultad:int){
this.dificultad = dificultad;
ingame = true;
isWin = false;
isRun = true;
mouseInLevel = new Vector2D();
mouseInScreen = new Vector2D();
canvasScenario = new CanvasScenario(this, APPLICATION_WIDTH, APPLICATION_HEIGHT, dificultad);
player = new Player(this, canvasScenario);
canvasScenario.setPlayer(player);
this.parent.stage.addEventListener(MouseEvent.MOUSE_MOVE, mouseUpdate);
hudMenu = new HudMenu(this, canvasScenario, player);
this.addChild(hudMenu);
difference = 33;
newDate = new Date();
lastDate = newDate.time;
intervalo = new Timer((1000 / this.FrameRate), 0);
intervalo.addEventListener(TimerEvent.TIMER, run);
intervalo.start();
player.updateEnergyCounter();
player.updateExperience(0);
isWin = false;
isRun = true;
hudMenu.gameIntro();
hudMenu.upgradeUpgrade(player.points);
}
public function openGamaga(e:MouseEvent){
var request:*;
request = new URLRequest("http://www.gamersmakinggames.com");
navigateToURL(request, "_blank");
}
public function salidaLocal(){
intervalo.removeEventListener(TimerEvent.TIMER, run);
gameOverMC.backB.removeEventListener(MouseEvent.CLICK, backClick);
gameOverMC.tryB.removeEventListener(MouseEvent.CLICK, tryClick);
hudMenu = null;
cursor = null;
player = null;
mouseInLevel = null;
mouseInScreen = null;
padre = null;
intervalo = null;
canvasScenario = null;
gameOverMC = null;
}
function run(event:TimerEvent):void{
if (ingame){
if ((((canvasScenario.currentWave >= 1)) && (!((hudMenu.inGameIntro == null))))){
this.removeChild(hudMenu.inGameIntro);
hudMenu.inGameIntro = null;
};
canvasScenario.toLevelCoords(mouseInScreen, mouseInLevel);
canvasScenario.updateTimeCounter();
newDate = new Date();
difference = (newDate.time - lastDate);
lastDate = newDate.time;
update();
canvasScenario.update(difference);
layerPlayer.x = canvasScenario.map.x;
layerPlayer.y = canvasScenario.map.y;
layerParticle.x = canvasScenario.map.x;
layerParticle.y = canvasScenario.map.y;
layerEnemies.x = canvasScenario.map.x;
layerEnemies.y = canvasScenario.map.y;
layerTraps.x = canvasScenario.map.x;
layerTraps.y = canvasScenario.map.y;
};
}
public function tryClick(event:MouseEvent):void{
padre.exitGame(true);
}
public function update(){
var i:int;
var k:int;
player.update(mouseInLevel, difference);
i = 0;
while (i < canvasScenario.listOfBullets.length) {
k = 0;
while (k < canvasScenario.listOfEnemies.length) {
if (((((layerEnemies.contains(canvasScenario.listOfEnemies[k].movieClip)) && ((canvasScenario.listOfBullets[i].killIt == false)))) && ((canvasScenario.listOfEnemies[k].isVisible == true)))){
canvasScenario.listOfEnemies[k].checkBullet(canvasScenario.listOfBullets[i]);
};
k++;
};
if (layerParticle.contains(canvasScenario.listOfBullets[i].movieClip)){
canvasScenario.listOfBullets[i].update();
} else {
canvasScenario.listOfBullets.splice(i, 1);
};
i++;
};
i = 0;
while (i < canvasScenario.listOfTraps.length) {
if (layerTraps.contains(canvasScenario.listOfTraps[i].movieClip)){
if (canvasScenario.listOfTraps[i].isDinamita == true){
canvasScenario.activateDynamite(canvasScenario.listOfTraps[i], 30);
};
} else {
canvasScenario.listOfTraps.splice(i, 1);
};
i++;
};
i = 0;
while (i < canvasScenario.listOfEnemies.length) {
if (layerEnemies.contains(canvasScenario.listOfEnemies[i].movieClip)){
canvasScenario.listOfEnemies[i].update();
} else {
canvasScenario.listOfEnemies.splice(i, 1);
};
i++;
};
if (!player.updatePlayer){
gameOverMC = new GameOverClip();
gameOverMC.x = (APPLICATION_WIDTH / 2);
gameOverMC.y = (APPLICATION_HEIGHT / 2);
this.addChild(gameOverMC);
if (isWin == true){
gameOverMC.gotoAndStop(2);
gameOverMC.button_gameover_moregames.addEventListener(MouseEvent.CLICK, padre.padre.onCLick3);
padre.scoreSystem.submitScore(1, canvasScenario.player.score);
padre.scoreSystem.kongregate.stats.submit("TotalScore", canvasScenario.player.score);
switch (canvasScenario.dificultad){
case 1:
padre.kongregate.stats.submit("EasyMode", 1);
padre.kongregate.stats.submit("EasyModeScore", canvasScenario.player.score);
break;
case 2:
padre.kongregate.stats.submit("NormalMode", 1);
padre.kongregate.stats.submit("NormalModeScore", canvasScenario.player.score);
break;
case 3:
padre.kongregate.stats.submit("HardMode", 1);
padre.kongregate.stats.submit("HardModeScore", canvasScenario.player.score);
break;
case 4:
padre.kongregate.stats.submit("Challenge", 1);
padre.kongregate.stats.submit("ChallengeScore", canvasScenario.player.score);
break;
case 5:
padre.kongregate.stats.submit("EasySandbox", 1);
padre.kongregate.stats.submit("EasySandboxScore", canvasScenario.player.score);
break;
case 6:
padre.kongregate.stats.submit("NormalSandbox", 1);
padre.kongregate.stats.submit("NormalSandboxScore", canvasScenario.player.score);
break;
case 7:
padre.kongregate.stats.submit("HardSandbox", 1);
padre.kongregate.stats.submit("HardSandboxScore", canvasScenario.player.score);
break;
};
};
canvasScenario.player.movieClip.stage.removeEventListener(KeyboardEvent.KEY_DOWN, canvasScenario.player.onKeyDown);
canvasScenario.player.movieClip.stage.removeEventListener(KeyboardEvent.KEY_UP, canvasScenario.player.onKeyUp);
canvasScenario.player.movieClip.stage.removeEventListener(MouseEvent.MOUSE_DOWN, canvasScenario.player.onClick);
canvasScenario.player.movieClip.stage.removeEventListener(MouseEvent.MOUSE_UP, canvasScenario.player.onUnclick);
gameOverMC.backB.addEventListener(MouseEvent.CLICK, backClick);
gameOverMC.tryB.addEventListener(MouseEvent.CLICK, tryClick);
gameOverMC.gamagaLink.addEventListener(MouseEvent.CLICK, openGamaga);
ingame = false;
};
}
function mouseUpdate(e:MouseEvent){
mouseInScreen.X = e.stageX;
mouseInScreen.Y = e.stageY;
}
public function backClick(event:MouseEvent):void{
padre.exitGame(false);
}
}
}//package
Section 81 (45.86 KiB) ● ● ● ●
//CanvasScenario (CanvasScenario)
package {
import flash.display.*;
public class CanvasScenario extends MovieClip {
public var numeroOleadas:int;
public var padre:Canvas;
public var listaDeBalas:ListaEnlazada;
var currentWave:Number;// = 0
public var verticalWalls:Array;
public var horizontalWalls:Array;
private var spawnPoints:Array;
var conqAny:Boolean;// = false
public var mapDimensions:Vector2D;
public var parametrosOlas:Array;
private var spawnPointsRadio:int;// = 1
public var timeBetween:Number;
public var baseEsperada:Array;
public var halfScreenHeight:Number;
public var halfScreenWidth:Number;
public var posInitPX:Number;// = 0
public var posInitPY:Number;// = 0
private var mapLimits:Vector2D;
public var collisionMap:Array;
public var listOfTraps:Array;
var timeToNextWave:Number;// = 5000
public var listOfBullets:Array;
public var player:Player;
public var objectBeingFollowed:MovieClip;
public var listaDeEnemigosVisibles:ListaEnlazada;
public var listaDeMinas:ListaEnlazada;
private var spawnPointsEsperado:Array;
public var healthEsperada:Array;
private var basePosition:Vector2D;
var enemigosRemaining:int;// = 0
public var dificultad:int;
public var listOfEnemies:Array;
public var map:MovieClip;
public var listaDeDinamitas:ListaEnlazada;
var proximoEnemigoMs:int;// = 0
public var listaDeEnemigos:ListaEnlazada;
public function CanvasScenario(canvas:Canvas, screenWidth:Number, screenHeight:Number, dificultad:int){
verticalWalls = new Array();
horizontalWalls = new Array();
listOfEnemies = new Array();
listOfTraps = new Array();
listOfBullets = new Array();
spawnPointsRadio = 1;
currentWave = 0;
timeToNextWave = Parametros.FirstWave;
enemigosRemaining = 0;
proximoEnemigoMs = 0;
posInitPX = 0;
posInitPY = 0;
conqAny = false;
super();
padre = canvas;
this.dificultad = dificultad;
halfScreenWidth = (screenWidth / 2);
halfScreenHeight = (screenHeight / 2);
switch (dificultad){
case 1:
map = new GatoMapStill();
collisionMap = [[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1], [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1], [1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1], [1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1], [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1], [1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]];
spawnPointsEsperado = [[8, 4], [3, 10], [15, 14]];
setSpawnPoints();
baseEsperada = [[3, 4], [16, 3], [3, 13]];
healthEsperada = [[9, 9], [-5, -5]];
Parametros.MaximaCantidadDeBases = 3;
parametrosOlas = [[0], [1000, [5, 9, 0, 1.5, 0.1], [0, 15, 0, 2, 0.1], [0, 21, 0, 2, 0.2], [0, 15, 0, 2.5, 0.3], [0, 30, 0, 2.5, 0.2], [0, 80, 0, 2, 0.25], [0, 30, 0, 3.5, 0.2], [0, 160, 0, 3, 0.25], 1], [1000, [8], [0], [0], [0], [0], [0], [0], [0], 1], [1000, [0], [5], [0], [0], [0], [0], [0], [0], 4], [1000, [10], [0], [0], [0], [0], [0], [0], [0], 1], [1000, [5], [0], [0], [0], [0], [1], [0], [0], 3], [1000, [0], [5], [0], [0], [0], [0], [0], [0], 1], [1000, [0], [8], [0], [0], [0], [0], [0], [0], 1], [1000, [5], [0], [5], [0], [0], [0], [0], [0], 4], [1000, [0], [10], [0], [0], [0], [0], [0], [0], 2], [1000, [0], [5], [0], [0], [0], [1], [0], [0], 3], [1000, [0], [0], [5], [0], [0], [0], [0], [0], 1], [1000, [0], [0], [8], [0], [0], [0], [0], [0], 1], [1000, [0], [5], [0], [5], [0], [0], [0], [0], 4], [1000, [0], [0], [10], [0], [0], [0], [0], [0], 2], [1000, [0], [0], [5], [0], [0], [2], [0], [0], 3], [1000, [0], [0], [0], [5], [0], [0], [0], [0], 1], [1000, [0], [0], [0], [8], [0], [0], [0], [0], 2], [1000, [0], [0], [5], [0], [5], [0], [0], [0], 4], [1000, [0], [0], [0], [10], [0], [0], [0], [0], 2], [1000, [0], [0], [0], [5], [0], [2], [0], [0], 3], [1000, [0], [0], [0], [0], [5], [0], [0], [0], 2], [1000, [0], [0], [0], [0], [8], [0], [0], [0], 2], [1000, [0], [0], [0], [5], [0], [0], [5], [0], 4], [1000, [0], [0], [0], [0], [10], [0], [0], [0], 2], [1000, [0], [0], [0], [0], [5], [3], [0], [0], 3], [1000, [0], [10], [0], [5], [0], [0], [0], [0], 2], [1000, [0], [0], [10], [0], [5], [0], [0], [0], 2], [1000, [0], [0], [0], [10], [0], [0], [5], [0], 5], [1000, [0], [0], [5], [0], [0], [0], [10], [0], 5], [2000, [0], [0], [0], [0], [0], [6], [0], [0], 3]];
timeBetween = 40000;
numeroOleadas = 30;
posInitPX = 300;
posInitPY = 300;
break;
case 2:
map = new MapaNormal();
collisionMap = [[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1], [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1], [1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]];
spawnPointsEsperado = [[2, 9], [16, 3], [13, 13]];
setSpawnPoints();
baseEsperada = [[2, 3], [2, 13], [14, 9], [19, 3], [17, 14]];
healthEsperada = [[9, 3], [6, 11]];
Parametros.MaximaCantidadDeBases = 5;
parametrosOlas = [[0], [750, [5, 12, 0, 1.1, 0.1], [0, 21, 0, 1.1, 0.1], [0, 30, 0, 1.1, 0.2], [0, 21, 0, 1.6, 0.3], [0, 36, 0, 1.6, 0.2], [0, 110, 0, 1.6, 0.24], [0, 45, 0, 2.1, 0.2], [0, 200, 0, 2, 0.25], 1], [750, [8], [0], [0], [0], [0], [0], [0], [0], 1], [750, [0], [5], [0], [0], [0], [0], [0], [0], 4], [750, [10], [0], [0], [0], [0], [0], [0], [0], 2], [750, [5], [0], [0], [0], [0], [1], [0], [0], 3], [750, [0], [5], [0], [0], [0], [0], [0], [0], 1], [750, [0], [8], [0], [0], [0], [0], [0], [0], 2], [750, [5], [0], [5], [0], [0], [0], [0], [0], 4], [750, [0], [10], [0], [0], [0], [0], [0], [0], 2], [750, [0], [5], [0], [0], [0], [1], [0], [0], 3], [750, [0], [0], [5], [0], [0], [0], [0], [0], 2], [750, [0], [0], [8], [0], [0], [0], [0], [0], 2], [750, [0], [5], [0], [5], [0], [0], [0], [0], 4], [750, [0], [0], [10], [0], [0], [0], [0], [0], 2], [750, [0], [0], [5], [0], [0], [2], [0], [0], 3], [750, [0], [0], [0], [5], [0], [0], [0], [0], 2], [750, [0], [0], [0], [8], [0], [0], [0], [0], 2], [750, [0], [0], [5], [0], [5], [0], [0], [0], 4], [750, [0], [0], [0], [10], [0], [0], [0], [0], 5], [750, [0], [0], [0], [5], [0], [2], [0], [0], 3], [750, [0], [0], [0], [0], [5], [0], [0], [0], 2], [750, [0], [0], [0], [0], [8], [0], [0], [0], 2], [750, [0], [0], [0], [5], [0], [0], [5], [0], 4], [750, [0], [0], [0], [0], [10], [0], [0], [0], 5], [750, [0], [0], [0], [0], [5], [3], [0], [0], 3], [750, [0], [10], [0], [5], [0], [0], [0], [0], 2], [750, [0], [0], [10], [0], [5], [0], [0], [0], 2], [750, [0], [0], [0], [10], [0], [0], [5], [0], 5], [750, [0], [0], [5], [0], [0], [0], [10], [0], 5], [1500, [0], [0], [0], [0], [0], [6], [0], [0], 3], [750, [0], [0], [0], [10], [0], [0], [5], [0], 2], [750, [0], [0], [0], [0], [5], [0], [10], [0], 2], [750, [0], [0], [0], [0], [8], [0], [10], [0], 5], [750, [0], [0], [0], [0], [10], [0], [8], [0], 5], [750, [0], [0], [0], [0], [0], [8], [0], [0], 3], [750, [40], [0], [0], [0], [0], [0], [0], [0], 2], [750, [0], [40], [0], [0], [0], [0], [0], [0], 5], [750, [0], [0], [0], [0], [20], [0], [0], [0], 5], [750, [0], [0], [0], [0], [0], [0], [20], [0], 5], [750, [0], [0], [0], [0], [0], [0], [0], [4], 6]];
timeBetween = 35000;
numeroOleadas = 40;
posInitPX = 288;
posInitPY = 224;
break;
case 3:
map = new MapaHard();
collisionMap = [[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1], [1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1], [1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1], [1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1], [1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1], [1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]];
spawnPointsEsperado = [[7, 7], [14, 9]];
setSpawnPoints();
baseEsperada = [[2, 3], [12, 2], [19, 3], [2, 8], [2, 13], [10, 14], [19, 14]];
healthEsperada = [[11, 5], [8, 11], [19, 9]];
Parametros.MaximaCantidadDeBases = 7;
parametrosOlas = [[0], [500, [5, 16, 0, 1.4, 0.1], [0, 26, 0, 1.4, 0.1], [0, 36, 0, 1.4, 0.2], [0, 30, 0, 1.9, 0.3], [0, 42, 0, 1.9, 0.2], [0, 130, 0, 1.8, 0.25], [0, 55, 0, 2.43, 0.2], [0, 230, 0, 2.2, 0.25], 1], [500, [8], [0], [0], [0], [0], [0], [0], [0], 1], [500, [0], [5], [0], [0], [0], [0], [0], [0], 4], [500, [10], [0], [0], [0], [0], [0], [0], [0], 2], [500, [5], [0], [0], [0], [0], [1], [0], [0], 3], [500, [0], [5], [0], [0], [0], [0], [0], [0], 1], [500, [0], [8], [0], [0], [0], [0], [0], [0], 2], [500, [5], [0], [5], [0], [0], [0], [0], [0], 4], [500, [0], [10], [0], [0], [0], [0], [0], [0], 2], [500, [0], [5], [0], [0], [0], [1], [0], [0], 3], [500, [0], [0], [5], [0], [0], [0], [0], [0], 2], [500, [0], [0], [8], [0], [0], [0], [0], [0], 2], [500, [0], [5], [0], [5], [0], [0], [0], [0], 4], [500, [0], [0], [10], [0], [0], [0], [0], [0], 2], [500, [0], [0], [5], [0], [0], [2], [0], [0], 3], [500, [0], [0], [0], [5], [0], [0], [0], [0], 2], [500, [0], [0], [0], [8], [0], [0], [0], [0], 2], [500, [0], [0], [5], [0], [5], [0], [0], [0], 4], [500, [0], [0], [0], [10], [0], [0], [0], [0], 5], [500, [0], [0], [0], [5], [0], [2], [0], [0], 3], [500, [0], [0], [0], [0], [5], [0], [0], [0], 2], [500, [0], [0], [0], [0], [8], [0], [0], [0], 2], [500, [0], [0], [0], [5], [0], [0], [5], [0], 4], [500, [0], [0], [0], [0], [10], [0], [0], [0], 5], [500, [0], [0], [0], [0], [5], [3], [0], [0], 3], [500, [0], [10], [0], [5], [0], [0], [0], [0], 2], [500, [0], [0], [10], [0], [5], [0], [0], [0], 2], [500, [0], [0], [0], [10], [0], [0], [5], [0], 5], [500, [0], [0], [5], [0], [0], [0], [10], [0], 5], [1000, [0], [0], [0], [0], [0], [0], [0], [3], 3], [500, [0], [0], [0], [10], [0], [0], [5], [0], 2], [500, [0], [0], [0], [0], [5], [0], [10], [0], 2], [500, [0], [0], [0], [0], [8], [0], [10], [0], 5], [500, [0], [0], [0], [0], [10], [0], [8], [0], 5], [500, [0], [0], [0], [0], [0], [4], [0], [2], 3], [500, [40], [0], [0], [0], [0], [0], [0], [0], 2], [500, [0], [40], [0], [0], [0], [0], [0], [0], 5], [500, [0], [0], [0], [0], [20], [0], [0], [0], 5], [500, [0], [0], [0], [0], [0], [0], [20], [0], 5], [500, [0], [0], [0], [0], [0], [2], [0], [4], 6]];
timeBetween = 30000;
numeroOleadas = 40;
posInitPX = 362;
posInitPY = 224;
break;
case 4:
map = new MapaChallengeMC();
collisionMap = [[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1], [1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1], [1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1], [1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1], [1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1], [1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]];
spawnPointsEsperado = [[1, 2], [1, 10], [13, 9]];
setSpawnPoints();
baseEsperada = [[4, 6], [6, 5], [9, 5], [9, 7], [6, 7], [9, 14]];
healthEsperada = [[2, 15], [12, 2]];
Parametros.MaximaCantidadDeBases = 6;
parametrosOlas = [[0], [500, [8, 20, 0, 1.5, 0.1], [0, 32, 0, 1.5, 0.1], [0, 42, 0, 1.5, 0.2], [0, 36, 0, 2, 0.3], [0, 50, 0, 2, 0.2], [0, 150, 0, 1.6, 0.25], [0, 60, 0, 2.6, 0.2], [0, 260, 0, 2, 0.25], 1], [500, [8], [0], [0], [0], [0], [0], [0], [0], 2], [500, [0], [5], [0], [0], [0], [0], [0], [0], 4], [500, [10], [0], [0], [0], [0], [0], [0], [0], 2], [500, [5], [0], [0], [0], [0], [1], [0], [0], 3], [500, [0], [5], [0], [0], [0], [0], [0], [0], 1], [500, [0], [8], [0], [0], [0], [0], [0], [0], 2], [500, [5], [0], [5], [0], [0], [0], [0], [0], 4], [500, [0], [10], [0], [0], [0], [0], [0], [0], 5], [500, [0], [5], [0], [0], [0], [1], [0], [0], 3], [500, [0], [0], [5], [0], [0], [0], [0], [0], 2], [500, [0], [0], [8], [0], [0], [0], [0], [0], 2], [500, [0], [5], [0], [5], [0], [0], [0], [0], 4], [500, [0], [0], [10], [0], [0], [0], [0], [0], 5], [500, [0], [0], [5], [0], [0], [2], [0], [0], 3], [500, [0], [0], [0], [5], [0], [0], [0], [0], 2], [500, [0], [0], [0], [8], [0], [0], [0], [0], 5], [500, [0], [0], [5], [0], [5], [0], [0], [0], 4], [500, [0], [0], [0], [10], [0], [0], [0], [0], 5], [500, [0], [0], [0], [5], [0], [2], [0], [0], 3], [500, [0], [0], [0], [0], [5], [0], [0], [0], 5], [500, [0], [0], [0], [0], [8], [0], [0], [0], 5], [500, [0], [0], [0], [5], [0], [0], [5], [0], 4], [500, [0], [0], [0], [0], [10], [0], [0], [0], 5], [500, [0], [0], [0], [0], [5], [3], [0], [0], 3], [500, [0], [10], [0], [5], [0], [0], [0], [0], 5], [500, [0], [0], [10], [0], [5], [0], [0], [0], 5], [500, [0], [0], [0], [10], [0], [0], [5], [0], 5], [500, [0], [0], [5], [0], [0], [0], [10], [0], 5], [1000, [0], [0], [0], [0], [0], [0], [0], [3], 6], [500, [0], [0], [0], [10], [0], [0], [5], [0], 5], [500, [0], [0], [0], [0], [5], [0], [10], [0], 5], [500, [0], [0], [0], [0], [8], [0], [10], [0], 5], [500, [0], [0], [0], [0], [10], [0], [8], [0], 5], [500, [0], [0], [0], [0], [0], [4], [0], [2], 3], [500, [40], [0], [0], [0], [0], [0], [0], [0], 5], [500, [0], [40], [0], [0], [0], [0], [0], [0], 5], [500, [0], [0], [0], [0], [20], [0], [0], [0], 5], [500, [0], [0], [0], [0], [0], [0], [20], [0], 5], [500, [0], [0], [0], [0], [0], [2], [0], [4], 3]];
timeBetween = 25000;
numeroOleadas = 40;
posInitPX = 100;
posInitPY = 100;
break;
case 5:
map = new MapaSandBox();
collisionMap = [[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]];
spawnPointsEsperado = [[12, 2], [10, 15]];
setSpawnPoints();
baseEsperada = [[3, 3], [18, 3], [3, 12], [18, 12]];
healthEsperada = [[11, 7]];
Parametros.MaximaCantidadDeBases = 4;
parametrosOlas = [[0], [1000, [5, 9, 0, 1.5, 0.1], [0, 15, 0, 2, 0.1], [0, 21, 0, 2, 0.2], [0, 15, 0, 2.5, 0.3], [0, 30, 0, 2.5, 0.2], [0, 80, 0, 2, 0.25], [0, 30, 0, 3.5, 0.2], [0, 160, 0, 3, 0.25], 1], [1000, [8], [0], [0], [0], [0], [0], [0], [0], 1], [1000, [0], [5], [0], [0], [0], [0], [0], [0], 4], [1000, [10], [0], [0], [0], [0], [0], [0], [0], 1], [1000, [5], [0], [0], [0], [0], [1], [0], [0], 3], [1000, [0], [5], [0], [0], [0], [0], [0], [0], 1], [1000, [0], [8], [0], [0], [0], [0], [0], [0], 1], [1000, [5], [0], [5], [0], [0], [0], [0], [0], 4], [1000, [0], [10], [0], [0], [0], [0], [0], [0], 2], [1000, [0], [5], [0], [0], [0], [1], [0], [0], 3], [1000, [0], [0], [5], [0], [0], [0], [0], [0], 1], [1000, [0], [0], [8], [0], [0], [0], [0], [0], 1], [1000, [0], [5], [0], [5], [0], [0], [0], [0], 4], [1000, [0], [0], [10], [0], [0], [0], [0], [0], 2], [1000, [0], [0], [5], [0], [0], [2], [0], [0], 3], [1000, [0], [0], [0], [5], [0], [0], [0], [0], 1], [1000, [0], [0], [0], [8], [0], [0], [0], [0], 2], [1000, [0], [0], [5], [0], [5], [0], [0], [0], 4], [1000, [0], [0], [0], [10], [0], [0], [0], [0], 2], [1000, [0], [0], [0], [5], [0], [2], [0], [0], 3], [1000, [0], [0], [0], [0], [5], [0], [0], [0], 2], [1000, [0], [0], [0], [0], [8], [0], [0], [0], 2], [1000, [0], [0], [0], [5], [0], [0], [5], [0], 4], [1000, [0], [0], [0], [0], [10], [0], [0], [0], 2], [1000, [0], [0], [0], [0], [5], [3], [0], [0], 3], [1000, [0], [10], [0], [5], [0], [0], [0], [0], 2], [1000, [0], [0], [10], [0], [5], [0], [0], [0], 2], [1000, [0], [0], [0], [10], [0], [0], [5], [0], 5], [1000, [0], [0], [5], [0], [0], [0], [10], [0], 5], [2000, [0], [0], [0], [0], [0], [6], [0], [0], 3]];
timeBetween = 40000;
numeroOleadas = 30;
posInitPX = 352;
posInitPY = 277;
break;
case 6:
map = new MapaSandBox();
collisionMap = [[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]];
spawnPointsEsperado = [[12, 2], [10, 15]];
setSpawnPoints();
baseEsperada = [[3, 3], [18, 3], [3, 12], [18, 12]];
healthEsperada = [[11, 7]];
Parametros.MaximaCantidadDeBases = 4;
parametrosOlas = [[0], [750, [5, 12, 0, 1.1, 0.1], [0, 21, 0, 1.1, 0.1], [0, 30, 0, 1.1, 0.2], [0, 21, 0, 1.6, 0.3], [0, 36, 0, 1.6, 0.2], [0, 110, 0, 1.6, 0.24], [0, 45, 0, 2.1, 0.2], [0, 200, 0, 2, 0.25], 1], [750, [8], [0], [0], [0], [0], [0], [0], [0], 1], [750, [0], [5], [0], [0], [0], [0], [0], [0], 4], [750, [10], [0], [0], [0], [0], [0], [0], [0], 2], [750, [5], [0], [0], [0], [0], [1], [0], [0], 3], [750, [0], [5], [0], [0], [0], [0], [0], [0], 1], [750, [0], [8], [0], [0], [0], [0], [0], [0], 2], [750, [5], [0], [5], [0], [0], [0], [0], [0], 4], [750, [0], [10], [0], [0], [0], [0], [0], [0], 2], [750, [0], [5], [0], [0], [0], [1], [0], [0], 3], [750, [0], [0], [5], [0], [0], [0], [0], [0], 2], [750, [0], [0], [8], [0], [0], [0], [0], [0], 2], [750, [0], [5], [0], [5], [0], [0], [0], [0], 4], [750, [0], [0], [10], [0], [0], [0], [0], [0], 2], [750, [0], [0], [5], [0], [0], [2], [0], [0], 3], [750, [0], [0], [0], [5], [0], [0], [0], [0], 2], [750, [0], [0], [0], [8], [0], [0], [0], [0], 2], [750, [0], [0], [5], [0], [5], [0], [0], [0], 4], [750, [0], [0], [0], [10], [0], [0], [0], [0], 5], [750, [0], [0], [0], [5], [0], [2], [0], [0], 3], [750, [0], [0], [0], [0], [5], [0], [0], [0], 2], [750, [0], [0], [0], [0], [8], [0], [0], [0], 2], [750, [0], [0], [0], [5], [0], [0], [5], [0], 4], [750, [0], [0], [0], [0], [10], [0], [0], [0], 5], [750, [0], [0], [0], [0], [5], [3], [0], [0], 3], [750, [0], [10], [0], [5], [0], [0], [0], [0], 2], [750, [0], [0], [10], [0], [5], [0], [0], [0], 2], [750, [0], [0], [0], [10], [0], [0], [5], [0], 5], [750, [0], [0], [5], [0], [0], [0], [10], [0], 5], [1500, [0], [0], [0], [0], [0], [6], [0], [0], 3], [750, [0], [0], [0], [10], [0], [0], [5], [0], 2], [750, [0], [0], [0], [0], [5], [0], [10], [0], 2], [750, [0], [0], [0], [0], [8], [0], [10], [0], 5], [750, [0], [0], [0], [0], [10], [0], [8], [0], 5], [750, [0], [0], [0], [0], [0], [8], [0], [0], 3], [750, [40], [0], [0], [0], [0], [0], [0], [0], 2], [750, [0], [40], [0], [0], [0], [0], [0], [0], 5], [750, [0], [0], [0], [0], [20], [0], [0], [0], 5], [750, [0], [0], [0], [0], [0], [0], [20], [0], 5], [750, [0], [0], [0], [0], [0], [0], [0], [4], 6]];
timeBetween = 35000;
numeroOleadas = 40;
posInitPX = 352;
posInitPY = 277;
break;
case 7:
map = new MapaSandBox();
collisionMap = [[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]];
spawnPointsEsperado = [[12, 2], [10, 15]];
setSpawnPoints();
baseEsperada = [[3, 3], [18, 3], [3, 12], [18, 12]];
healthEsperada = [[11, 7]];
Parametros.MaximaCantidadDeBases = 4;
parametrosOlas = [[0], [500, [5, 16, 0, 1.4, 0.1], [0, 26, 0, 1.4, 0.1], [0, 36, 0, 1.4, 0.2], [0, 30, 0, 1.9, 0.3], [0, 42, 0, 1.9, 0.2], [0, 130, 0, 1.8, 0.25], [0, 55, 0, 2.43, 0.2], [0, 230, 0, 2.2, 0.25], 1], [500, [8], [0], [0], [0], [0], [0], [0], [0], 2], [500, [0], [5], [0], [0], [0], [0], [0], [0], 4], [500, [10], [0], [0], [0], [0], [0], [0], [0], 2], [500, [5], [0], [0], [0], [0], [1], [0], [0], 3], [500, [0], [5], [0], [0], [0], [0], [0], [0], 1], [500, [0], [8], [0], [0], [0], [0], [0], [0], 2], [500, [5], [0], [5], [0], [0], [0], [0], [0], 4], [500, [0], [10], [0], [0], [0], [0], [0], [0], 5], [500, [0], [5], [0], [0], [0], [1], [0], [0], 3], [500, [0], [0], [5], [0], [0], [0], [0], [0], 2], [500, [0], [0], [8], [0], [0], [0], [0], [0], 2], [500, [0], [5], [0], [5], [0], [0], [0], [0], 4], [500, [0], [0], [10], [0], [0], [0], [0], [0], 5], [500, [0], [0], [5], [0], [0], [2], [0], [0], 3], [500, [0], [0], [0], [5], [0], [0], [0], [0], 2], [500, [0], [0], [0], [8], [0], [0], [0], [0], 5], [500, [0], [0], [5], [0], [5], [0], [0], [0], 4], [500, [0], [0], [0], [10], [0], [0], [0], [0], 5], [500, [0], [0], [0], [5], [0], [2], [0], [0], 3], [500, [0], [0], [0], [0], [5], [0], [0], [0], 5], [500, [0], [0], [0], [0], [8], [0], [0], [0], 5], [500, [0], [0], [0], [5], [0], [0], [5], [0], 4], [500, [0], [0], [0], [0], [10], [0], [0], [0], 5], [500, [0], [0], [0], [0], [5], [3], [0], [0], 3], [500, [0], [10], [0], [5], [0], [0], [0], [0], 5], [500, [0], [0], [10], [0], [5], [0], [0], [0], 5], [500, [0], [0], [0], [10], [0], [0], [5], [0], 5], [500, [0], [0], [5], [0], [0], [0], [10], [0], 5], [1000, [0], [0], [0], [0], [0], [0], [0], [3], 6], [500, [0], [0], [0], [10], [0], [0], [5], [0], 5], [500, [0], [0], [0], [0], [5], [0], [10], [0], 5], [500, [0], [0], [0], [0], [8], [0], [10], [0], 5], [500, [0], [0], [0], [0], [10], [0], [8], [0], 5], [500, [0], [0], [0], [0], [0], [4], [0], [2], 3], [500, [40], [0], [0], [0], [0], [0], [0], [0], 5], [500, [0], [40], [0], [0], [0], [0], [0], [0], 5], [500, [0], [0], [0], [0], [20], [0], [0], [0], 5], [500, [0], [0], [0], [0], [0], [0], [20], [0], 5], [500, [0], [0], [0], [0], [0], [2], [0], [4], 3]];
timeBetween = 25000;
numeroOleadas = 40;
posInitPX = 352;
posInitPY = 277;
break;
};
canvas.layerScenario.addChild(map);
mapLimits = new Vector2D();
mapLimits.X = -((map.width - screenWidth));
mapLimits.Y = -((map.height - screenHeight));
mapDimensions = new Vector2D();
mapDimensions.X = map.width;
mapDimensions.Y = map.height;
listaDeEnemigos = new ListaEnlazada();
listaDeEnemigosVisibles = new ListaEnlazada();
listaDeMinas = new ListaEnlazada();
listaDeDinamitas = new ListaEnlazada();
listaDeBalas = new ListaEnlazada();
}
public function activateDynamite(dinamita:Dinamita, elapsedTime:int){
var g:int;
var animDin:MovieClip;
trace(dinamita);
trace(elapsedTime);
if (dinamita.explota(elapsedTime) == true){
collisionMap[dinamita.i][dinamita.j] = 0;
padre.layerTraps.removeChild(dinamita.movieClip);
g = 0;
while (g < listOfEnemies.length) {
if (dinamita.posicion.squaredDistanceTo(listOfEnemies[g].posicion) < (Parametros.TamanyoTile * Parametros.TamanyoTile)){
listOfEnemies[g].sufrirDanyo(Parametros.DanyoDinamita, 0, null);
};
g++;
};
animDin = new explocion_mc();
animDin.x = ((dinamita.j * Parametros.TamanyoTile) + Parametros.TamanyoTileMedios);
animDin.y = ((dinamita.i * Parametros.TamanyoTile) + Parametros.TamanyoTileMedios);
padre.layerParticle.addChild(animDin);
animDin.scaleX = (animDin.scaleX * 1.5);
animDin.scaleY = (animDin.scaleY * 1.5);
animDin.play();
padre.padre.soundSystem.exploDinamita.play(0, 1, padre.padre.soundSystem.volPrincipal);
};
}
public function torretaDestruida(id:int){
var temp:Disparable;
temp = Disparable(listaDeEnemigos.primerObjeto);
while (temp != null) {
temp.torretaDestruida(id);
temp = Disparable(temp.sgte);
};
}
private function followObject(){
var xCorner:Number;
var yCorner:Number;
xCorner = (objectBeingFollowed.x - halfScreenWidth);
yCorner = (objectBeingFollowed.y - halfScreenHeight);
map.x = -(xCorner);
map.y = -(yCorner);
if (map.x < mapLimits.X){
map.x = mapLimits.X;
};
if (map.x > 0){
map.x = 0;
};
if (map.y < mapLimits.Y){
map.y = mapLimits.Y;
};
if (map.y > 0){
map.y = 0;
};
}
public function spawnNewEnemy(){
var enemyArray:Array;
var j:int;
var tipoEnemigo:int;
var enemigo:Enemigo;
enemyArray = new Array();
j = 1;
while (j < (parametrosOlas[currentWave].length - 1)) {
if (parametrosOlas[currentWave][j][0] > 0){
enemyArray.push(j.valueOf());
};
j++;
};
tipoEnemigo = Math.floor((Math.random() * enemyArray.length));
var _local5 = parametrosOlas[currentWave][enemyArray[tipoEnemigo]];
var _local6:int;
var _local7 = (_local5[_local6] - 1);
_local5[_local6] = _local7;
enemigo = new Enemigo(map, ((spawnPoints[(enemigosRemaining % spawnPoints.length)].X - spawnPointsRadio) + (2 * (Math.random() * spawnPointsRadio))), ((spawnPoints[(enemigosRemaining % spawnPoints.length)].Y - spawnPointsRadio) + (2 * (Math.random() * spawnPointsRadio))), mapDimensions, enemyArray[tipoEnemigo], currentWave, player, padre);
listOfEnemies.push(enemigo);
}
public function tilePasable(i:int, j:int):Boolean{
if ((((((((i >= 0)) && ((i <= collisionMap.length)))) && ((j >= 0)))) && ((j < collisionMap[0].length)))){
if (collisionMap[i][j] != 1){
return (true);
};
};
return (false);
}
private function setSpawnPoints(){
var v:Vector2D;
var i:int;
var newSpawn:MovieClip;
spawnPoints = new Array();
i = 0;
while (i < spawnPointsEsperado.length) {
v = new Vector2D();
v.X = (spawnPointsEsperado[i][0] * Parametros.TamanyoTile);
v.Y = (spawnPointsEsperado[i][1] * Parametros.TamanyoTile);
newSpawn = new DeathMatk();
newSpawn.x = v.X;
newSpawn.y = v.Y;
map.addChild(newSpawn);
switch (spawnPointsEsperado[i][0]){
case 0:
v.X = (v.X - spawnPointsRadio);
break;
case (map.width / Parametros.TamanyoTile):
v.X = (v.X + spawnPointsRadio);
break;
};
switch (spawnPointsEsperado[i][1]){
case 0:
v.Y = (v.Y - spawnPointsRadio);
break;
case (map.height / Parametros.TamanyoTile):
v.Y = (v.Y + spawnPointsRadio);
break;
};
spawnPoints.push(v);
i++;
};
}
public function addMina(x:Number, y:Number, tipo:int, muviClip:MovieClip){
var i:int;
var j:int;
x = (x - map.x);
y = (y - map.y);
i = Math.floor((y / Parametros.TamanyoTile));
j = Math.floor((x / Parametros.TamanyoTile));
if (collisionMap[i][j] == 0){
collisionMap[i][j] = tipo;
listOfTraps.push(new Mina(i, j, map, this, tipo, muviClip));
};
}
public function newFireBullet(origin:Vector2D, ray:Vector2D, mouse:Vector2D, rotation:Number, danyo:int, checkParedes:Boolean):Boolean{
var check:Boolean;
var disparado:Disparable;
var temp:DisparableVisible;
var p:Vector2D;
var paredVerticalCercana:int;
var distancia:Number;
var estaDistancia:Number;
var j:int;
var paredHorizontalCercana:int;
disparado = null;
temp = DisparableVisible(listaDeEnemigosVisibles.primerObjeto);
while (temp != null) {
check = false;
if (!temp.disparable.muerto){
if ((((rotation >= 45)) && ((rotation <= 135)))){
if (temp.disparable.posicion.X > origin.X){
check = true;
};
} else {
if ((((rotation >= -45)) && ((rotation <= 45)))){
if (temp.disparable.posicion.Y < origin.Y){
check = true;
};
} else {
if ((((rotation >= -135)) && ((rotation <= -45)))){
if (temp.disparable.posicion.X < origin.X){
check = true;
};
} else {
if (temp.disparable.posicion.Y > origin.Y){
check = true;
};
};
};
};
};
if (check){
p = temp.disparable.posicion;
if ((((((((mouse.X > (p.X - 16))) && ((mouse.X < (p.X + 16))))) && ((mouse.Y > (p.Y - 20))))) && ((mouse.Y < (p.Y + 20))))){
disparado = temp.disparable;
break;
};
};
temp = DisparableVisible(temp.sgte);
};
if (disparado != null){
if (checkParedes){
paredVerticalCercana = -1;
distancia = Number.MAX_VALUE;
ray.add(origin);
j = 0;
while (j < verticalWalls.length) {
if (Utils.intersect(origin.X, origin.Y, ray.X, ray.Y, verticalWalls[j][1], verticalWalls[j][0], verticalWalls[j][1], verticalWalls[j][2])){
estaDistancia = Math.abs((origin.X - verticalWalls[j][1]));
if (estaDistancia < distancia){
distancia = estaDistancia;
paredVerticalCercana = j;
};
};
j++;
};
if (Math.abs((disparado.posicion.X - origin.X)) > distancia){
disparado = null;
} else {
paredHorizontalCercana = -1;
distancia = Number.MAX_VALUE;
j = 0;
while (j < horizontalWalls.length) {
if (Utils.intersect(origin.X, origin.Y, ray.X, ray.Y, horizontalWalls[j][0], horizontalWalls[j][1], horizontalWalls[j][2], horizontalWalls[j][1])){
estaDistancia = Math.abs((origin.Y - horizontalWalls[j][1]));
if (estaDistancia < distancia){
distancia = estaDistancia;
paredHorizontalCercana = j;
};
};
j++;
};
if (Math.abs((disparado.posicion.Y - origin.Y)) > distancia){
disparado = null;
};
};
};
if (disparado != null){
return (true);
};
return (false);
//unresolved jump
};
return (false);
}
public function activateTrap(i:int, j:int, enemigo:Enemigo){
var k:int;
var animDin:MovieClip;
var g:int;
if (collisionMap[i][j] != 0){
k = 0;
while (k < listOfTraps.length) {
if ((((listOfTraps[k].i == i)) && ((listOfTraps[k].j == j)))){
padre.layerTraps.removeChild(listOfTraps[k].movieClip);
padre.padre.soundSystem.exploMina.play(0, 1, padre.padre.soundSystem.volPrincipal);
switch (collisionMap[i][j]){
case HudMenu.MINE_TRAP:
g = 0;
while (g < listOfEnemies.length) {
if (listOfTraps[k].posicion.squaredDistanceTo(listOfEnemies[g].posicion) < (Parametros.TamanyoTile * Parametros.TamanyoTile)){
listOfEnemies[g].sufrirDanyo(Parametros.DanyoMina, HudMenu.MINE_TRAP, null);
};
g++;
};
animDin = new explocion_mc();
animDin.x = listOfTraps[k].movieClip.x;
animDin.y = listOfTraps[k].movieClip.y;
padre.layerParticle.addChild(animDin);
animDin.play();
break;
case HudMenu.TOXIC_MINE_TRAP:
g = 0;
while (g < listOfEnemies.length) {
if (listOfTraps[k].posicion.squaredDistanceTo(listOfEnemies[g].posicion) < (Parametros.TamanyoTile * Parametros.TamanyoTile)){
listOfEnemies[g].sufrirDanyo(Parametros.DanyoMina, HudMenu.TOXIC_MINE_TRAP, null);
};
g++;
};
animDin = new ExploGas();
animDin.x = listOfTraps[k].movieClip.x;
animDin.y = listOfTraps[k].movieClip.y;
padre.layerParticle.addChild(animDin);
animDin.play();
break;
case HudMenu.FREEZE_MINE_TRAP:
g = 0;
while (g < listOfEnemies.length) {
if (listOfTraps[k].posicion.squaredDistanceTo(listOfEnemies[g].posicion) < (Parametros.TamanyoTile * Parametros.TamanyoTile)){
listOfEnemies[g].sufrirDanyo(Parametros.DanyoMina, HudMenu.FREEZE_MINE_TRAP, null);
};
g++;
};
animDin = new explocion_mc();
animDin.x = listOfTraps[k].movieClip.x;
animDin.y = listOfTraps[k].movieClip.y;
padre.layerParticle.addChild(animDin);
animDin.play();
break;
};
collisionMap[listOfTraps[k].i][listOfTraps[k].j] = 0;
break;
};
k++;
};
};
}
public function update(elapsedTime:int){
var l:int;
if (currentWave < (parametrosOlas.length - 1)){
timeToNextWave = (timeToNextWave - elapsedTime);
if (timeToNextWave < 0){
currentWave++;
timeToNextWave = timeBetween;
spawnWave(currentWave);
};
if (listOfEnemies.length > 0){
padre.hudMenu._nextWaveButton.visible = false;
padre.hudMenu._nextWaveButton.alpha = 0;
padre.hudMenu._nextWaveButton.enabled = false;
} else {
padre.hudMenu._nextWaveButton.visible = true;
padre.hudMenu._nextWaveButton.alpha = 1;
padre.hudMenu._nextWaveButton.enabled = true;
};
} else {
padre.hudMenu._nextWaveButton.visible = false;
padre.hudMenu._nextWaveButton.alpha = 0;
padre.hudMenu._nextWaveButton.enabled = false;
};
if (enemigosRemaining > 0){
proximoEnemigoMs = (proximoEnemigoMs - elapsedTime);
while (proximoEnemigoMs < 0) {
proximoEnemigoMs = (proximoEnemigoMs + parametrosOlas[currentWave][0]);
enemigosRemaining--;
spawnNewEnemy();
};
};
followObject();
player.domination = 0;
conqAny = false;
l = 0;
while (l < baseEsperada.length) {
if (((((((baseEsperada[l][0] * Parametros.TamanyoTile) <= player.posicion.X)) && ((player.posicion.X < ((baseEsperada[l][0] + 1) * Parametros.TamanyoTile))))) && (((((baseEsperada[l][1] * Parametros.TamanyoTile) <= (player.posicion.Y + 10))) && (((player.posicion.Y + 10) < ((baseEsperada[l][1] + 1) * Parametros.TamanyoTile))))))){
if (player.bases[l].isConquered == false){
player.bases[l].isConquering = true;
conqAny = true;
player.bases[l].domMC.gotoAndStop(2);
};
} else {
player.bases[l].isConquering = false;
};
if ((((player.bases[l].isConquered == false)) && ((player.bases[l].isConquering == true)))){
player.bases[l].domMC.gotoAndStop(2);
} else {
if ((((player.bases[l].isConquered == false)) && ((player.bases[l].isConquering == false)))){
player.bases[l].domMC.gotoAndStop(1);
};
};
if (player.bases[l].isConquered == true){
player.domination++;
};
l++;
};
padre.hudMenu.conqueringMessage(conqAny);
if ((((currentWave >= (parametrosOlas.length - 1))) && ((listOfEnemies.length == 0)))){
padre.isWin = true;
player.thisWin = true;
};
}
public function fireBullet(origin:Vector2D, ray:Vector2D, rotation:Number, danyo:int, checkParedes:Boolean){
var a:Number;
var c:Number;
var check:Boolean;
var disparado:Disparable;
var distanceSquared:Number;
var temp:DisparableVisible;
var pos:Vector2D;
var ds:Number;
var paredVerticalCercana:int;
var distancia:Number;
var estaDistancia:Number;
var j:int;
var paredHorizontalCercana:int;
a = ((ray.X * ray.X) + (ray.Y * ray.Y));
c = ((origin.X * origin.X) + (origin.Y * origin.Y));
disparado = null;
distanceSquared = 99999;
temp = DisparableVisible(listaDeEnemigosVisibles.primerObjeto);
while (temp != null) {
check = false;
if (!temp.disparable.muerto){
if ((((rotation >= 45)) && ((rotation <= 135)))){
if (temp.disparable.posicion.X > origin.X){
check = true;
};
} else {
if ((((rotation >= -45)) && ((rotation <= 45)))){
if (temp.disparable.posicion.Y < origin.Y){
check = true;
};
} else {
if ((((rotation >= -135)) && ((rotation <= -45)))){
if (temp.disparable.posicion.X < origin.X){
check = true;
};
} else {
if (temp.disparable.posicion.Y > origin.Y){
check = true;
};
};
};
};
};
if (check){
if (Utils.RayoCircunferencia(ray, a, c, origin, temp.disparable.posicion, temp.disparable.radioSquared, null)){
pos = temp.disparable.posicion;
ds = (((origin.X - pos.X) * (origin.X - pos.X)) + ((origin.Y - pos.Y) * (origin.Y - pos.Y)));
if (ds < distanceSquared){
distanceSquared = ds;
disparado = temp.disparable;
};
};
};
temp = DisparableVisible(temp.sgte);
};
if (disparado != null){
if (checkParedes){
paredVerticalCercana = -1;
distancia = Number.MAX_VALUE;
ray.add(origin);
j = 0;
while (j < verticalWalls.length) {
if (Utils.intersect(origin.X, origin.Y, ray.X, ray.Y, verticalWalls[j][1], verticalWalls[j][0], verticalWalls[j][1], verticalWalls[j][2])){
estaDistancia = Math.abs((origin.X - verticalWalls[j][1]));
if (estaDistancia < distancia){
distancia = estaDistancia;
paredVerticalCercana = j;
};
};
j++;
};
if (Math.abs((disparado.posicion.X - origin.X)) > distancia){
disparado = null;
} else {
paredHorizontalCercana = -1;
distancia = Number.MAX_VALUE;
j = 0;
while (j < horizontalWalls.length) {
if (Utils.intersect(origin.X, origin.Y, ray.X, ray.Y, horizontalWalls[j][0], horizontalWalls[j][1], horizontalWalls[j][2], horizontalWalls[j][1])){
estaDistancia = Math.abs((origin.Y - horizontalWalls[j][1]));
if (estaDistancia < distancia){
distancia = estaDistancia;
paredHorizontalCercana = j;
};
};
j++;
};
if (Math.abs((disparado.posicion.Y - origin.Y)) > distancia){
disparado = null;
};
};
};
if (disparado != null){
disparado.sufrirDanyo(danyo, 0, null);
};
};
}
public function addTurret(x:Number, y:Number){
x = (x - map.x);
y = (y - map.y);
x = (x / Parametros.TamanyoTile);
y = (y / Parametros.TamanyoTile);
player.addTurret(x, y);
}
function toLevelTileCoordX(n:Number):Number{
return ((((Math.floor(((n - map.x) / Parametros.TamanyoTile)) + 0.5) * Parametros.TamanyoTile) + map.x));
}
public function getCloserEnemy(centro:Vector2D, distanceSquared:Number):Enemigo{
var temp:ObjetoListaEnlazada;
var e:Enemigo;
temp = listaDeEnemigos.primerObjeto;
while (temp != null) {
if ((temp is Enemigo)){
e = Enemigo(temp);
if ((((e.posicion.X - centro.X) * (e.posicion.X - centro.X)) + ((e.posicion.Y - centro.Y) * (e.posicion.Y - centro.Y))) < distanceSquared){
return (e);
};
};
temp = temp.sgte;
};
return (null);
}
public function spawnWave(waveNumber:Number){
var k:int;
k = 1;
while (k < (parametrosOlas[currentWave].length - 1)) {
enemigosRemaining = (enemigosRemaining + parametrosOlas[waveNumber][k][0]);
k++;
};
proximoEnemigoMs = parametrosOlas[waveNumber][0];
spawnNewEnemy();
enemigosRemaining--;
}
public function newAddBullet(x:Number, y:Number, radio:Number, pointerX:Number, pointerY:Number, isPlayer:Boolean){
x = (x - map.x);
y = (y - map.y);
listOfBullets.push(new Bala(this, x, y, map, radio, pointerX, pointerY, isPlayer));
}
function toLevelCoords(positionInScreen:Vector2D, positionInLevel:Vector2D){
positionInLevel.X = (positionInScreen.X - map.x);
positionInLevel.Y = (positionInScreen.Y - map.y);
}
public function addBox(x:Number, y:Number){
var i:int;
var j:int;
var k:int;
var n:int;
var mc_box:MovieClip;
x = (x - map.x);
y = (y - map.y);
AStar.buildData(collisionMap, player);
i = Math.floor((y / Parametros.TamanyoTile));
j = Math.floor((x / Parametros.TamanyoTile));
if ((((((collisionMap[i][j] == 0)) && (!((Math.floor((player.posicion.X / 32)) == i))))) && (!((Math.floor((player.posicion.Y / 32)) == j))))){
collisionMap[i][j] = HudMenu.BOX;
AStar.buildData(collisionMap, player);
k = 0;
while (k < spawnPointsEsperado.length) {
AStar.findPath((spawnPointsEsperado[k][0] * 32), (spawnPointsEsperado[k][1] * 32), Parametros.MaximaCantidadDeBases);
if (AStar.isRoad == false){
k = 1000;
};
k++;
};
if (AStar.isRoad == true){
n = 0;
while (n < listOfEnemies.length) {
AStar.findPath(listOfEnemies[n].posicion.X, listOfEnemies[n].posicion.Y, Parametros.MaximaCantidadDeBases);
if (AStar.isRoad == false){
n = 1000;
};
n++;
};
};
if (AStar.isRoad){
mc_box = new boxTrap_mc();
mc_box.x = ((j + 0.5) * Parametros.TamanyoTile);
mc_box.y = ((i + 0.5) * Parametros.TamanyoTile);
padre.layerTraps.addChild(mc_box);
player.money = (player.money - Parametros.CostoBox);
} else {
collisionMap[i][j] = 0;
AStar.buildData(collisionMap, player);
};
};
}
function toLevelTileCoordY(n:Number):Number{
return ((((Math.floor(((n - map.y) / Parametros.TamanyoTile)) + 0.5) * Parametros.TamanyoTile) + map.y));
}
public function addTrap(trap:Trap){
if (player.money >= Parametros.CostoBarril){
trap.posicion.X = (trap.posicion.X - map.x);
trap.posicion.Y = (trap.posicion.Y - map.y);
trap.movieClip.x = trap.posicion.X;
trap.movieClip.y = trap.posicion.Y;
trap.listaDeEnemigos = listaDeEnemigos;
map.addChild(trap.movieClip);
listaDeEnemigos.agregarObjeto(trap);
player.money = (player.money - Parametros.CostoBarril);
player.updateMoneyCounter();
};
}
public function avisarNuevaTorreta(){
var temp:Disparable;
temp = Disparable(listaDeEnemigos.primerObjeto);
while (temp != null) {
temp.encontrarDestino();
temp = Disparable(temp.sgte);
};
}
public function addDinamita(x:Number, y:Number){
var i:int;
var j:int;
x = (x - map.x);
y = (y - map.y);
i = Math.floor((y / Parametros.TamanyoTile));
j = Math.floor((x / Parametros.TamanyoTile));
if (collisionMap[i][j] == 0){
collisionMap[i][j] = HudMenu.DYNAMITE_TRAP;
listOfTraps.push(new Dinamita(i, j, map, this));
};
}
public function setPlayer(p:Player){
this.player = p;
AStar.buildData(collisionMap, p);
}
public function updateTimeCounter(){
if (currentWave < (parametrosOlas.length - 1)){
padre.hudMenu.waveHud.waveBar.x = ((0 - ((currentWave - 1) * 80)) - (((timeBetween - timeToNextWave) / timeBetween) * 80));
};
}
}
}//package
Section 82 (186 B)
//ChallengeMap (ChallengeMap)
package {
import flash.display.*;
public dynamic class ChallengeMap extends MovieClip {
public function ChallengeMap(){
super();
}
}
}//package
Section 83 (188 B)
//clickAnalogico (clickAnalogico)
package {
import flash.media.*;
public dynamic class clickAnalogico extends Sound {
public function clickAnalogico(){
super();
}
}
}//package
Section 84 (180 B)
//clickBurbuja (clickBurbuja)
package {
import flash.media.*;
public dynamic class clickBurbuja extends Sound {
public function clickBurbuja(){
super();
}
}
}//package
Section 85 (1.06 KiB) ●
//Conejo (Conejo)
package {
import flash.display.*;
public dynamic class Conejo extends MovieClip {
public var particula2:MovieClip;
public var particula3:MovieClip;
public var particula1:MovieClip;
public function Conejo(){
super();
addFrameScript(0, frame1, 1, frame2, 10, frame11, 11, frame12, 20, frame21, 21, frame22, 30, frame31, 31, frame32, 40, frame41, 41, frame42, 50, frame51, 51, frame52, 60, frame61, 61, frame62, 70, frame71, 71, frame72);
}
function frame72(){
stop();
}
function frame71(){
stop();
}
function frame12(){
stop();
}
function frame1(){
stop();
}
function frame22(){
stop();
}
function frame21(){
stop();
}
function frame2(){
stop();
}
function frame31(){
stop();
}
function frame11(){
stop();
}
function frame41(){
stop();
}
function frame32(){
stop();
}
function frame42(){
stop();
}
function frame51(){
stop();
}
function frame52(){
stop();
}
function frame61(){
stop();
}
function frame62(){
stop();
}
}
}//package
Section 86 (178 B)
//Conquering (Conquering)
package {
import flash.display.*;
public dynamic class Conquering extends MovieClip {
public function Conquering(){
super();
}
}
}//package
Section 87 (160 B)
//Corazon (Corazon)
package {
import flash.media.*;
public dynamic class Corazon extends Sound {
public function Corazon(){
super();
}
}
}//package
Section 88 (154 B)
//Dead (Dead)
package {
import flash.display.*;
public dynamic class Dead extends MovieClip {
public function Dead(){
super();
}
}
}//package
Section 89 (174 B)
//DeathMatk (DeathMatk)
package {
import flash.display.*;
public dynamic class DeathMatk extends MovieClip {
public function DeathMatk(){
super();
}
}
}//package
Section 90 (3.33 KiB) ●
//DifficultyWindow (DifficultyWindow)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class DifficultyWindow extends MovieClip {
public var hard:SimpleButton;
public var challengeGame:SimpleButton;
public var easy:SimpleButton;
public var padre:MainMenu;
public var achievements:SimpleButton;
public var oSelected:Number;
public var sandBoxHard:SimpleButton;
public var sandBoxEasy:SimpleButton;
public var sandBoxNormal:SimpleButton;
public var sbEasyButton:SimpleButton;
public var challengeMode:SimpleButton;
public var sbHardButton:SimpleButton;
public var newGame:Boolean;// = true
public var AchievementScore:SimpleButton;
public var interval:Timer;
public var easyButton:SimpleButton;
public var sbNormalButton:SimpleButton;
public var normal:SimpleButton;
public var normalButton:SimpleButton;
public var hardButton:SimpleButton;
public function DifficultyWindow(){
newGame = true;
super();
addFrameScript(0, frame1);
}
public function sbNormalClick(event:MouseEvent):void{
oSelected = 6;
exitWindow();
}
public function sbEasyClick(event:MouseEvent):void{
oSelected = 5;
exitWindow();
}
public function hardClick(event:MouseEvent):void{
oSelected = 3;
exitWindow();
}
public function initDif(){
easyButton = easy;
normalButton = normal;
hardButton = hard;
challengeGame = challengeMode;
achievements = AchievementScore;
sbEasyButton = sandBoxEasy;
sbNormalButton = sandBoxNormal;
sbHardButton = sandBoxHard;
easyButton.addEventListener(MouseEvent.CLICK, easyClick);
normalButton.addEventListener(MouseEvent.CLICK, normalClick);
hardButton.addEventListener(MouseEvent.CLICK, hardClick);
challengeGame.addEventListener(MouseEvent.CLICK, challengeGameClick);
achievements.addEventListener(MouseEvent.CLICK, achievementsClick);
sbEasyButton.addEventListener(MouseEvent.CLICK, sbEasyClick);
sbNormalButton.addEventListener(MouseEvent.CLICK, sbNormalClick);
sbHardButton.addEventListener(MouseEvent.CLICK, sbHardClick);
interval = new Timer((1000 / 24), 0);
alpha = 0;
}
function frame1(){
stop();
}
public function challengeGameClick(event:MouseEvent):void{
oSelected = 4;
exitWindow();
}
public function easyClick(event:MouseEvent):void{
trace("dddd");
oSelected = 1;
exitWindow();
}
function exitWindow(){
interval.addEventListener(TimerEvent.TIMER, fadeOut);
}
function fadeIn(event:TimerEvent):void{
alpha = (alpha + 0.1);
if (alpha >= 1){
interval.removeEventListener(TimerEvent.TIMER, fadeIn);
};
}
public function achievementsClick(event:MouseEvent):void{
oSelected = 7;
exitWindow();
}
public function sbHardClick(event:MouseEvent):void{
oSelected = 7;
exitWindow();
}
function fadeOut(event:TimerEvent):void{
alpha = (alpha - 0.1);
if (alpha <= 0){
interval.removeEventListener(TimerEvent.TIMER, fadeOut);
padre.difSelected = oSelected;
if (newGame == false){
padre.oSelected = 61;
} else {
padre.oSelected = 62;
};
padre.exitWindow();
padre.removeChild(this);
};
}
public function normalClick(event:MouseEvent):void{
oSelected = 2;
exitWindow();
}
function enterWindow(){
interval.addEventListener(TimerEvent.TIMER, fadeIn);
interval.start();
}
}
}//package
Section 91 (0.98 KiB)
//Dinamita (Dinamita)
package {
import flash.display.*;
public class Dinamita extends ObjetoListaEnlazada {
public var movieClip:MovieClip;
public var i:int;
public var isDinamita:Boolean;// = true
public var j:int;
public var posicion:Vector2D;
public var counter:int;
public function Dinamita(_i:int, _j:int, map:MovieClip, level:CanvasScenario){
isDinamita = true;
super();
i = _i;
j = _j;
movieClip = new DynamiteMC();
counter = Parametros.TiempoExplosionDinamita;
posicion = new Vector2D();
posicion.X = ((j + 0.5) * Parametros.TamanyoTile);
posicion.Y = ((i + 0.5) * Parametros.TamanyoTile);
movieClip.x = posicion.X;
movieClip.y = posicion.Y;
level.padre.layerTraps.addChild(movieClip);
level.player.money = (level.player.money - Parametros.CostoDinamita);
}
public function explota(elapsedTime:int):Boolean{
if (counter > 0){
counter = (counter - elapsedTime);
return (false);
};
return (true);
}
}
}//package
Section 92 (746 B)
//Disparable (Disparable)
package {
import flash.display.*;
public class Disparable extends ObjetoListaEnlazada {
public var energiaInicial:Number;
public var muerto:Boolean;
public var posicion:Vector2D;
public var linkVisible:DisparableVisible;
public var movieClip:MovieClip;
public var energia:Number;
public var radioSquared:Number;
public var radio:Number;
public var energiaCadaver:int;
public function Disparable(){
super();
linkVisible = new DisparableVisible(this);
}
public function update():Boolean{
return (true);
}
public function sufrirDanyo(n:Number, tipo:int, empuje:Vector2D){
}
public function encontrarDestino(){
}
public function torretaDestruida(id:int){
}
}
}//package
Section 93 (289 B)
//DisparableVisible (DisparableVisible)
package {
public class DisparableVisible extends ObjetoListaEnlazada {
public var enLista:Boolean;
public var disparable:Disparable;
public function DisparableVisible(owner:Disparable){
super();
disparable = owner;
}
}
}//package
Section 94 (432 B)
//domCircle (domCircle)
package {
import flash.display.*;
public dynamic class domCircle extends MovieClip {
public var domMask:MovieClip;
public var flag:MovieClip;
public function domCircle(){
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
function frame3(){
flag.gotoAndPlay(1);
stop();
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 95 (178 B)
//DynamiteMC (DynamiteMC)
package {
import flash.display.*;
public dynamic class DynamiteMC extends MovieClip {
public function DynamiteMC(){
super();
}
}
}//package
Section 96 (14.58 KiB) ● ●
//Enemigo (Enemigo)
package {
import flash.display.*;
public class Enemigo {
var barra:MovieClip;
private var padre:Canvas;
public var destino:Vector2D;
private var atacando:Boolean;
private var enfermo:Boolean;
public var muerto:Boolean;
private var tipoEnemigo:Number;
private var basePosition:Vector2D;
public var factorVelocidad:Number;
private var costoAlMorir:int;
public var sufrirDanyoCounter:Number;// = 500
public var velocidad:Vector2D;
public var movieClip:MovieClip;
private var radioAtaqueSquared:Number;
private var camino:Array;
public var levelLimits:Vector2D;
private var congeladoRemaining:int;
public var energiaCadaver:int;
private var particula:MovieClip;
public var currentText:String;
public var currentAnimacion:int;
public var energiaInicial:Number;
public var caminoTrack:int;
private var danyoGolpe:Number;
public var posicion:Vector2D;
public var shootCounter:Number;// = 0
private var player:Player;
public var map:MovieClip;
private var slidingRemaining:int;
public var energia:Number;
public var radioSquared:Number;
public var isVisible:Boolean;// = false
public var elapsedTime:Number;// = 33.3333333333333
private var tillDisappear:int;
private var baseDestino:int;
public var radio:Number;
public function Enemigo(canvas:MovieClip, x:Number, y:Number, limits:Vector2D, tipo:Number, wave:int, player:Player, _padre:Canvas){
sufrirDanyoCounter = 500;
shootCounter = 0;
elapsedTime = (1000 / 30);
isVisible = false;
super();
this.posicion = new Vector2D();
this.posicion.X = x;
this.posicion.Y = y;
this.velocidad = new Vector2D();
this.tipoEnemigo = tipo;
map = canvas;
padre = _padre;
this.player = player;
this.muerto = false;
energiaInicial = padre.canvasScenario.parametrosOlas[1][tipo][1];
energiaCadaver = padre.canvasScenario.parametrosOlas[1][tipo][2];
factorVelocidad = padre.canvasScenario.parametrosOlas[1][tipo][3];
danyoGolpe = padre.canvasScenario.parametrosOlas[1][tipo][4];
switch (tipo){
case 5:
movieClip = new Indice();
costoAlMorir = Parametros.CostoAlMorirIndice;
this.radio = (movieClip.width / 2);
movieClip.width = (movieClip.width * 0.75);
movieClip.height = (movieClip.height * 0.75);
break;
case 1:
movieClip = new Pulgar();
costoAlMorir = Parametros.CostoAlMorirPulgar;
this.radio = (movieClip.width / 2);
this.radio = (movieClip.width / 2);
movieClip.width = (movieClip.width * 0.75);
movieClip.height = (movieClip.height * 0.75);
break;
case 3:
movieClip = new Soldado();
costoAlMorir = Parametros.CostoAlMorirSoldado;
this.radio = 100;
movieClip.width = (movieClip.width * 0.75);
movieClip.height = (movieClip.height * 0.75);
break;
case 2:
movieClip = new Sargento();
costoAlMorir = Parametros.CostoAlMorirSargento;
this.radio = (movieClip.width / 2);
movieClip.width = (movieClip.width * 0.75);
movieClip.height = (movieClip.height * 0.75);
break;
case 4:
movieClip = new Kamikaze();
costoAlMorir = Parametros.CostoAlMorirKamikaze;
this.radio = (movieClip.width / 2);
movieClip.width = (movieClip.width * 0.75);
movieClip.height = (movieClip.height * 0.75);
break;
case 6:
movieClip = new Boss();
costoAlMorir = Parametros.CostoAlMorirWorm;
this.radio = (movieClip.width / 2);
break;
case 7:
movieClip = new Runner();
costoAlMorir = Parametros.CostoAlMorirRunner;
this.radio = (movieClip.width / 2);
movieClip.width = (movieClip.width * 0.75);
movieClip.height = (movieClip.height * 0.75);
break;
case 8:
movieClip = new Robot();
costoAlMorir = Parametros.CostoAlMorirRobot;
this.radio = (movieClip.width / 2);
break;
};
currentAnimacion = 1;
barra = new EnergyBar();
barra.y = (movieClip.height / 2);
movieClip.addChild(barra);
padre.layerEnemies.addChild(movieClip);
this.energia = this.energiaInicial;
this.levelLimits = limits;
this.radioSquared = (this.radio * this.radio);
this.radioAtaqueSquared = (this.radio + 16);
this.radioAtaqueSquared = (this.radioAtaqueSquared * this.radioAtaqueSquared);
atacando = true;
movieClip.x = posicion.X;
movieClip.y = posicion.Y;
basePosition = new Vector2D();
destino = new Vector2D();
encontrarDestino();
enfermo = false;
}
public function encontrarDestino(){
var minimo:Number;
var dest:int;
var i:int;
var x:Number;
var y:Number;
var distanciaSq:Number;
minimo = Number.MAX_VALUE;
dest = -1;
i = 0;
while (i < player.bases.length) {
if (player.bases[i].energia > 0){
x = player.bases[i].posicion.X;
y = player.bases[i].posicion.Y;
distanciaSq = (((posicion.X - x) * (posicion.X - x)) + ((posicion.Y - y) * (posicion.Y - y)));
if (distanciaSq < minimo){
dest = i;
minimo = distanciaSq;
};
};
i++;
};
if (dest != -1){
baseDestino = dest;
basePosition.X = player.bases[dest].posicion.X;
basePosition.Y = player.bases[dest].posicion.Y;
camino = AStar.findPath(posicion.X, posicion.Y, dest);
caminoTrack = camino.length;
caminoTrack = (caminoTrack - 2);
setNewDestiny();
};
}
public function sufrirDanyo(n:Number, tipo:int, empuje:Vector2D){
var nueva:*;
if (tipo == HudMenu.FREEZE_MINE_TRAP){
if (particula != null){
nueva = new hielo_mc();
particula.addChildAt(nueva, 0);
} else {
particula = new hielo_mc();
};
particula.x = movieClip.x;
particula.y = movieClip.y;
padre.layerParticle.addChild(particula);
congeladoRemaining = Parametros.CongeladoUpdates;
movieClip.gotoAndStop(("Quieto" + currentText));
return;
} else {
if (tipo == HudMenu.TOXIC_MINE_TRAP){
enfermo = true;
if (particula == null){
particula = new gas_mc();
particula.x = movieClip.x;
particula.y = movieClip.y;
padre.layerParticle.addChild(particula);
};
return;
};
};
if (((!((empuje == null))) && ((congeladoRemaining <= 0)))){
slidingRemaining = Parametros.SlideUpdates;
velocidad.X = empuje.X;
velocidad.Y = empuje.Y;
};
energia = (energia - n);
if (energia > 0){
barra.green.scaleX = (energia / energiaInicial);
} else {
barra.green.visible = false;
die();
};
}
public function die(){
velocidad.X = (velocidad.Y = 0);
}
public function torretaDestruida(id:int){
if (baseDestino == id){
encontrarDestino();
};
}
public function checkBullet(bala:Bala){
if ((((((((((((bala.movieClip.x > (posicion.X - 16))) && ((bala.movieClip.x < (posicion.X + 16))))) && ((bala.movieClip.y > (posicion.Y - 20))))) && ((bala.movieClip.y < (posicion.Y + 20))))) && (!(muerto)))) && ((bala.isPlayer == true)))){
bala.velocidad.X = (bala.velocidad.X * player.pushBack);
bala.velocidad.Y = (bala.velocidad.Y * player.pushBack);
sufrirDanyo(player.danyoDisparo, 0, null);
bala.killIt = true;
bala.tipoMuerte = 2;
};
}
public function update(){
var animDin:MovieClip;
if (!muerto){
if (Math.sqrt((((posicion.X - player.posicion.X) * (posicion.X - player.posicion.X)) + ((posicion.Y - player.posicion.Y) * (posicion.Y - player.posicion.Y)))) <= player.radio){
isVisible = true;
};
if (enfermo){
sufrirDanyo(Parametros.DanyoToxicMinePorUpdate, 0, null);
particula.x = movieClip.x;
particula.y = movieClip.y;
};
if (congeladoRemaining > 0){
congeladoRemaining--;
if (congeladoRemaining <= 0){
movieClip.gotoAndStop(("Avanzar" + currentText));
if (padre.layerParticle.contains(particula)){
padre.layerParticle.removeChild(particula);
};
particula = null;
if (enfermo){
sufrirDanyo(0, HudMenu.TOXIC_MINE_TRAP, null);
};
};
} else {
posicion.X = (posicion.X + velocidad.X);
posicion.Y = (posicion.Y + velocidad.Y);
movieClip.x = posicion.X;
movieClip.y = posicion.Y;
};
if (slidingRemaining > 0){
slidingRemaining--;
if (slidingRemaining <= 0){
atacando = false;
encontrarDestino();
};
};
if (((!(muerto)) && ((caminoTrack <= 4)))){
if (posicion.squaredDistanceTo(player.posicion) <= radioAtaqueSquared){
atacando = true;
velocidad.X = (velocidad.Y = 0);
if (movieClip.currentFrame != (currentAnimacion + 4)){
movieClip.gotoAndStop((currentAnimacion + 4));
};
if ((((tipoEnemigo == 4)) && ((atacando == true)))){
player.danyarBase(baseDestino, danyoGolpe);
muerto = true;
energia = 0;
animDin = new explocion_mc();
animDin.x = movieClip.x;
animDin.y = movieClip.y;
map.addChild(animDin);
animDin.scaleX = (animDin.scaleX * 1);
animDin.scaleY = (animDin.scaleY * 1);
animDin.play();
padre.padre.soundSystem.exploDinamita.play(0, 1, padre.padre.soundSystem.volPrincipal);
return (false);
};
if ((((tipoEnemigo == 3)) && ((atacando == true)))){
if (shootCounter <= 0){
padre.canvasScenario.newAddBullet((movieClip.x + map.x), (movieClip.y + map.y), (radio * 10), (player.movieClip.x + map.x), (player.movieClip.y + map.y), false);
shootCounter = 1500;
} else {
if (shootCounter > 0){
shootCounter = (shootCounter - elapsedTime);
};
};
} else {
setSonido();
};
} else {
if ((((atacando == true)) || ((((velocidad.X == 0)) && ((velocidad.Y == 0)))))){
atacando = false;
encontrarDestino();
} else {
if ((((velocidad.X == 0)) && ((velocidad.Y == 0)))){
encontrarDestino();
};
};
};
};
};
if ((((((((posicion.X < (destino.X + 5))) && ((posicion.X > (destino.X - 5))))) && ((posicion.Y > (destino.Y - 5))))) && ((posicion.Y < (destino.Y + 5))))){
encontrarDestino();
padre.canvasScenario.activateTrap(camino[(caminoTrack + 2)], camino[((caminoTrack + 1) + 2)], this);
} else {
if ((((energia <= -(energiaCadaver))) && (!(muerto)))){
darExperiencia();
die();
player.money = (player.money + costoAlMorir);
player.updateMoneyCounter();
muerto = true;
tillDisappear = 70;
barra.alpha = 0;
movieClip.gotoAndStop(13);
player.level.padre.padre.soundSystem.entierro.play(0, 1, player.level.padre.padre.soundSystem.volPrincipal);
} else {
if (muerto){
tillDisappear--;
if (tillDisappear <= 0){
if (particula != null){
if (padre.layerParticle.contains(particula)){
padre.layerParticle.removeChild(particula);
};
};
if (padre.layerEnemies.contains(movieClip)){
padre.layerEnemies.removeChild(movieClip);
};
padre.padre.achieveSystem.achControl((4 + tipoEnemigo));
padre.padre.achieveSystem.achControl(4);
padre.padre.achieveSystem.achControl(11);
return (false);
};
};
};
};
return (true);
}
private function setNewDestiny(){
caminoTrack = (caminoTrack - 2);
if (caminoTrack < 0){
caminoTrack = 0;
return;
};
destino.Y = ((camino[caminoTrack] * Parametros.TamanyoTile) + (Parametros.TamanyoTile / 2));
destino.X = ((camino[(caminoTrack + 1)] * Parametros.TamanyoTile) + (Parametros.TamanyoTile / 2));
velocidad.subAndAssign(destino, posicion);
velocidad.normalize(factorVelocidad);
if ((((velocidad.Y < 0)) && ((velocidad.Y <= -(Math.abs(velocidad.X)))))){
currentAnimacion = 2;
currentText = "Abajo";
} else {
if ((((velocidad.X > 0)) && ((velocidad.X >= Math.abs(velocidad.Y))))){
currentAnimacion = 3;
currentText = "Izquierda";
} else {
if ((((velocidad.Y > 0)) && ((velocidad.Y >= Math.abs(velocidad.X))))){
currentAnimacion = 1;
currentText = "Arriba";
} else {
if ((((velocidad.X < 0)) && ((velocidad.X <= -(Math.abs(velocidad.Y)))))){
currentAnimacion = 4;
currentText = "Derecha";
};
};
};
};
movieClip.gotoAndStop(("Avanzar" + currentText));
}
private function setSonido(){
var ran:Number;
if (sufrirDanyoCounter <= 0){
player.danyarBase(baseDestino, danyoGolpe);
ran = Math.floor((Math.random() * 4));
switch (ran){
case 0:
player.level.padre.padre.soundSystem.canalSecundario = player.level.padre.padre.soundSystem.golpe1.play(0, 1, padre.padre.soundSystem.volPrincipal);
break;
case 1:
player.level.padre.padre.soundSystem.canalSecundario = player.level.padre.padre.soundSystem.golpe2.play(0, 1, padre.padre.soundSystem.volPrincipal);
break;
case 2:
player.level.padre.padre.soundSystem.canalSecundario = player.level.padre.padre.soundSystem.golpe3.play(0, 1, padre.padre.soundSystem.volPrincipal);
break;
case 3:
player.level.padre.padre.soundSystem.canalSecundario = player.level.padre.padre.soundSystem.golpe4.play(0, 1, padre.padre.soundSystem.volPrincipal);
break;
case 4:
player.level.padre.padre.soundSystem.canalSecundario = player.level.padre.padre.soundSystem.golpe4.play(0, 1, padre.padre.soundSystem.volPrincipal);
break;
};
sufrirDanyoCounter = 500;
} else {
if (sufrirDanyoCounter > 0){
sufrirDanyoCounter = (sufrirDanyoCounter - (1000 / 30));
};
};
}
private function darExperiencia(){
padre.padre.kongregate.stats.submit("Kill", 1);
switch (tipoEnemigo){
case 1:
player.updateScore(1);
player.updateExperience(1);
padre.padre.kongregate.stats.submit("ThumbSoldier", 1);
break;
case 2:
player.updateScore(2);
player.updateExperience(1);
padre.padre.kongregate.stats.submit("Seargent", 1);
break;
case 3:
player.updateScore(2);
player.updateExperience(2);
padre.padre.kongregate.stats.submit("Shooters", 1);
break;
case 4:
player.updateScore(2);
player.updateExperience(2);
padre.padre.kongregate.stats.submit("Kamikaze", 1);
break;
case 5:
player.updateScore(3);
player.updateExperience(3);
padre.padre.kongregate.stats.submit("IndexSoldiers", 1);
break;
case 6:
player.updateScore(2);
player.updateExperience(2);
padre.padre.kongregate.stats.submit("Runners", 1);
break;
case 7:
case 8:
player.updateScore(3);
player.updateExperience(3);
padre.padre.kongregate.stats.submit("Boss", 1);
break;
};
}
}
}//package
Section 97 (381 B)
//enemy_01 (enemy_01)
package {
import flash.display.*;
public dynamic class enemy_01 extends MovieClip {
public function enemy_01(){
super();
addFrameScript(47, frame48, 95, frame96, 99, frame100);
}
function frame100(){
gotoAndPlay("Idle");
}
function frame96(){
gotoAndPlay("Idle");
}
function frame48(){
gotoAndPlay("Idle");
}
}
}//package
Section 98 (316 B)
//enemy_02 (enemy_02)
package {
import flash.display.*;
public dynamic class enemy_02 extends MovieClip {
public function enemy_02(){
super();
addFrameScript(47, frame48, 51, frame52);
}
function frame48(){
gotoAndPlay("Idle");
}
function frame52(){
gotoAndPlay("Idle");
}
}
}//package
Section 99 (316 B)
//enemy_03 (enemy_03)
package {
import flash.display.*;
public dynamic class enemy_03 extends MovieClip {
public function enemy_03(){
super();
addFrameScript(47, frame48, 52, frame53);
}
function frame48(){
gotoAndPlay("Idle");
}
function frame53(){
gotoAndPlay("Idle");
}
}
}//package
Section 100 (204 B)
//EnergyBar (EnergyBar)
package {
import flash.display.*;
public dynamic class EnergyBar extends MovieClip {
public var green:GreenBar;
public function EnergyBar(){
super();
}
}
}//package
Section 101 (164 B)
//Entierro (Entierro)
package {
import flash.media.*;
public dynamic class Entierro extends Sound {
public function Entierro(){
super();
}
}
}//package
Section 102 (285 B)
//explocion_mc (explocion_mc)
package {
import flash.display.*;
public dynamic class explocion_mc extends MovieClip {
public function explocion_mc(){
super();
addFrameScript(14, frame15);
}
function frame15(){
stop();
parent.removeChild(this);
}
}
}//package
Section 103 (184 B)
//ExploDinamita (ExploDinamita)
package {
import flash.media.*;
public dynamic class ExploDinamita extends Sound {
public function ExploDinamita(){
super();
}
}
}//package
Section 104 (269 B)
//ExploGas (ExploGas)
package {
import flash.display.*;
public dynamic class ExploGas extends MovieClip {
public function ExploGas(){
super();
addFrameScript(19, frame20);
}
function frame20(){
stop();
parent.removeChild(this);
}
}
}//package
Section 105 (168 B)
//ExploMina (ExploMina)
package {
import flash.media.*;
public dynamic class ExploMina extends Sound {
public function ExploMina(){
super();
}
}
}//package
Section 106 (176 B)
//ExploRocket (ExploRocket)
package {
import flash.media.*;
public dynamic class ExploRocket extends Sound {
public function ExploRocket(){
super();
}
}
}//package
Section 107 (228 B)
//ExplosionDisparoEnemigo1 (ExplosionDisparoEnemigo1)
package {
import flash.media.*;
public dynamic class ExplosionDisparoEnemigo1 extends Sound {
public function ExplosionDisparoEnemigo1(){
super();
}
}
}//package
Section 108 (404 B)
//GameOverClip (GameOverClip)
package {
import flash.display.*;
public dynamic class GameOverClip extends MovieClip {
public var backB:SimpleButton;
public var gamagaLink:SimpleButton;
public var tryB:SimpleButton;
public function GameOverClip(){
super();
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 109 (178 B)
//gamePaused (gamePaused)
package {
import flash.display.*;
public dynamic class gamePaused extends MovieClip {
public function gamePaused(){
super();
}
}
}//package
Section 110 (162 B)
//gas_mc (gas_mc)
package {
import flash.display.*;
public dynamic class gas_mc extends MovieClip {
public function gas_mc(){
super();
}
}
}//package
Section 111 (166 B)
//GatoMap (GatoMap)
package {
import flash.display.*;
public dynamic class GatoMap extends MovieClip {
public function GatoMap(){
super();
}
}
}//package
Section 112 (186 B)
//GatoMapStill (GatoMapStill)
package {
import flash.display.*;
public dynamic class GatoMapStill extends MovieClip {
public function GatoMapStill(){
super();
}
}
}//package
Section 113 (156 B)
//Golpe1 (Golpe1)
package {
import flash.media.*;
public dynamic class Golpe1 extends Sound {
public function Golpe1(){
super();
}
}
}//package
Section 114 (156 B)
//Golpe2 (Golpe2)
package {
import flash.media.*;
public dynamic class Golpe2 extends Sound {
public function Golpe2(){
super();
}
}
}//package
Section 115 (156 B)
//Golpe3 (Golpe3)
package {
import flash.media.*;
public dynamic class Golpe3 extends Sound {
public function Golpe3(){
super();
}
}
}//package
Section 116 (156 B)
//Golpe4 (Golpe4)
package {
import flash.media.*;
public dynamic class Golpe4 extends Sound {
public function Golpe4(){
super();
}
}
}//package
Section 117 (184 B)
//GolpeEnemigo1 (GolpeEnemigo1)
package {
import flash.media.*;
public dynamic class GolpeEnemigo1 extends Sound {
public function GolpeEnemigo1(){
super();
}
}
}//package
Section 118 (184 B)
//GolpeEnemigo2 (GolpeEnemigo2)
package {
import flash.media.*;
public dynamic class GolpeEnemigo2 extends Sound {
public function GolpeEnemigo2(){
super();
}
}
}//package
Section 119 (184 B)
//GolpeEnemigo3 (GolpeEnemigo3)
package {
import flash.media.*;
public dynamic class GolpeEnemigo3 extends Sound {
public function GolpeEnemigo3(){
super();
}
}
}//package
Section 120 (184 B)
//GolpeEnemigo4 (GolpeEnemigo4)
package {
import flash.media.*;
public dynamic class GolpeEnemigo4 extends Sound {
public function GolpeEnemigo4(){
super();
}
}
}//package
Section 121 (184 B)
//GolpeEnemigo5 (GolpeEnemigo5)
package {
import flash.media.*;
public dynamic class GolpeEnemigo5 extends Sound {
public function GolpeEnemigo5(){
super();
}
}
}//package
Section 122 (170 B)
//GreenBar (GreenBar)
package {
import flash.display.*;
public dynamic class GreenBar extends MovieClip {
public function GreenBar(){
super();
}
}
}//package
Section 123 (160 B)
//GunFire (GunFire)
package {
import flash.media.*;
public dynamic class GunFire extends Sound {
public function GunFire(){
super();
}
}
}//package
Section 124 (184 B)
//GunFire_doble (GunFire_doble)
package {
import flash.media.*;
public dynamic class GunFire_doble extends Sound {
public function GunFire_doble(){
super();
}
}
}//package
Section 125 (164 B)
//GunFire2 (GunFire2)
package {
import flash.media.*;
public dynamic class GunFire2 extends Sound {
public function GunFire2(){
super();
}
}
}//package
Section 126 (192 B)
//GunFire2_double (GunFire2_double)
package {
import flash.media.*;
public dynamic class GunFire2_double extends Sound {
public function GunFire2_double(){
super();
}
}
}//package
Section 127 (296 B)
//HealthSpace (HealthSpace)
package {
import flash.display.*;
public dynamic class HealthSpace extends MovieClip {
public function HealthSpace(){
super();
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 128 (170 B)
//hielo_mc (hielo_mc)
package {
import flash.display.*;
public dynamic class hielo_mc extends MovieClip {
public function hielo_mc(){
super();
}
}
}//package
Section 129 (1.6 KiB) ●
//HowToPlay (HowToPlay)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class HowToPlay extends MovieClip {
public var conq2:domCircle;
public var conq3:domCircle;
public var padre:UICanvas;
public var button:SimpleButton;
public var backB:SimpleButton;
var interval:Timer;
public var conq1:domCircle;
public function HowToPlay(){
super();
addFrameScript(0, frame1);
backB = button;
alpha = 0;
interval = new Timer((1000 / 24), 0);
backB.addEventListener(MouseEvent.CLICK, backClick);
backB.addEventListener(MouseEvent.ROLL_OVER, backOver);
backB.addEventListener(MouseEvent.ROLL_OUT, backOut);
}
public function backOver(event:MouseEvent):void{
}
function fadeOut(event:TimerEvent):void{
alpha = (alpha - 0.1);
if (alpha <= 0){
interval.removeEventListener(TimerEvent.TIMER, fadeOut);
padre.addMainMenu();
padre.removeChild(this);
};
}
function frame1(){
conq1.gotoAndStop(1);
conq2.gotoAndStop(2);
conq2.domMask.scaleX = 0.75;
conq1.domMask.scaleX = 0;
conq3.gotoAndStop(3);
}
function exitWindow(){
interval.addEventListener(TimerEvent.TIMER, fadeOut);
}
function fadeIn(event:TimerEvent):void{
alpha = (alpha + 0.1);
if (alpha >= 1){
interval.removeEventListener(TimerEvent.TIMER, fadeIn);
};
}
public function backClick(event:MouseEvent):void{
backB.enabled = false;
exitWindow();
}
function enterWindow(){
interval.addEventListener(TimerEvent.TIMER, fadeIn);
interval.start();
}
public function backOut(event:MouseEvent):void{
}
}
}//package
Section 130 (36.67 KiB) ● ● ● ●
//HudMenu (HudMenu)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.ui.*;
public class HudMenu extends MovieClip {
public var toxicMineButton:MovieClip;
public var nivel:MovieClip;
public var rateCount:int;// = 0
public var healthCount:int;// = 0
public var healthBar:MovieClip;
public var _mainButton:SimpleButton;
public var rateButton:SimpleButton;
public var _healthPoints:TextField;
public var healthButtonMinus:SimpleButton;
var selectedTrap:int;
public var _costMisil:TextField;
public var damageIcon:MovieClip;
public var losingBase:LosingBase;
public var nextWave:SimpleButton;
public var soundButtonOff:SimpleButton;
public var _speedButton:SimpleButton;
public var info:MovieClip;
public var conquering:Conquering;
public var healthButton:SimpleButton;
public var expBar:MovieClip;
public var _addLevel:MovieClip;
public var pauseButton:SimpleButton;
public var infoDano:TextField;
public var actualDom:TextField;
public var _actualLevel:TextField;
public var _continueButton:SimpleButton;
public var boxButton:MovieClip;
public var _nextWaveButton:SimpleButton;
public var sniperButton:MovieClip;
public var infoTipo:TextField;
public var playerName:TextField;
public var _rangeButton:SimpleButton;
public var _rateButtonMinus:SimpleButton;
public var bonusObtained:BonusObtained;
public var waveHudBack:MovieClip;
public var _rangeButtonMinus:SimpleButton;
public var _gamePaused:gamePaused;
public var baseButton:MovieClip;
public var mineButton:MovieClip;
public var damageButtonMinus:SimpleButton;
public var speedIcon:MovieClip;
public var _damageButton:SimpleButton;
public var misilButton:MovieClip;
public var _costBase:TextField;
public var actualScore:TextField;
public var dynamiteButton:MovieClip;
public var levelUpCost:TextField;
public var _freezeMineButton:MovieClip;
public var _toxicMineButton:MovieClip;
var selectedObject:MovieClip;
public var _costTower:TextField;
public var rangeCount:int;// = 0
public var _expBar:MovieClip;
public var _rateButton:SimpleButton;
public var ratePoints:TextField;
public var _healthButtonMinus:SimpleButton;
public var _towerButton:MovieClip;
public var inGameIntro:InGameIntro;
public var _waveHud:WaveHud;
public var padre:Canvas;
public var infoTitulo:TextField;
public var mButton:MovieClip;
public var _soundOn:SimpleButton;
public var _actualMoney:TextField;
public var pushCount:int;// = 0
public var infoCosto:TextField;
public var infoRof:TextField;
public var infoWindow:MovieClip;
public var mainButton:SimpleButton;
public var _speedPoints:TextField;
public var _healthButton:SimpleButton;
public var _healthBar:MovieClip;
public var _playerName:TextField;
public var uziButton:MovieClip;
public var continueButton:SimpleButton;
public var _rangePoints:TextField;
public var rangeButton:SimpleButton;
public var shotgunButton:MovieClip;
public var soundButtonOn:SimpleButton;
public var rangeButtonMinus:SimpleButton;
var player:Player;
public var damageCount:int;// = 0
public var _damageButtonMinus:SimpleButton;
public var _costDynamite:TextField;
public var _mineButton:MovieClip;
public var _baseButton:MovieClip;
public var pointControled:PointControled;
public var _pauseButton:SimpleButton;
public var _damagePoints:TextField;
public var rocketButton:MovieClip;
public var _costMine:TextField;
public var _botonUpgrade:MovieClip;
public var waveHud:MovieClip;
public var _soundOff:SimpleButton;
public var _actualDom:TextField;
public var rangeIcon:MovieClip;
public var upPoints:MovieClip;
public var freezeMineButton:MovieClip;
public var rateButtonMinus:SimpleButton;
public var addLevel:MovieClip;
public var _boxButton:MovieClip;
public var berettaButton:MovieClip;
public var damageButton:SimpleButton;
public var _ratePoints:TextField;
var level:CanvasScenario;
public var _totalPoints:TextField;
public var towerButton:MovieClip;
public var overhud:Boolean;// = false
public var _misilButton:MovieClip;
public var actualMoney:TextField;
public var _dynamiteButton:MovieClip;
public var _actualScore:TextField;
public var _levelUpCost:TextField;
var posicionDiscreta:Boolean;
public var _nivelStar:MovieClip;
public var _speedButtonMinus:SimpleButton;
public static const TOXIC_MINE_TRAP:int = -4;
public static const BOX:int = 1;
public static const TOWER:int = 4;
public static const FREEZE_MINE_TRAP:int = -5;
public static const DYNAMITE_TRAP:int = -2;
public static const BASE:int = -3;
public static const MINE_TRAP:int = -1;
public static const MISIL:int = 5;
public function HudMenu(_padre:Canvas, level:CanvasScenario, player:Player){
var i:int;
var newWave:MovieClip;
overhud = false;
healthCount = 0;
damageCount = 0;
rateCount = 0;
pushCount = 0;
rangeCount = 0;
super();
padre = _padre;
padre.stage.addEventListener(MouseEvent.MOUSE_MOVE, moverCursor);
padre.stage.addEventListener(MouseEvent.MOUSE_UP, soltarObjeto);
padre.stage.addEventListener(KeyboardEvent.KEY_DOWN, onPressKey);
this.level = level;
this.player = player;
_actualMoney = actualMoney;
_actualMoney.text = player.money.toString();
_actualDom = actualDom;
_actualDom.text = player.domination.toString();
_mineButton = mineButton;
_toxicMineButton = toxicMineButton;
_freezeMineButton = freezeMineButton;
_dynamiteButton = dynamiteButton;
_baseButton = baseButton;
_towerButton = towerButton;
_misilButton = misilButton;
_playerName = playerName;
_actualLevel = nivel.actualLevel;
_actualLevel.text = player.nivel.toString();
_addLevel = addLevel;
_levelUpCost = levelUpCost;
_mainButton = mainButton;
_expBar = expBar;
_healthBar = healthBar;
_nextWaveButton = nextWave;
infoWindow = info;
_actualScore = actualScore;
_pauseButton = pauseButton;
_continueButton = continueButton;
_soundOn = soundButtonOn;
_soundOff = soundButtonOff;
_boxButton = boxButton;
_boxButton.addEventListener(MouseEvent.MOUSE_DOWN, boxSelected);
_mineButton.addEventListener(MouseEvent.MOUSE_DOWN, mineSelected);
_toxicMineButton.addEventListener(MouseEvent.MOUSE_DOWN, toxicMineSelected);
_freezeMineButton.addEventListener(MouseEvent.MOUSE_DOWN, freezeMineSelected);
_dynamiteButton.addEventListener(MouseEvent.MOUSE_DOWN, dynamiteSelected);
_baseButton.addEventListener(MouseEvent.MOUSE_DOWN, baseSelected);
_towerButton.addEventListener(MouseEvent.MOUSE_DOWN, towerSelected);
_misilButton.addEventListener(MouseEvent.MOUSE_DOWN, misilSelected);
_addLevel.addEventListener(MouseEvent.MOUSE_DOWN, levelUpSelected);
_mainButton.addEventListener(MouseEvent.CLICK, mainMenuAccess);
_nextWaveButton.addEventListener(MouseEvent.CLICK, nextWaveOrder);
_pauseButton.addEventListener(MouseEvent.CLICK, pauseGame);
_continueButton.addEventListener(MouseEvent.CLICK, pauseGame);
_soundOn.addEventListener(MouseEvent.CLICK, soundOn);
_soundOff.addEventListener(MouseEvent.CLICK, soundOff);
this.berettaButton.addEventListener(MouseEvent.CLICK, berettaClick);
this.uziButton.addEventListener(MouseEvent.CLICK, uziClick);
this.mButton.addEventListener(MouseEvent.CLICK, mClick);
this.shotgunButton.addEventListener(MouseEvent.CLICK, shotgunClick);
this.rocketButton.addEventListener(MouseEvent.CLICK, rocketClick);
this.sniperButton.addEventListener(MouseEvent.CLICK, sniperClick);
_playerName.text = padre.padre.local_data.data.playerName;
_expBar.addEventListener(MouseEvent.ROLL_OVER, expOver);
_expBar.addEventListener(MouseEvent.ROLL_OUT, expOut);
_healthBar.addEventListener(MouseEvent.ROLL_OVER, healthOver);
_healthBar.addEventListener(MouseEvent.ROLL_OUT, healthOut);
_mineButton.addEventListener(MouseEvent.ROLL_OVER, mineOver);
_dynamiteButton.addEventListener(MouseEvent.ROLL_OVER, dynamiteOver);
_baseButton.addEventListener(MouseEvent.ROLL_OVER, baseOver);
_toxicMineButton.addEventListener(MouseEvent.ROLL_OVER, toxicOver);
_freezeMineButton.addEventListener(MouseEvent.ROLL_OVER, freezeOver);
_boxButton.addEventListener(MouseEvent.ROLL_OVER, boxOver);
this.upPoints.addEventListener(MouseEvent.ROLL_OVER, upOver);
this.addEventListener(MouseEvent.ROLL_OVER, hudOver);
this.speedIcon.addEventListener(MouseEvent.ROLL_OVER, speedOver);
this.damageIcon.addEventListener(MouseEvent.ROLL_OVER, damageOver);
this.rangeIcon.addEventListener(MouseEvent.ROLL_OVER, rangeOver);
this.berettaButton.addEventListener(MouseEvent.ROLL_OVER, berettaOver);
this.uziButton.addEventListener(MouseEvent.ROLL_OVER, uziOver);
this.mButton.addEventListener(MouseEvent.ROLL_OVER, mOver);
this.shotgunButton.addEventListener(MouseEvent.ROLL_OVER, shotgunOver);
this.rocketButton.addEventListener(MouseEvent.ROLL_OVER, rocketOver);
this.sniperButton.addEventListener(MouseEvent.ROLL_OVER, sniperOver);
_mineButton.addEventListener(MouseEvent.ROLL_OUT, mineOut);
_dynamiteButton.addEventListener(MouseEvent.ROLL_OUT, mineOut);
_baseButton.addEventListener(MouseEvent.ROLL_OUT, mineOut);
_toxicMineButton.addEventListener(MouseEvent.ROLL_OUT, mineOut);
_freezeMineButton.addEventListener(MouseEvent.ROLL_OUT, mineOut);
_boxButton.addEventListener(MouseEvent.ROLL_OUT, mineOut);
this.upPoints.addEventListener(MouseEvent.ROLL_OUT, mineOut);
this.addEventListener(MouseEvent.ROLL_OUT, hudOut);
this.speedIcon.addEventListener(MouseEvent.ROLL_OUT, mineOut);
this.damageIcon.addEventListener(MouseEvent.ROLL_OUT, mineOut);
this.rangeIcon.addEventListener(MouseEvent.ROLL_OUT, mineOut);
this.berettaButton.addEventListener(MouseEvent.ROLL_OUT, mineOut);
this.uziButton.addEventListener(MouseEvent.ROLL_OUT, mineOut);
this.mButton.addEventListener(MouseEvent.ROLL_OUT, mineOut);
this.shotgunButton.addEventListener(MouseEvent.ROLL_OUT, mineOut);
this.rocketButton.addEventListener(MouseEvent.ROLL_OUT, mineOut);
this.sniperButton.addEventListener(MouseEvent.ROLL_OUT, mineOut);
_mineButton.marcoBoton.alpha = 0;
_toxicMineButton.marcoBoton.alpha = 0;
_freezeMineButton.marcoBoton.alpha = 0;
_dynamiteButton.marcoBoton.alpha = 0;
_baseButton.marcoBoton.alpha = 0;
_towerButton.marcoBoton.alpha = 0;
_misilButton.marcoBoton.alpha = 0;
_boxButton.marcoBoton.alpha = 0;
_actualScore.text = "0";
_healthButton = healthButton;
_rangeButton = rangeButton;
_rateButton = rateButton;
_damageButton = damageButton;
_healthButtonMinus = healthButtonMinus;
_rangeButtonMinus = rangeButtonMinus;
_rateButtonMinus = rateButtonMinus;
_damageButtonMinus = damageButtonMinus;
_healthButton.addEventListener(MouseEvent.CLICK, moreHealth);
_rangeButton.addEventListener(MouseEvent.CLICK, moreRange);
_rateButton.addEventListener(MouseEvent.CLICK, moreRate);
_damageButton.addEventListener(MouseEvent.CLICK, moreDamage);
_healthButtonMinus.addEventListener(MouseEvent.CLICK, lessHealth);
_rangeButtonMinus.addEventListener(MouseEvent.CLICK, lessRange);
_rateButtonMinus.addEventListener(MouseEvent.CLICK, lessRate);
_damageButtonMinus.addEventListener(MouseEvent.CLICK, lessDamage);
_healthPoints = this.speedIcon.healthPoints;
_rangePoints = this.rangeIcon.rangePoints;
_ratePoints = ratePoints;
_damagePoints = this.damageIcon.damagePoints;
_totalPoints = this.upPoints.totalPoints;
_totalPoints.text = (padre.player.points + "");
_healthPoints.text = "0";
_rangePoints.text = "0";
_ratePoints.text = "0";
_damagePoints.text = "0";
upgradeUpgrade(padre.player.points);
_pauseButton.visible = true;
_pauseButton.alpha = 1;
_pauseButton.enabled = true;
_continueButton.visible = false;
_continueButton.alpha = 0;
_continueButton.visible = false;
_expBar.gotoAndStop(1);
_healthBar.gotoAndStop(1);
padre.padre.soundSystem.volPrincipal.volume = 0.6;
_soundOn.enabled = true;
_soundOn.visible = true;
_soundOn.alpha = 1;
_soundOff.enabled = false;
_soundOff.visible = false;
_soundOff.alpha = 0;
if (waveHudBack == null){
waveHudBack = _waveHud.valueOf();
};
waveHud = waveHudBack;
i = 1;
while (i < padre.canvasScenario.parametrosOlas.length) {
newWave = new newWaveBar();
newWave.gotoAndStop(padre.canvasScenario.parametrosOlas[i][9]);
newWave.wave.text = ("" + i);
newWave.x = (80 * (i - 1));
waveHud.waveBar.addChild(newWave);
i++;
};
upgradeUpgrade(padre.player.points);
}
public function upgradeButtonOut(e:MouseEvent){
_botonUpgrade.gotoAndStop(1);
}
public function freezeOver(e:MouseEvent){
_freezeMineButton.marcoBoton.alpha = 1;
infoWindow.startDrag();
infoWindow.x = (padre.mouseInScreen.X + 5);
infoWindow.y = (padre.mouseInScreen.Y - 5);
infoWindow.gotoAndStop(4);
}
public function refreshHud(){
if (player.money >= Parametros.CostoMina){
mineButton.gotoAndStop("alcansa");
} else {
mineButton.gotoAndStop("noalcansa");
};
if (player.money >= Parametros.CostoDinamita){
dynamiteButton.gotoAndStop("alcansa");
} else {
dynamiteButton.gotoAndStop("noalcansa");
};
if (player.money >= Parametros.CostoBase){
baseButton.gotoAndStop("alcansa");
} else {
baseButton.gotoAndStop("noalcansa");
};
if (player.money >= Parametros.CostoMinaToxica){
toxicMineButton.gotoAndStop("alcansa");
} else {
toxicMineButton.gotoAndStop("noalcansa");
};
if (player.money >= Parametros.CostoMinaCongelar){
freezeMineButton.gotoAndStop("alcansa");
} else {
freezeMineButton.gotoAndStop("noalcansa");
};
if (player.money >= 5){
boxButton.gotoAndStop("alcansa");
} else {
boxButton.gotoAndStop("noalcansa");
};
if (player.weaponEnabled[0] == 0){
this.berettaButton.block.alpha = 100;
} else {
this.berettaButton.block.alpha = 0;
};
if (player.weaponEnabled[1] == 0){
this.uziButton.block.alpha = 100;
} else {
this.uziButton.block.alpha = 0;
};
if (player.weaponEnabled[2] == 0){
this.shotgunButton.block.alpha = 100;
} else {
this.shotgunButton.block.alpha = 0;
};
if (player.weaponEnabled[3] == 0){
this.mButton.block.alpha = 100;
} else {
this.mButton.block.alpha = 0;
};
if (player.weaponEnabled[4] == 0){
this.sniperButton.block.alpha = 100;
} else {
this.sniperButton.block.alpha = 0;
};
if (player.weaponEnabled[5] == 0){
this.rocketButton.block.alpha = 100;
} else {
this.rocketButton.block.alpha = 0;
};
if (player.currentWeapon == 0){
this.berettaButton.selected.alpha = 100;
} else {
this.berettaButton.selected.alpha = 0;
};
if (player.currentWeapon == 1){
this.uziButton.selected.alpha = 100;
} else {
this.uziButton.selected.alpha = 0;
};
if (player.currentWeapon == 2){
this.shotgunButton.selected.alpha = 100;
} else {
this.shotgunButton.selected.alpha = 0;
};
if (player.currentWeapon == 3){
this.mButton.selected.alpha = 100;
} else {
this.mButton.selected.alpha = 0;
};
if (player.currentWeapon == 4){
this.sniperButton.selected.alpha = 100;
} else {
this.sniperButton.selected.alpha = 0;
};
if (player.currentWeapon == 5){
this.rocketButton.selected.alpha = 100;
} else {
this.rocketButton.selected.alpha = 0;
};
_actualMoney.text = player.money.toString();
_actualDom.text = player.domination.toString();
_actualLevel.text = player.nivel.toString();
}
public function mineSelected(e:MouseEvent){
if ((((player.money >= Parametros.CostoMina)) && (padre.isRun))){
selectedObject = new MineMC();
this.padre.addChild(selectedObject);
selectedTrap = MINE_TRAP;
posicionDiscreta = true;
};
}
public function freezeMineSelected(e:MouseEvent){
if ((((player.money >= Parametros.CostoMina)) && (padre.isRun))){
selectedObject = new bombaMinaHielo_mc();
this.padre.addChild(selectedObject);
selectedTrap = FREEZE_MINE_TRAP;
posicionDiscreta = true;
};
}
public function conqueringMessage(isConquering:Boolean){
if ((((conquering == null)) && (isConquering))){
conquering = new Conquering();
conquering.x = (Canvas.APPLICATION_WIDTH / 2);
conquering.y = 25;
padre.addChild(conquering);
padre.padre.soundSystem.sonidoMenuB.play(0, 1, padre.padre.soundSystem.volPrincipal);
} else {
if (((!((conquering == null))) && (!(isConquering)))){
padre.removeChild(conquering);
conquering = null;
};
};
}
public function upgradeUpgrade(value:Number){
if (player.points == 0){
this.upPoints.gotoAndStop(1);
} else {
this.upPoints.gotoAndStop(2);
};
if (healthCount > 0){
_healthButtonMinus.alpha = 1;
_healthButtonMinus.enabled = true;
_healthButtonMinus.visible = true;
} else {
_healthButtonMinus.alpha = 0;
_healthButtonMinus.enabled = false;
_healthButtonMinus.visible = false;
};
if (rangeCount > 0){
_rangeButtonMinus.alpha = 1;
_rangeButtonMinus.enabled = true;
_rangeButtonMinus.visible = true;
} else {
_rangeButtonMinus.alpha = 0;
_rangeButtonMinus.enabled = false;
_rangeButtonMinus.visible = false;
};
if (rateCount > 0){
_rateButtonMinus.alpha = 1;
_rateButtonMinus.enabled = true;
_rateButtonMinus.visible = true;
} else {
_rateButtonMinus.alpha = 0;
_rateButtonMinus.enabled = false;
_rateButtonMinus.visible = false;
};
if (damageCount > 0){
_damageButtonMinus.alpha = 1;
_damageButtonMinus.enabled = true;
_damageButtonMinus.visible = true;
} else {
_damageButtonMinus.alpha = 0;
_damageButtonMinus.enabled = false;
_damageButtonMinus.visible = false;
};
if ((((value > 0)) && ((value < 10)))){
_healthButton.alpha = 1;
_healthButton.enabled = true;
_healthButton.visible = true;
_rangeButton.alpha = 1;
_rangeButton.enabled = true;
_rangeButton.visible = true;
_rateButton.alpha = 1;
_rateButton.enabled = true;
_rateButton.visible = true;
_damageButton.alpha = 1;
_damageButton.enabled = true;
_damageButton.visible = true;
} else {
_healthButton.alpha = 0;
_healthButton.enabled = false;
_healthButton.visible = false;
_rangeButton.alpha = 0;
_rangeButton.enabled = false;
_rangeButton.visible = false;
_rateButton.alpha = 0;
_rateButton.enabled = false;
_rateButton.visible = false;
_damageButton.alpha = 0;
_damageButton.enabled = false;
_damageButton.visible = false;
};
refreshHud();
}
public function dynamiteOver(e:MouseEvent){
_dynamiteButton.marcoBoton.alpha = 1;
infoWindow.startDrag();
infoWindow.x = (padre.mouseInScreen.X + 5);
infoWindow.y = (padre.mouseInScreen.Y - 5);
infoWindow.gotoAndStop(5);
}
public function expOver(e:MouseEvent){
_expBar.gotoAndStop(2);
}
public function baseSelected(e:MouseEvent){
if ((((player.money >= Parametros.CostoBase)) && (padre.isRun))){
selectedObject = new BaseMC();
this.padre.addChild(selectedObject);
selectedTrap = BASE;
posicionDiscreta = true;
};
}
public function toxicOver(e:MouseEvent){
_toxicMineButton.marcoBoton.alpha = 1;
infoWindow.startDrag();
infoWindow.x = (padre.mouseInScreen.X + 5);
infoWindow.y = (padre.mouseInScreen.Y - 5);
infoWindow.gotoAndStop(3);
}
public function towerSelected(e:MouseEvent){
if ((((player.money >= Parametros.CostoTorreta)) && (padre.isRun))){
this.padre.addChild(selectedObject);
selectedTrap = TOWER;
posicionDiscreta = true;
};
}
public function damageOver(e:MouseEvent){
infoWindow.startDrag();
infoWindow.x = (padre.mouseInScreen.X + 5);
infoWindow.y = (padre.mouseInScreen.Y - 5);
infoWindow.gotoAndStop(9);
}
public function toxicMineSelected(e:MouseEvent){
if ((((player.money >= Parametros.CostoMina)) && (padre.isRun))){
selectedObject = new bombaMinaGas_mc();
this.padre.addChild(selectedObject);
selectedTrap = TOXIC_MINE_TRAP;
posicionDiscreta = true;
};
}
public function levelUpSelected(e:MouseEvent){
player.levelUp();
if ((player.nivel + 1) < Parametros.ParametrosPlayerPorNivel.length){
_actualLevel.text = player.nivel.toString();
_levelUpCost.text = Parametros.ParametrosPlayerPorNivel[(player.nivel + 1)][4].toString();
} else {
_addLevel.visible = false;
_addLevel.enabled = false;
};
refreshHud();
}
public function losingMessage(isLosing:Boolean){
if ((((losingBase == null)) && (isLosing))){
losingBase = new LosingBase();
losingBase.x = (Canvas.APPLICATION_WIDTH / 2);
losingBase.y = 25;
padre.addChild(losingBase);
padre.padre.soundSystem.sonidoMenuB.play(0, 1, padre.padre.soundSystem.volPrincipal);
} else {
if (((!((losingBase == null))) && ((isLosing == false)))){
padre.removeChild(losingBase);
losingBase = null;
};
};
}
public function mClick(e:MouseEvent){
if (player.weaponEnabled[3] == 0){
if (player.points >= 2){
player.weaponEnabled[3] = 1;
player.points = (player.points - 2);
_totalPoints.text = (player.points + "");
upgradeUpgrade(player.points);
this.mButton.block.alpha = 0;
player.setWeapon(3);
infoWindow.unlockable.alpha = 0;
};
} else {
this.mButton.block.alpha = 0;
player.setWeapon(3);
};
refreshHud();
}
public function shotgunClick(e:MouseEvent){
if (player.weaponEnabled[2] == 0){
if (player.points >= 4){
player.weaponEnabled[2] = 1;
player.points = (player.points - 4);
_totalPoints.text = (player.points + "");
upgradeUpgrade(player.points);
this.shotgunButton.block.alpha = 0;
player.setWeapon(2);
infoWindow.unlockable.alpha = 0;
};
} else {
this.shotgunButton.block.alpha = 0;
player.setWeapon(2);
};
refreshHud();
}
public function boxOver(e:MouseEvent){
_boxButton.marcoBoton.alpha = 1;
infoWindow.startDrag();
infoWindow.x = (padre.mouseInScreen.X + 5);
infoWindow.y = (padre.mouseInScreen.Y - 5);
infoWindow.gotoAndStop(6);
}
public function healthOver(e:MouseEvent){
_healthBar.gotoAndStop(2);
}
public function lessHealth(e:MouseEvent){
if (healthCount > 0){
healthCount--;
player.setWeapon(player.currentWeapon);
_healthPoints.text = (healthCount + "");
player.points++;
_totalPoints.text = (player.points + "");
upgradeUpgrade(player.points);
};
}
public function uziOver(e:MouseEvent){
this.uziButton.marcoBoton.alpha = 1;
infoWindow.startDrag();
infoWindow.x = (padre.mouseInScreen.X + 5);
infoWindow.y = (padre.mouseInScreen.Y - 5);
infoWindow.gotoAndStop(12);
if (player.weaponEnabled[1] == 0){
infoWindow.unlockable.alpha = 1;
} else {
infoWindow.unlockable.alpha = 0;
};
}
public function moverCursor(e:MouseEvent){
if (((!((selectedObject == null))) && (padre.isRun))){
if (posicionDiscreta){
selectedObject.x = level.toLevelTileCoordX(e.stageX);
selectedObject.y = level.toLevelTileCoordY(e.stageY);
} else {
selectedObject.x = e.stageX;
selectedObject.y = e.stageY;
};
};
}
public function uziClick(e:MouseEvent){
if (player.weaponEnabled[1] == 0){
if (player.points >= 2){
player.weaponEnabled[1] = 1;
player.points = (player.points - 2);
_totalPoints.text = (player.points + "");
upgradeUpgrade(player.points);
this.uziButton.block.alpha = 0;
player.setWeapon(1);
infoWindow.unlockable.alpha = 0;
};
} else {
this.uziButton.block.alpha = 0;
player.setWeapon(1);
};
refreshHud();
}
public function boxSelected(e:MouseEvent){
if ((((player.money >= 5)) && (padre.isRun))){
selectedObject = new boxTrap_mc();
this.addChild(selectedObject);
selectedTrap = BOX;
posicionDiscreta = true;
};
}
public function gameIntro(){
inGameIntro = new InGameIntro();
inGameIntro.x = (Canvas.APPLICATION_WIDTH / 2);
inGameIntro.y = (Canvas.APPLICATION_HEIGHT - 75);
padre.addChild(inGameIntro);
}
public function soltarObjeto(e:MouseEvent){
if (((!((selectedObject == null))) && (padre.isRun))){
if (selectedTrap != BOX){
padre.removeChild(selectedObject);
} else {
this.removeChild(selectedObject);
};
if (e.stageX < Canvas.APPLICATION_WIDTH){
switch (selectedTrap){
case MINE_TRAP:
case TOXIC_MINE_TRAP:
case FREEZE_MINE_TRAP:
level.addMina(selectedObject.x, selectedObject.y, selectedTrap, selectedObject);
break;
case DYNAMITE_TRAP:
level.addDinamita(selectedObject.x, selectedObject.y);
break;
case BASE:
level.addTurret(selectedObject.x, selectedObject.y);
break;
case TOWER:
break;
case MISIL:
break;
case BOX:
level.addBox(selectedObject.x, selectedObject.y);
break;
};
};
selectedObject = null;
};
refreshHud();
}
public function rocketOver(e:MouseEvent){
this.rocketButton.marcoBoton.alpha = 1;
infoWindow.startDrag();
infoWindow.x = (padre.mouseInScreen.X + 5);
infoWindow.y = (padre.mouseInScreen.Y - 5);
infoWindow.gotoAndStop(16);
if (player.weaponEnabled[5] == 0){
infoWindow.unlockable.alpha = 1;
} else {
infoWindow.unlockable.alpha = 0;
};
}
public function speedOver(e:MouseEvent){
infoWindow.startDrag();
infoWindow.x = (padre.mouseInScreen.X + 5);
infoWindow.y = (padre.mouseInScreen.Y - 5);
infoWindow.gotoAndStop(8);
}
public function sniperClick(e:MouseEvent){
if (player.weaponEnabled[4] == 0){
if (player.points >= 4){
player.weaponEnabled[4] = 1;
player.points = (player.points - 4);
_totalPoints.text = (player.points + "");
upgradeUpgrade(player.points);
this.sniperButton.block.alpha = 0;
player.setWeapon(4);
infoWindow.unlockable.alpha = 0;
};
} else {
this.sniperButton.block.alpha = 0;
player.setWeapon(4);
};
refreshHud();
}
public function moreRate(e:MouseEvent){
rateCount++;
player.setWeapon(player.currentWeapon);
_ratePoints.text = (rateCount + "");
if (player.points > 0){
padre.player.points--;
_totalPoints.text = (padre.player.points + "");
upgradeUpgrade(padre.player.points);
};
}
public function getUpgrade(e:MouseEvent){
if ((((padre.isWin == false)) && (padre.player.update(padre.mouseInLevel, (1000 / padre.FrameRate))))){
if (padre.isRun == true){
};
};
}
public function soundOff(e:MouseEvent){
padre.padre.soundSystem.volPrincipal.volume = 0.6;
_soundOn.enabled = true;
_soundOn.visible = true;
_soundOn.alpha = 1;
_soundOff.enabled = false;
_soundOff.visible = false;
_soundOff.alpha = 0;
}
public function shotgunOver(e:MouseEvent){
this.shotgunButton.marcoBoton.alpha = 1;
infoWindow.startDrag();
infoWindow.x = (padre.mouseInScreen.X + 5);
infoWindow.y = (padre.mouseInScreen.Y - 5);
infoWindow.gotoAndStop(14);
if (player.weaponEnabled[3] == 0){
infoWindow.unlockable.alpha = 1;
} else {
infoWindow.unlockable.alpha = 0;
};
}
public function mineOut(e:MouseEvent){
_mineButton.marcoBoton.alpha = 0;
_dynamiteButton.marcoBoton.alpha = 0;
_baseButton.marcoBoton.alpha = 0;
_toxicMineButton.marcoBoton.alpha = 0;
_freezeMineButton.marcoBoton.alpha = 0;
_boxButton.marcoBoton.alpha = 0;
this.berettaButton.marcoBoton.alpha = 0;
this.uziButton.marcoBoton.alpha = 0;
this.mButton.marcoBoton.alpha = 0;
this.shotgunButton.marcoBoton.alpha = 0;
this.rocketButton.marcoBoton.alpha = 0;
this.sniperButton.marcoBoton.alpha = 0;
infoWindow.stopDrag();
infoWindow.gotoAndStop(1);
infoWindow.unlockable.alpha = 0;
}
public function upOver(e:MouseEvent){
infoWindow.startDrag();
infoWindow.x = (padre.mouseInScreen.X + 5);
infoWindow.y = (padre.mouseInScreen.Y - 5);
infoWindow.gotoAndStop(7);
}
public function onPressKey(event:KeyboardEvent){
switch (event.keyCode){
case Keyboard.SPACE:
case 85:
break;
case 80:
if ((((padre.isWin == false)) && (padre.player.update(padre.mouseInLevel, (1000 / padre.FrameRate))))){
if (padre.isRun == false){
padre.intervalo.start();
padre.isRun = true;
padre.removeChild(_gamePaused);
_gamePaused = null;
_pauseButton.visible = true;
_pauseButton.alpha = 1;
_pauseButton.enabled = true;
_continueButton.visible = false;
_continueButton.alpha = 0;
_continueButton.visible = false;
} else {
padre.intervalo.stop();
padre.isRun = false;
_gamePaused = new gamePaused();
_gamePaused.x = (Canvas.APPLICATION_WIDTH / 2);
_gamePaused.y = (Canvas.APPLICATION_HEIGHT / 2);
padre.addChild(_gamePaused);
_pauseButton.visible = false;
_pauseButton.alpha = 0;
_pauseButton.enabled = false;
_continueButton.visible = true;
_continueButton.alpha = 1;
_continueButton.visible = true;
};
};
break;
};
}
public function lessRate(e:MouseEvent){
if (rateCount > 0){
rateCount--;
player.setWeapon(player.currentWeapon);
_ratePoints.text = (rateCount + "");
padre.player.points++;
_totalPoints.text = (padre.player.points + "");
upgradeUpgrade(padre.player.points);
};
}
public function nextWaveOrder(e:MouseEvent){
padre.canvasScenario.timeToNextWave = 0;
padre.canvasScenario.updateTimeCounter();
}
public function moreHealth(e:MouseEvent){
healthCount++;
player.setWeapon(player.currentWeapon);
_healthPoints.text = (healthCount + "");
if (player.points > 0){
player.points--;
_totalPoints.text = (player.points + "");
upgradeUpgrade(player.points);
};
}
public function mainMenuAccess(e:MouseEvent){
padre.player.movieClip.stage.removeEventListener(KeyboardEvent.KEY_DOWN, padre.player.onKeyDown);
padre.player.movieClip.stage.removeEventListener(KeyboardEvent.KEY_UP, padre.player.onKeyUp);
padre.player.movieClip.stage.removeEventListener(MouseEvent.MOUSE_DOWN, padre.player.onClick);
padre.player.movieClip.stage.removeEventListener(MouseEvent.MOUSE_UP, padre.player.onUnclick);
padre.padre.exitGame(false);
}
public function upgradeButtonOver(e:MouseEvent){
_botonUpgrade.gotoAndStop(2);
}
public function sniperOver(e:MouseEvent){
this.sniperButton.marcoBoton.alpha = 1;
infoWindow.startDrag();
infoWindow.x = (padre.mouseInScreen.X + 5);
infoWindow.y = (padre.mouseInScreen.Y - 5);
infoWindow.gotoAndStop(15);
if (player.weaponEnabled[4] == 0){
infoWindow.unlockable.alpha = 1;
} else {
infoWindow.unlockable.alpha = 0;
};
}
public function lessDamage(e:MouseEvent){
if (damageCount > 0){
damageCount--;
player.setWeapon(player.currentWeapon);
_damagePoints.text = (damageCount + "");
player.points++;
_totalPoints.text = (player.points + "");
upgradeUpgrade(player.points);
};
}
public function hudOver(e:MouseEvent){
overhud = true;
}
public function misilSelected(e:MouseEvent){
if ((((player.money >= Parametros.CostoMisil)) && (padre.isRun))){
this.addChild(selectedObject);
selectedTrap = MISIL;
posicionDiscreta = true;
};
}
public function hudOut(e:MouseEvent){
overhud = false;
}
public function moreRange(e:MouseEvent){
rangeCount++;
player.setWeapon(player.currentWeapon);
_rangePoints.text = (rangeCount + "");
if (player.points > 0){
player.points--;
_totalPoints.text = (player.points + "");
upgradeUpgrade(player.points);
};
}
public function mOver(e:MouseEvent){
this.mButton.marcoBoton.alpha = 1;
infoWindow.startDrag();
infoWindow.x = (padre.mouseInScreen.X + 5);
infoWindow.y = (padre.mouseInScreen.Y - 5);
infoWindow.gotoAndStop(13);
if (player.weaponEnabled[2] == 0){
infoWindow.unlockable.alpha = 1;
} else {
infoWindow.unlockable.alpha = 0;
};
}
public function rocketClick(e:MouseEvent){
if (player.weaponEnabled[5] == 0){
if (player.points >= 6){
player.weaponEnabled[5] = 1;
player.points = (player.points - 6);
_totalPoints.text = (player.points + "");
upgradeUpgrade(player.points);
this.sniperButton.block.alpha = 0;
player.setWeapon(5);
infoWindow.unlockable.alpha = 0;
};
} else {
this.sniperButton.block.alpha = 0;
player.setWeapon(5);
};
refreshHud();
}
public function pauseGame(e:MouseEvent){
if ((((padre.isWin == false)) && (padre.player.updatePlayer))){
if (padre.isRun == false){
padre.intervalo.start();
padre.ingame = true;
padre.newDate = new Date();
padre.lastDate = padre.newDate.time;
padre.difference = 33;
padre.isRun = true;
padre.removeChild(_gamePaused);
_gamePaused = null;
_pauseButton.visible = true;
_pauseButton.alpha = 1;
_pauseButton.enabled = true;
_continueButton.visible = false;
_continueButton.alpha = 0;
_continueButton.visible = false;
} else {
padre.intervalo.stop();
padre.ingame = false;
padre.isRun = false;
_gamePaused = new gamePaused();
_gamePaused.x = (Canvas.APPLICATION_WIDTH / 2);
_gamePaused.y = (Canvas.APPLICATION_HEIGHT / 2);
padre.addChild(_gamePaused);
_pauseButton.visible = false;
_pauseButton.alpha = 0;
_pauseButton.enabled = false;
_continueButton.visible = true;
_continueButton.alpha = 1;
_continueButton.visible = true;
};
};
}
public function lessRange(e:MouseEvent){
if (rangeCount > 0){
rangeCount--;
player.setWeapon(player.currentWeapon);
_rangePoints.text = (rangeCount + "");
player.points++;
_totalPoints.text = (player.points + "");
upgradeUpgrade(player.points);
};
}
public function moreDamage(e:MouseEvent){
damageCount++;
player.setWeapon(player.currentWeapon);
_damagePoints.text = (damageCount + "");
if (player.points > 0){
player.points--;
_totalPoints.text = (player.points + "");
upgradeUpgrade(player.points);
};
}
public function baseOver(e:MouseEvent){
_baseButton.marcoBoton.alpha = 1;
infoWindow.startDrag();
infoWindow.x = (padre.mouseInScreen.X + 5);
infoWindow.y = (padre.mouseInScreen.Y - 5);
infoWindow.gotoAndStop(4);
}
public function healthOut(e:MouseEvent){
_healthBar.gotoAndStop(1);
}
public function pointControledMessage(value:Boolean){
if (value == false){
padre.padre.soundSystem.sonidoMenuB.play(0, 1, padre.padre.soundSystem.volPrincipal);
pointControled = new PointControled();
pointControled.x = (Canvas.APPLICATION_WIDTH / 2);
pointControled.y = 25;
padre.addChild(pointControled);
} else {
padre.padre.soundSystem.bonus.play(0, 1, padre.padre.soundSystem.volPrincipal);
bonusObtained = new BonusObtained();
bonusObtained.x = (Canvas.APPLICATION_WIDTH / 2);
bonusObtained.y = 25;
padre.addChild(bonusObtained);
padre.padre.soundSystem.bonus.play(0, 1, padre.padre.soundSystem.volPrincipal);
};
}
public function soundOn(e:MouseEvent){
padre.padre.soundSystem.volPrincipal.volume = 0;
_soundOn.enabled = false;
_soundOn.visible = false;
_soundOn.alpha = 0;
_soundOff.enabled = true;
_soundOff.visible = true;
_soundOff.alpha = 1;
}
public function rangeOver(e:MouseEvent){
infoWindow.startDrag();
infoWindow.x = (padre.mouseInScreen.X + 5);
infoWindow.y = (padre.mouseInScreen.Y - 5);
infoWindow.gotoAndStop(10);
}
public function mineOver(e:MouseEvent){
_mineButton.marcoBoton.alpha = 1;
infoWindow.startDrag();
infoWindow.gotoAndStop(2);
}
public function dynamiteSelected(e:MouseEvent){
if ((((player.money >= Parametros.CostoDinamita)) && (padre.isRun))){
selectedObject = new DynamiteMC();
this.padre.addChild(selectedObject);
selectedTrap = DYNAMITE_TRAP;
posicionDiscreta = true;
};
}
public function berettaClick(e:MouseEvent){
if (player.weaponEnabled[0] == 0){
if (player.points > 0){
player.weaponEnabled[0] = 1;
_totalPoints.text = (player.points + "");
upgradeUpgrade(player.points);
player.setWeapon(0);
infoWindow.unlockable.alpha = 0;
};
} else {
this.berettaButton.block.alpha = 0;
player.setWeapon(0);
infoWindow.unlockable.alpha = 0;
};
refreshHud();
}
public function berettaOver(e:MouseEvent){
this.berettaButton.marcoBoton.alpha = 1;
infoWindow.startDrag();
infoWindow.x = (padre.mouseInScreen.X + 5);
infoWindow.y = (padre.mouseInScreen.Y - 5);
infoWindow.gotoAndStop(11);
if (player.weaponEnabled[0] == 0){
infoWindow.unlockable.alpha = 1;
} else {
infoWindow.unlockable.alpha = 0;
};
}
public function expOut(e:MouseEvent){
_expBar.gotoAndStop(1);
}
}
}//package
Section 131 (298 B)
//ImpactoEnEnemigo (ImpactoEnEnemigo)
package {
import flash.display.*;
public dynamic class ImpactoEnEnemigo extends MovieClip {
public function ImpactoEnEnemigo(){
super();
addFrameScript(5, frame6);
}
function frame6(){
stop();
parent.removeChild(this);
}
}
}//package
Section 132 (320 B)
//ImpactoEnEnemigo_ (ImpactoEnEnemigo_)
package {
import flash.display.*;
public dynamic class ImpactoEnEnemigo_ extends MovieClip {
public function ImpactoEnEnemigo_(){
super();
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 133 (190 B)
//Indice (Indice)
package {
import flash.display.*;
public dynamic class Indice extends MovieClip {
public var mc:MovieClip;
public function Indice(){
super();
}
}
}//package
Section 134 (182 B)
//InGameIntro (InGameIntro)
package {
import flash.display.*;
public dynamic class InGameIntro extends MovieClip {
public function InGameIntro(){
super();
}
}
}//package
Section 135 (2.15 KiB) ●
//InsertNameWindow (InsertNameWindow)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import flash.ui.*;
public class InsertNameWindow extends MovieClip {
public var insertName:TextField;
public var padre:UICanvas;
public var playerName:TextField;
public var okIt:SimpleButton;
public var okButton:SimpleButton;
public var playerString:String;
public var interval:Timer;
public function InsertNameWindow(pad:UICanvas){
super();
okButton = okIt;
playerName = insertName;
padre = pad;
okButton.addEventListener(MouseEvent.CLICK, okClick);
padre.addEventListener(KeyboardEvent.KEY_DOWN, onEnter);
playerName.text = "Enter your name.";
playerName.selectable = true;
playerName.maxChars = 12;
x = 350;
y = 250;
interval = new Timer((1000 / 24), 0);
}
function fadeOut(event:TimerEvent):void{
alpha = (alpha - 0.1);
if (alpha <= 0){
interval.removeEventListener(TimerEvent.TIMER, fadeOut);
padre.achieveSystem = new AchieveSystem();
padre.achieveSystem.padre = padre;
padre.achieveSystem.initAchievements();
if (padre.local_data.data.playerName == playerString){
} else {
padre.local_data.data.playerName = playerString;
};
padre.gotoAndStop("MainMenu");
padre.removeChild(this);
};
}
public function onEnter(event:KeyboardEvent){
switch (event.keyCode){
case Keyboard.ENTER:
if ((((playerName.text == "")) || ((playerName.text == "Type your name.")))){
playerName.text = "Type your name.";
} else {
padre.openData(playerName.text);
exitWindow();
};
break;
};
}
public function okClick(event:MouseEvent):void{
if ((((playerName.text == "")) || ((playerName.text == "Type your name.")))){
playerName.text = "Type your name.";
} else {
padre.openData(playerName.text);
exitWindow();
};
}
function exitWindow(){
padre.removeEventListener(KeyboardEvent.KEY_DOWN, onEnter);
interval.addEventListener(TimerEvent.TIMER, fadeOut);
interval.start();
playerString = playerName.text;
playerName.text = "";
okButton.enabled = false;
}
}
}//package
Section 136 (174 B)
//IntroSlogan (IntroSlogan)
package {
import flash.text.*;
public dynamic class IntroSlogan extends Font {
public function IntroSlogan(){
super();
}
}
}//package
Section 137 (152 B)
//jumpA (jumpA)
package {
import flash.media.*;
public dynamic class jumpA extends Sound {
public function jumpA(){
super();
}
}
}//package
Section 138 (170 B)
//Kamikaze (Kamikaze)
package {
import flash.display.*;
public dynamic class Kamikaze extends MovieClip {
public function Kamikaze(){
super();
}
}
}//package
Section 139 (10.61 KiB) ● ●
//language (language)
package {
import flash.net.*;
public class language {
public static var localConnection = new LocalConnection();
public static var _languageNum:uint = 0;
public static var _languageBox:Array = new Array();
public static var SpillGroupUrl:Array = new Array();
public static var gamename = "Bunny_Charm";
public function language(){
super();
}
public static function get url2():String{
var i:int;
i = 0;
while (i < SpillGroupUrl.length) {
if (localConnection.domain == SpillGroupUrl[i]){
return (_languageBox[_languageNum].url2);
};
i++;
};
return (_languageBox[_languageNum].url2);
}
public static function get language_nr():String{
return (_languageBox[_languageNum].language_nr);
}
public static function get portal():String{
return (_languageBox[_languageNum].portal);
}
public static function set Language(languageVersion:Object):void{
var returnDomain:Function;
var hostingdomain:String;
var myList:String;
var myArray:Array;
var language1:*;
var language2:*;
var language3:*;
var language4:*;
var language5:*;
var language6:*;
var language7:*;
var language8:*;
var language9:*;
var language10:*;
var language11:*;
var language12:*;
var language13:*;
var language14:*;
var language15:*;
var language16:*;
var language17:*;
var language18:*;
var domainextention:int;
var domainname:int;
var languageVersion = languageVersion;
returnDomain = function (w:String):String{
var domain:String;
var j:uint;
domain = new String();
j = 7;
while (j < w.length) {
if (w.charAt(j) == "/"){
break;
};
domain = (domain + w.charAt(j));
j++;
};
return (domain);
};
hostingdomain = "";
myList = localConnection.domain;
myArray = myList.split(".");
if (myArray.length <= 3){
domainextention = (myArray.length - 1);
domainname = (myArray.length - 2);
hostingdomain = ((myArray[domainname] + ".") + myArray[domainextention]);
} else {
hostingdomain = localConnection.domain;
};
language1 = new languageItem();
language1.url1 = ((("http://www.agame.com/moregames/?utm_medium=brandedgames_external&utm_campaign=" + gamename) + "&utm_source=") + hostingdomain);
language1.url2 = ("http://www.agame.com/moregames/?utm_medium=brandedgames_internal&utm_campaign=" + gamename);
language1.language_nr = 1;
language1.branding_nr = 1;
language1.portal = "tweens";
_languageBox.push(language1);
language2 = new languageItem();
language2.url1 = "http://www.game.com.cn/moregames/";
language2.url2 = "http://www.game.com.cn/moregames/";
language2.language_nr = 2;
language2.branding_nr = 2;
language2.portal = "game_com_cn";
_languageBox.push(language2);
language3 = new languageItem();
language3.url1 = ((("http://www.spel.nl/moregames/?utm_medium=brandedgames_external&utm_campaign=" + gamename) + "&utm_source=") + hostingdomain);
language3.url2 = ("http://www.spel.nl/moregames/?utm_medium=brandedgames_internal&utm_campaign=" + gamename);
language3.language_nr = 3;
language3.branding_nr = 4;
language3.portal = "tweens";
_languageBox.push(language3);
language4 = new languageItem();
language4.url1 = ((("http://www.jeu.fr/moregames/?utm_medium=brandedgames_external&utm_campaign=" + gamename) + "&utm_source=") + hostingdomain);
language4.url2 = ("http://www.jeu.fr/moregames/?utm_medium=brandedgames_internal&utm_campaign=" + gamename);
language4.language_nr = 4;
language4.branding_nr = 5;
language4.portal = "tweens";
_languageBox.push(language4);
language5 = new languageItem();
language5.url1 = ((("http://www.spielen.com/moregames/?utm_medium=brandedgames_external&utm_campaign=" + gamename) + "&utm_source=") + hostingdomain);
language5.url2 = ("http://www.spielen.com/moregames/?utm_medium=brandedgames_internal&utm_campaign=" + gamename);
language5.language_nr = 5;
language5.branding_nr = 6;
language5.portal = "tweens";
_languageBox.push(language5);
language6 = new languageItem();
language6.url1 = ((("http://www.minigry.pl/moregames/?utm_medium=brandedgames_external&utm_campaign=" + gamename) + "&utm_source=") + hostingdomain);
language6.url2 = ("http://www.minigry.pl/moregames/?utm_medium=brandedgames_internal&utm_campaign=" + gamename);
language6.language_nr = 6;
language6.branding_nr = 14;
language6.portal = "tweens";
_languageBox.push(language6);
language7 = new languageItem();
language7.url1 = ((("http://www.spel.eu/moregames/?utm_medium=brandedgames_external&utm_campaign=" + gamename) + "&utm_source=") + hostingdomain);
language7.url2 = ("http://www.spel.eu/moregames/?utm_medium=brandedgames_internal&utm_campaign=" + gamename);
language7.language_nr = 7;
language7.branding_nr = 9;
language7.portal = "tweens";
_languageBox.push(language7);
language8 = new languageItem();
language8.url1 = ((("http://www.giocaregratis.it/moregames/?utm_medium=brandedgames_external&utm_campaign=" + gamename) + "&utm_source=") + hostingdomain);
language8.url2 = ("http://www.giocaregratis.it/moregames/?utm_medium=brandedgames_internal&utm_campaign=" + gamename);
language8.language_nr = 8;
language8.branding_nr = 8;
language8.portal = "tweens";
_languageBox.push(language8);
language9 = new languageItem();
language9.url1 = ((("http://www.zapjuegos.com/moregames/?utm_medium=brandedgames_external&utm_campaign=" + gamename) + "&utm_source=") + hostingdomain);
language9.url2 = ("http://www.zapjuegos.com/moregames/?utm_medium=brandedgames_internal&utm_campaign=" + gamename);
language9.language_nr = 9;
language9.branding_nr = 3;
language9.portal = "tweens";
_languageBox.push(language9);
language10 = new languageItem();
language10.url1 = ((("http://www.clickjogos.com/moregames/?utm_medium=brandedgames_external&utm_campaign=" + gamename) + "&utm_source=") + hostingdomain);
language10.url2 = ("http://www.clickjogos.com/moregames/?utm_medium=brandedgames_internal&utm_campaign=" + gamename);
language10.language_nr = 11;
language10.branding_nr = 7;
language10.portal = "tweens";
_languageBox.push(language10);
language11 = new languageItem();
language11.url1 = ((("http://www.games.co.id/moregames/?utm_medium=brandedgames_external&utm_campaign=" + gamename) + "&utm_source=") + hostingdomain);
language11.url2 = ("http://www.games.co.id/moregames/?utm_medium=brandedgames_internal&utm_campaign=" + gamename);
language11.language_nr = 13;
language11.branding_nr = 13;
language11.portal = "tweens";
_languageBox.push(language11);
language12 = new languageItem();
language12.url1 = ((("http://www.flashgames.ru/moregames/?utm_medium=brandedgames_external&utm_campaign=" + gamename) + "&utm_source=") + hostingdomain);
language12.url2 = ("http://www.flashgames.ru/moregames/?utm_medium=brandedgames_internal&utm_campaign=" + gamename);
language12.language_nr = 12;
language12.branding_nr = 11;
language12.portal = "tweens";
_languageBox.push(language12);
language13 = new languageItem();
language13.url1 = ((("http://www.mygames.co.uk/moregames/?utm_medium=brandedgames_external&utm_campaign=" + gamename) + "&utm_source=") + hostingdomain);
language13.url2 = ("http://www.mygames.co.uk/moregames/?utm_medium=brandedgames_internal&utm_campaign=" + gamename);
language13.language_nr = 16;
language13.branding_nr = 10;
language13.portal = "tweens";
_languageBox.push(language13);
language14 = new languageItem();
language14.url1 = ((("http://www.game.co.in/moregames/?utm_medium=brandedgames_external&utm_campaign=" + gamename) + "&utm_source=") + hostingdomain);
language14.url2 = ("http://www.game.co.in/moregames/?utm_medium=brandedgames_internal&utm_campaign=" + gamename);
language14.language_nr = 16;
language14.branding_nr = 12;
language14.portal = "tweens";
_languageBox.push(language14);
language15 = new languageItem();
language15.url1 = ((("http://www.asoyun.com/moregames/?utm_medium=brandedgames_external&utm_campaign=" + gamename) + "&utm_source=") + hostingdomain);
language15.url2 = ("http://www.asoyun.com/moregames/?utm_medium=brandedgames_internal&utm_campaign=" + gamename);
language15.language_nr = 14;
language15.branding_nr = 15;
language15.portal = "tweens";
_languageBox.push(language15);
language16 = new languageItem();
language16.url1 = ((("http://www.game.com.my/moregames/?utm_medium=brandedgames_external&utm_campaign=" + gamename) + "&utm_source=") + hostingdomain);
language16.url2 = ("http://www.game.com.my/moregames/?utm_medium=brandedgames_internal&utm_campaign=" + gamename);
language16.language_nr = 15;
language16.branding_nr = 16;
language16.portal = "tweens";
_languageBox.push(language16);
language17 = new languageItem();
language17.url1 = ((("http://www.ojogos.pt/moregames/?utm_medium=brandedgames_external&utm_campaign=" + gamename) + "&utm_source=") + hostingdomain);
language17.url2 = ("http://www.ojogos.pt/moregames/?utm_medium=brandedgames_internal&utm_campaign=" + gamename);
language17.language_nr = 10;
language17.branding_nr = 42;
language17.portal = "family";
_languageBox.push(language17);
language18 = new languageItem();
language18.url1 = ((("http://www.egames.jp/moregames/?utm_medium=brandedgames_external&utm_campaign=" + gamename) + "&utm_source=") + hostingdomain);
language18.url2 = ("http://www.egames.jp/moregames/?utm_medium=brandedgames_internal&utm_campaign=" + gamename);
language18.language_nr = 17;
language18.branding_nr = 44;
language18.portal = "tweens";
_languageBox.push(language18);
SpillGroupUrl.push("localhost");
SpillGroupUrl.push("www8.agame.com");
if ((((((languageVersion is Number)) || ((languageVersion is uint)))) || ((languageVersion is int)))){
_languageNum = (Number(languageVersion) - 1);
};
}
public static function get url1():String{
var i:int;
i = 0;
while (i < SpillGroupUrl.length) {
if (localConnection.domain == SpillGroupUrl[i]){
return (_languageBox[_languageNum].url2);
};
i++;
};
return (_languageBox[_languageNum].url1);
}
public static function get branding_nr():String{
return (_languageBox[_languageNum].branding_nr);
}
}
}//package
class languageItem {
public var url1:String;
public var url2:String;
public var branding_nr:int;
public var language_nr:int;
public var portal:String;
private function languageItem(){
super();
}
}
Section 140 (166 B)
//LevelUp (LevelUp)
package {
import flash.display.*;
public dynamic class LevelUp extends MovieClip {
public function LevelUp(){
super();
}
}
}//package
Section 141 (707 B)
//ListaEnlazada (ListaEnlazada)
package {
public class ListaEnlazada {
public var primerObjeto:ObjetoListaEnlazada;
public var counter:int;
public function ListaEnlazada(){
super();
primerObjeto = null;
counter = 0;
}
public function agregarObjeto(obj:ObjetoListaEnlazada){
obj.sgte = primerObjeto;
if (primerObjeto != null){
primerObjeto.prev = obj;
};
obj.prev = null;
primerObjeto = obj;
counter++;
}
public function removerObjeto(obj:ObjetoListaEnlazada){
if (obj.sgte != null){
obj.sgte.prev = obj.prev;
};
if (obj.prev != null){
obj.prev.sgte = obj.sgte;
} else {
primerObjeto = obj.sgte;
};
counter--;
}
}
}//package
Section 142 (178 B)
//LosingBase (LosingBase)
package {
import flash.display.*;
public dynamic class LosingBase extends MovieClip {
public function LosingBase(){
super();
}
}
}//package
Section 143 (7.06 KiB) ● ●
//MainMenu (MainMenu)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import flash.net.*;
import flash.ui.*;
public class MainMenu extends MovieClip {
public var pmgButton:SimpleButton;
public var padre:UICanvas;
public var pScore:TextField;
public var pName:TextField;
public var achievements:SimpleButton;
public var pLevel:TextField;
public var oSelected:Number;// = 0
public var infoPlayer:MovieClip;
public var difSelected:Number;// = 0
public var highscores:SimpleButton;
public var htpButton:SimpleButton;
public var achButton:SimpleButton;
public var specialButton:SimpleButton;
public var gamagaLink:SimpleButton;
public var scoreButton:SimpleButton;
public var difficultyWindow:DifficultyWindow;
public var newGame:SimpleButton;
public var interval:Timer;
public var howToPlay:SimpleButton;
public var newButton:SimpleButton;
public function MainMenu(padre:UICanvas){
oSelected = 0;
difSelected = 0;
super();
addFrameScript(0, frame1, 14, frame15);
this.padre = padre;
alpha = 0;
padre.addEventListener(KeyboardEvent.KEY_DOWN, onEnter);
interval = new Timer((1000 / 24), 0);
newButton = newGame;
htpButton = howToPlay;
achButton = achievements;
scoreButton = highscores;
newButton.enabled = false;
htpButton.enabled = false;
achButton.enabled = false;
scoreButton.enabled = false;
newButton.addEventListener(MouseEvent.CLICK, newClick);
newButton.addEventListener(MouseEvent.ROLL_OVER, newOver);
newButton.addEventListener(MouseEvent.ROLL_OUT, newOut);
htpButton.addEventListener(MouseEvent.CLICK, htpClick);
htpButton.addEventListener(MouseEvent.ROLL_OVER, htpOver);
htpButton.addEventListener(MouseEvent.ROLL_OUT, htpOut);
achButton.addEventListener(MouseEvent.CLICK, achClick);
achButton.addEventListener(MouseEvent.ROLL_OVER, achOver);
achButton.addEventListener(MouseEvent.ROLL_OUT, achOut);
scoreButton.addEventListener(MouseEvent.CLICK, scoreClick);
scoreButton.addEventListener(MouseEvent.ROLL_OVER, scoreOver);
scoreButton.addEventListener(MouseEvent.ROLL_OUT, scoreOut);
pName = this.infoPlayer.playerName;
pLevel = this.infoPlayer.playerLevel;
pScore = this.infoPlayer.playerScore;
pName.text = (padre.local_data.data.playerName + "");
pLevel.text = (padre.local_data.data.achieveLevel + "");
pScore.text = (padre.local_data.data.achieveScore + "");
pName.selectable = false;
pLevel.selectable = false;
pScore.selectable = false;
this.gamagaLink.addEventListener(MouseEvent.CLICK, openGamaga);
enterWindow();
}
public function achOut(event:MouseEvent):void{
}
public function htpOver(event:MouseEvent):void{
}
public function htpClick(event:MouseEvent):void{
oSelected = 3;
exitWindow();
}
function frame15(){
stop();
padre.soundSystem.gunB.play();
}
public function scoreClick(event:MouseEvent):void{
oSelected = 6;
exitWindow();
}
function fadeOut(event:TimerEvent):void{
switch (oSelected){
case 1:
interval.removeEventListener(TimerEvent.TIMER, fadeOut);
addDifficultyWindow();
difficultyWindow.gotoAndStop("dificultad");
difficultyWindow.newGame = true;
oSelected = -1;
break;
case 3:
alpha = (alpha - 0.1);
if (alpha <= 0){
interval.removeEventListener(TimerEvent.TIMER, fadeOut);
padre.addHowToPlay();
oSelected = -1;
padre.removeChild(this);
};
break;
case 4:
alpha = (alpha - 0.1);
if (alpha <= 0){
interval.removeEventListener(TimerEvent.TIMER, fadeOut);
padre.addAchieveWindow();
oSelected = -1;
padre.removeChild(this);
};
break;
case 5:
alpha = (alpha - 0.1);
if (alpha <= 0){
interval.removeEventListener(TimerEvent.TIMER, fadeOut);
padre.addSpecialContent();
oSelected = -1;
padre.removeChild(this);
};
break;
case 6:
interval.removeEventListener(TimerEvent.TIMER, fadeOut);
addDifficultyWindow();
difficultyWindow.gotoAndStop("opcion");
difficultyWindow.newGame = false;
oSelected = -1;
break;
case 61:
alpha = (alpha - 0.1);
if (alpha <= 0){
interval.removeEventListener(TimerEvent.TIMER, fadeOut);
padre.scoreSystem.showScores(difSelected);
oSelected = -1;
padre.removeChild(this);
};
break;
case 62:
alpha = (alpha - 0.1);
if (alpha <= 0){
interval.removeEventListener(TimerEvent.TIMER, fadeOut);
padre.newGame(difSelected);
oSelected = -1;
padre.removeChild(this);
};
break;
};
}
public function pmgOut(event:MouseEvent):void{
}
public function pmgOver(event:MouseEvent):void{
}
public function addDifficultyWindow(){
padre.removeEventListener(KeyboardEvent.KEY_DOWN, onEnter);
difficultyWindow = new DifficultyWindow();
addChild(difficultyWindow);
difficultyWindow.x = 275;
difficultyWindow.y = 200;
difficultyWindow.padre = this;
difficultyWindow.initDif();
difficultyWindow.enterWindow();
}
public function specialOver(event:MouseEvent):void{
}
public function specialClick(event:MouseEvent):void{
oSelected = 5;
exitWindow();
}
function frame1(){
padre.soundSystem.mainMenuIntro.play();
}
public function loadOut(event:MouseEvent):void{
}
public function newOut(event:MouseEvent):void{
}
public function achOver(event:MouseEvent):void{
}
public function scoreOver(event:MouseEvent):void{
}
public function achClick(event:MouseEvent):void{
oSelected = 4;
exitWindow();
}
public function newOver(event:MouseEvent):void{
}
public function pmgClick(event:MouseEvent):void{
var request:URLRequest;
request = new URLRequest("http://www.cuaticgames.com/");
navigateToURL(request, "_blank");
}
function exitWindow(){
newButton.enabled = false;
htpButton.enabled = false;
achButton.enabled = false;
scoreButton.enabled = false;
interval.addEventListener(TimerEvent.TIMER, fadeOut);
}
public function onEnter(event:KeyboardEvent){
switch (event.keyCode){
case Keyboard.ENTER:
oSelected = 1;
exitWindow();
break;
};
}
function fadeIn(event:TimerEvent):void{
alpha = (alpha + 0.1);
if (alpha >= 1){
newButton.enabled = true;
htpButton.enabled = true;
achButton.enabled = true;
scoreButton.enabled = true;
interval.removeEventListener(TimerEvent.TIMER, fadeIn);
};
}
public function htpOut(event:MouseEvent):void{
}
public function specialOut(event:MouseEvent):void{
}
public function newClick(event:MouseEvent):void{
oSelected = 1;
exitWindow();
}
public function loadOver(event:MouseEvent):void{
}
public function openGamaga(e:MouseEvent){
var request:*;
request = new URLRequest("http://www.gamersmakinggames.com");
navigateToURL(request, "_blank");
}
public function scoreOut(event:MouseEvent):void{
}
function enterWindow(){
interval.addEventListener(TimerEvent.TIMER, fadeIn);
interval.start();
}
public function loadClick(event:MouseEvent):void{
}
}
}//package
Section 144 (192 B)
//MainMenuShotGun (MainMenuShotGun)
package {
import flash.media.*;
public dynamic class MainMenuShotGun extends Sound {
public function MainMenuShotGun(){
super();
}
}
}//package
Section 145 (198 B)
//MapaChallengeMC (MapaChallengeMC)
package {
import flash.display.*;
public dynamic class MapaChallengeMC extends MovieClip {
public function MapaChallengeMC(){
super();
}
}
}//package
Section 146 (170 B)
//MapaHard (MapaHard)
package {
import flash.display.*;
public dynamic class MapaHard extends MovieClip {
public function MapaHard(){
super();
}
}
}//package
Section 147 (178 B)
//MapaNormal (MapaNormal)
package {
import flash.display.*;
public dynamic class MapaNormal extends MovieClip {
public function MapaNormal(){
super();
}
}
}//package
Section 148 (182 B)
//MapaSandBox (MapaSandBox)
package {
import flash.display.*;
public dynamic class MapaSandBox extends MovieClip {
public function MapaSandBox(){
super();
}
}
}//package
Section 149 (154 B)
//Menu (Menu)
package {
import flash.display.*;
public dynamic class Menu extends MovieClip {
public function Menu(){
super();
}
}
}//package
Section 150 (1.06 KiB) ●
//Mina (Mina)
package {
import flash.display.*;
public class Mina extends ObjetoListaEnlazada {
public var movieClip:MovieClip;
public var i:int;
public var isDinamita:Boolean;// = false
public var j:int;
public var posicion:Vector2D;
public function Mina(_i:int, _j:int, map:MovieClip, level:CanvasScenario, tipo:int, muviClip:MovieClip){
isDinamita = false;
super();
i = _i;
j = _j;
movieClip = muviClip;
posicion = new Vector2D();
posicion.X = ((j + 0.5) * Parametros.TamanyoTile);
posicion.Y = ((i + 0.5) * Parametros.TamanyoTile);
movieClip.x = posicion.X;
movieClip.y = posicion.Y;
level.padre.layerTraps.addChild(movieClip);
switch (tipo){
case HudMenu.MINE_TRAP:
level.player.money = (level.player.money - Parametros.CostoMina);
break;
case HudMenu.TOXIC_MINE_TRAP:
level.player.money = (level.player.money - Parametros.CostoMinaToxica);
break;
case HudMenu.FREEZE_MINE_TRAP:
level.player.money = (level.player.money - Parametros.CostoMinaCongelar);
break;
};
}
}
}//package
Section 151 (162 B)
//MineMC (MineMC)
package {
import flash.display.*;
public dynamic class MineMC extends MovieClip {
public function MineMC(){
super();
}
}
}//package
Section 152 (176 B)
//mineTrigger (mineTrigger)
package {
import flash.media.*;
public dynamic class mineTrigger extends Sound {
public function mineTrigger(){
super();
}
}
}//package
Section 153 (1.17 KiB) ●
//MochiBot (MochiBot)
package {
import flash.display.*;
import flash.system.*;
import flash.net.*;
public dynamic class MochiBot extends Sprite {
public function MochiBot(){
super();
}
public static function track(parent:Sprite, tag:String):MochiBot{
var self:MochiBot;
var server:String;
var lv:URLVariables;
var url:String;
var req:URLRequest;
var loader:Loader;
if (Security.sandboxType == "localWithFile"){
return (null);
};
self = new (MochiBot);
parent.addChild(self);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
server = "http://core.mochibot.com/my/core.swf";
lv = new URLVariables();
lv["sb"] = Security.sandboxType;
lv["v"] = Capabilities.version;
lv["swfid"] = tag;
lv["mv"] = "8";
lv["fv"] = "9";
url = self.root.loaderInfo.loaderURL;
if (url.indexOf("http") == 0){
lv["url"] = url;
} else {
lv["url"] = "local";
};
req = new URLRequest(server);
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader = new Loader();
self.addChild(loader);
loader.load(req);
return (self);
}
}
}//package
Section 154 (285 B)
//muerteBalaMC (muerteBalaMC)
package {
import flash.display.*;
public dynamic class muerteBalaMC extends MovieClip {
public function muerteBalaMC(){
super();
addFrameScript(14, frame15);
}
function frame15(){
stop();
parent.removeChild(this);
}
}
}//package
Section 155 (285 B)
//muerteDedoMC (muerteDedoMC)
package {
import flash.display.*;
public dynamic class muerteDedoMC extends MovieClip {
public function muerteDedoMC(){
super();
addFrameScript(44, frame45);
}
function frame45(){
parent.removeChild(this);
stop();
}
}
}//package
Section 156 (200 B)
//MuerteNaturalBala (MuerteNaturalBala)
package {
import flash.media.*;
public dynamic class MuerteNaturalBala extends Sound {
public function MuerteNaturalBala(){
super();
}
}
}//package
Section 157 (14.97 KiB) ● ●
//NewgroundsAPI (NewgroundsAPI)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.net.*;
public class NewgroundsAPI {
public static const ADS_APPROVED:Number = 3;
public static const bridge:Sprite = new Sprite();
private static const STAT_NEW_VERSION:Number = 4;
private static const STAT_AUTHOR_SITE:Number = 2;
private static const GATEWAY_URL:String = "http://www.ngads.com/gateway.php";
private static const NEWGROUNDS_URL:String = "http://www.newgrounds.com";
private static const STAT_CUSTOM_STATS:Number = 50;
private static const STAT_MOVIE_VIEWS:Number = 1;
private static const STAT_NEWGROUNDS:Number = 3;
public static const NEW_VERSION:Number = 2;
public static const DENY_HOST:Number = 1;
private static var tracker_id:Number;
private static var movie_options:Object = new Object();
private static var connected:Boolean;
private static var custom_events:Object = new Object();
private static var host:String;
private static var linked:Boolean;
private static var events:Object = new Object();
private static var debug:Boolean;
private static var version:String;
private static var custom_links:Object = new Object();
public function NewgroundsAPI(){
super();
}
public static function getNewVersionURL(){
return (((((((GATEWAY_URL + "?&id=") + tracker_id) + "&host=") + escape(host)) + "&stat=") + STAT_NEW_VERSION));
}
private static function ReadGatewayData(params:Object){
var i:*;
var _url:String;
var target_url:*;
var gateway_loader:URLLoader;
for (i in params) {
params[i] = unescape(params[i]);
movie_options[i] = params[i];
};
if (params["settings_loaded"]){
SendMessage("You have successfully connected to the Newgrounds API gateway!");
SendMessage((("Movie Identified as '" + movie_options["movie_name"]) + "'"));
if (movie_options["message"]){
SendMessage(movie_options["message"]);
};
if (movie_options["ad_url"]){
SendMessage("Your movie has been approved to run Flash Ads");
if (events[ADS_APPROVED]){
var _local6 = events;
_local6[ADS_APPROVED](movie_options["ad_url"]);
} else {
onAdsApproved(movie_options["ad_url"]);
};
};
if (((movie_options["movie_version"]) && (!((String(movie_options["movie_version"]) == String(version)))))){
SendMessage("WARNING: The movie version configured in your API settings does not match this movie's version!");
if (events[NEW_VERSION]){
_local6 = events;
_local6[NEW_VERSION]({version:movie_options["movie_version"], real_url:getMovieURL(), redirect_url:getNewVersionURL()});
} else {
onNewVersionAvailable(movie_options["movie_version"], getMovieURL(), getNewVersionURL());
};
};
if (movie_options["deny_host"]){
SendMessage("You have blocked 'localHost' in your API settings.");
SendMessage("If you wish to test your movie you will need to remove this block.");
if (events[DENY_HOST]){
_local6 = events;
_local6[DENY_HOST]({host:host, real_url:getMovieURL(), redirect_url:getNewVersionURL()});
} else {
onDenyHost(host, getMovieURL(), getNewVersionURL());
};
};
if (movie_options["request_portal_url"]){
_url = bridge.root.loaderInfo.url;
target_url = ((((GATEWAY_URL + "?&id=") + tracker_id) + "&portal_url=") + escape(_url));
gateway_loader = new URLLoader(new URLRequest(target_url));
};
if (events[69]){
_local6 = events;
_local6[69]();
};
} else {
if (!movie_options["settings_loaded"]){
SendError("Could not establish connection to the API gateway.");
};
};
}
public static function setMovieVersion(movie_version){
if (!movie_version){
SendError("Missing required 'version' in NewgroundsAPI.setMovieVersion(version:String)");
} else {
version = String(movie_version);
};
}
public static function loadCustomLink(link_name:String){
if (!link_name){
SendError("Missing required 'link_name' parameter in NewgroundsAPI.loadCustomLink(link_name:String)");
} else {
if (!custom_links[link_name]){
SendError(("Attempted to open undefined custom link: " + link_name));
} else {
SendLink(custom_links[link_name]);
};
};
}
public static function addCustomLink(stat_id:Number, stat_name:String){
if (!stat_id){
SendError("Missing required 'id' parameter in NewgroundsAPI.AddCustomLink(id:Number, link_name:String)");
} else {
if (!stat_name){
SendError("Missing required 'link_name' parameter in NewgroundsAPI.AddCustomLink(id:Number, link_name:String)");
} else {
custom_links[stat_name] = (STAT_CUSTOM_STATS + stat_id);
SendMessage(((("Created custom link " + stat_id) + ": ") + stat_name));
};
};
}
public static function getMovieURL(){
if (movie_options["movie_url"]){
return (movie_options["movie_url"]);
};
return ("Newgrounds.com");
}
public static function debugMode(){
debug = true;
}
public static function getAdURL(){
return (movie_options["ad_url"]);
}
private static function SendStat(stat_id:Number, open_in_browser:Boolean, extra=null){
var target_url:*;
var XML_Loaded:Function;
var x:*;
var request:URLRequest;
var gateway_loader:URLLoader;
var stat_id = stat_id;
var open_in_browser = open_in_browser;
var extra = extra;
if (!tracker_id){
SendError("You must call NewgroundsAPI.connectMovie() with a valid movie id before using API features!");
} else {
XML_Loaded = function (event:Event){
var XML_in:XML;
var ngparams:Object;
var XML_children:XMLList;
var XML_child:XML;
var param_name:*;
var param_value:*;
XML.ignoreWhitespace = true;
XML_in = XML(event.target.data);
ngparams = new Object();
XML_children = XML_in.children();
for each (XML_child in XML_children) {
param_name = XML_child.localName();
param_value = XML_child.attribute("value");
if (param_value == Number(param_value)){
param_value = Number(param_value);
};
ngparams[param_name] = param_value;
};
ReadGatewayData(ngparams);
};
target_url = (((((((GATEWAY_URL + "?&id=") + tracker_id) + "&host=") + escape(host)) + "&stat=") + stat_id) + addSeed());
if (extra){
for (x in extra) {
target_url = (target_url + ((("&" + escape(x)) + "=") + escape(extra[x])));
};
};
if (debug){
target_url = (target_url + "&debug=1");
};
if (open_in_browser){
request = new URLRequest((target_url + addSeed()));
navigateToURL(request, "_blank");
} else {
gateway_loader = new URLLoader(new URLRequest((target_url + addSeed())));
gateway_loader.addEventListener(Event.COMPLETE, XML_Loaded);
};
};
}
public static function onAdsApproved(ad_url:String){
}
public static function loadMySite(event:Event=null){
SendLink(STAT_AUTHOR_SITE);
}
private static function SendMessage(msg:String){
trace(("[NEWGROUNDS API] :: " + msg));
}
public static function linkAPI(movie){
movie.addChild(bridge);
linked = true;
}
public static function loadNewgrounds(event:Event=null, page:String=null){
var request:URLRequest;
var extra:*;
if (!tracker_id){
request = new URLRequest(((NEWGROUNDS_URL + "/") + page));
navigateToURL(request, "_blank");
} else {
extra = null;
if (page){
extra = new Object();
extra.page = page;
};
SendLink(STAT_NEWGROUNDS, extra);
};
}
private static function SendLink(id, extra=null){
SendStat(id, true, extra);
}
public static function logCustomEvent(event_name:String){
if (!event_name){
SendError("Missing required 'event_name' parameter in NewgroundsAPI.logCustomEvent(event_name:String)");
} else {
if (!custom_events[event_name]){
SendError(("Attempted to log undefined custom event: " + event_name));
} else {
SendEvent(custom_events[event_name]);
};
};
}
private static function SendError(msg:String){
trace(("[NEWGROUNDS API ERROR] :: " + msg));
}
public static function addCustomEvent(stat_id:Number, stat_name:String){
if (!stat_id){
SendError("Missing required 'id' parameter in NewgroundsAPI.AddCustomEvent(id:Number, event_name:String)");
} else {
if (!stat_name){
SendError("Missing required 'event_name' parameter in NewgroundsAPI.AddCustomEvent(id:Number, event_name:String)");
} else {
custom_events[stat_name] = (STAT_CUSTOM_STATS + stat_id);
SendMessage(("Created custom event: " + stat_name));
};
};
}
private static function addSeed(){
return (("&seed=" + Math.random()));
}
public static function addEventListener(event:Number, callback:Function){
events[event] = callback;
}
private static function SendEvent(id){
SendStat(id, false);
}
public static function onNewVersionAvailable(version:String, movie_url:String, redirect_url:String){
var sw:*;
var sh:*;
var tw:*;
var th:*;
var mg:*;
var _root:*;
var overlay:MovieClip;
var overlay_x:*;
var overlay_y:*;
var close_x:*;
var blankarea:TextField;
var header:TextField;
var header_format:TextFormat;
var msgtext:TextField;
var msgtext_format:TextFormat;
var msgtext_link:TextFormat;
var version = version;
var movie_url = movie_url;
var redirect_url = redirect_url;
sw = bridge.stage.stageWidth;
sh = bridge.stage.stageHeight;
tw = 350;
th = 160;
mg = 20;
_root = bridge.root;
overlay = new MovieClip();
overlay.graphics.beginFill(0, 0.6);
overlay.graphics.lineStyle(0, 0);
overlay.graphics.drawRect(0, 0, sw, sh);
overlay.graphics.endFill();
overlay_x = Math.round(((sw - tw) / 2));
overlay_y = Math.round(((sh - th) / 2));
overlay.graphics.beginFill(102);
overlay.graphics.lineStyle(10, 0);
overlay.graphics.drawRect((overlay_x - mg), (overlay_y - mg), (tw + mg), (th + mg));
overlay.graphics.endFill();
overlay.close = function (event:Event){
_root.removeChild(overlay);
};
close_x = new MovieClip();
close_x.graphics.beginFill(0, 0.1);
close_x.graphics.lineStyle(3, 22015);
close_x.graphics.drawRect(0, 0, 16, 16);
close_x.graphics.endFill();
close_x.graphics.moveTo(4, 4);
close_x.graphics.lineTo(13, 13);
close_x.graphics.moveTo(13, 4);
close_x.graphics.lineTo(4, 13);
close_x.x = ((overlay_x + tw) - 26);
close_x.y = (overlay_y - 10);
close_x.addEventListener(MouseEvent.CLICK, overlay.close);
blankarea = new TextField();
blankarea.x = (overlay_x - mg);
blankarea.y = (overlay_y - mg);
blankarea.width = (tw + mg);
blankarea.height = (th + mg);
blankarea.selectable = false;
header = new TextField();
header.width = tw;
header.x = overlay_x;
header.y = overlay_y;
header.height = 100;
header.selectable = false;
header_format = new TextFormat();
header_format.font = "Arial Black";
header_format.color = 0xFFFFFF;
header_format.size = 20;
header.defaultTextFormat = header_format;
header.text = "New Version Available!";
msgtext = new TextField();
msgtext.x = overlay_x;
msgtext.y = (overlay_y + 70);
msgtext.width = tw;
msgtext.height = 60;
msgtext.selectable = false;
msgtext_format = new TextFormat();
msgtext_format.font = "Arial";
msgtext_format.color = 0xFFFFFF;
msgtext_format.size = 12;
msgtext_format.bold = true;
msgtext_link = new TextFormat();
msgtext_link.font = "Arial";
msgtext_link.color = 0xFFFF00;
msgtext_link.size = 12;
msgtext_link.bold = true;
msgtext_link.url = redirect_url;
msgtext_link.target = "_blank";
if (version){
version = ("Version " + version);
} else {
version = "A new version";
};
msgtext.defaultTextFormat = msgtext_format;
msgtext.appendText((version + " is now available"));
if (movie_url){
msgtext.appendText(" at:\n");
msgtext.defaultTextFormat = msgtext_link;
msgtext.appendText(movie_url);
} else {
msgtext.appendText("!");
};
_root.addChild(overlay);
overlay.addChild(blankarea);
overlay.addChild(header);
overlay.addChild(msgtext);
overlay.addChild(close_x);
}
public static function onDenyHost(hostname:String, movie_url:String, redirect_url:String){
var sw:*;
var sh:*;
var tw:*;
var th:*;
var _root:*;
var overlay:MovieClip;
var blankarea:TextField;
var header:TextField;
var header_format:TextFormat;
var msgtext:TextField;
var msgtext_format:TextFormat;
var msgtext_link:TextFormat;
sw = bridge.stage.stageWidth;
sh = bridge.stage.stageHeight;
tw = 350;
th = 160;
_root = bridge.root;
overlay = new MovieClip();
overlay.graphics.beginFill(0x660000);
overlay.graphics.lineStyle(20, 0);
overlay.graphics.drawRect(0, 0, sw, sh);
overlay.graphics.endFill();
blankarea = new TextField();
blankarea.x = 0;
blankarea.y = 0;
blankarea.width = sw;
blankarea.height = sh;
blankarea.selectable = false;
header = new TextField();
header.x = Math.round(((sw - tw) / 2));
header.y = Math.round(((sh - th) / 2.5));
header.width = tw;
header.height = 100;
header.selectable = false;
header_format = new TextFormat();
header_format.font = "Arial Black";
header_format.color = 0xFF0000;
header_format.size = 38;
header.defaultTextFormat = header_format;
header.text = "ERROR!";
msgtext = new TextField();
msgtext.x = Math.round(((sw - tw) / 2));
msgtext.y = (Math.round(((sh - th) / 2.5)) + 80);
msgtext.width = tw;
msgtext.height = 80;
msgtext.selectable = false;
msgtext_format = new TextFormat();
msgtext_format.font = "Arial";
msgtext_format.color = 0xFFFFFF;
msgtext_format.size = 12;
msgtext_format.bold = true;
msgtext_link = new TextFormat();
msgtext_link.font = "Arial";
msgtext_link.color = 0xFFFF00;
msgtext_link.size = 12;
msgtext_link.bold = true;
msgtext_link.url = redirect_url;
msgtext_link.target = "_blank";
msgtext.defaultTextFormat = msgtext_format;
msgtext.appendText((("This movie has not been approved for use on " + hostname) + "\n"));
msgtext.appendText("For an approved copy, please visit:\n");
msgtext.defaultTextFormat = msgtext_link;
msgtext.appendText(movie_url);
_root.addChild(overlay);
overlay.addChild(blankarea);
overlay.addChild(header);
overlay.addChild(msgtext);
}
public static function connectMovie(id:Number){
var _url:String;
var params:*;
if (!id){
SendError("Missing required 'id' parameter in NewgroundsAPI.connectMovie(id:Number)");
} else {
if (!linked){
SendError("Attempted to call MewgroundsAPI.connectMovie() without first calling NewgroundsAPI.linkAPI(this)");
} else {
if (!tracker_id){
SendMessage("Connecting to API gateway...");
tracker_id = id;
_url = bridge.root.loaderInfo.url;
host = _url.split("/")[2].toLowerCase();
if (host.length < 1){
host = "localhost";
};
params = new Object();
SendEvent(STAT_MOVIE_VIEWS);
};
};
};
}
public static function isInstalled(){
return (true);
}
}
}//package
Section 158 (162 B)
//NewMap (NewMap)
package {
import flash.display.*;
public dynamic class NewMap extends MovieClip {
public function NewMap(){
super();
}
}
}//package
Section 159 (532 B)
//newWaveBar (newWaveBar)
package {
import flash.display.*;
import flash.text.*;
public dynamic class newWaveBar extends MovieClip {
public var wave:TextField;
public function newWaveBar(){
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6);
}
function frame3(){
stop();
}
function frame6(){
stop();
}
function frame1(){
stop();
}
function frame4(){
stop();
}
function frame5(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 160 (242 B)
//ObjetoListaEnlazada (ObjetoListaEnlazada)
package {
public class ObjetoListaEnlazada {
public var prev:ObjetoListaEnlazada;
public var sgte:ObjetoListaEnlazada;
public function ObjetoListaEnlazada(){
super();
}
}
}//package
Section 161 (162 B)
//OldMap (OldMap)
package {
import flash.display.*;
public dynamic class OldMap extends MovieClip {
public function OldMap(){
super();
}
}
}//package
Section 162 (2.92 KiB) ●
//Parametros (Parametros)
package {
public class Parametros {
public static const TimeBeetweenWaves:int = 30000;
public static const CostoBase:int = 50;
public static const CongeladoUpdates:int = 200;
public static const DanyoDisparo:int = 2;
public static const DanyoMina:int = 15;
public static const EnergiaEnemigoRojo:int = 2;
public static const VelocidadEnemigoRojo:Number = 1;
public static const yInicialPlayer:int = 116;
public static const EnergiaCadaverEnemigoCafe:int = 3;
public static const SlideFactor:Number = 0.1;
public static const CostoDinamita:int = 10;
public static const CostoTorreta:int = 20;
public static const CostoBox:int = 5;
public static const EnergiaEnemigoVerde:int = 1;
public static const DistanciaMaximaPosicionamientoBase:int = 50;
public static const DineroInicialPlayer:int = 0;
public static const DanyoDinamita:int = 25;
public static const CostoAlMorirSoldado:int = 1;
public static const CostoMinaCongelar:int = 10;
public static const CostoAlMorirRobot:int = 5;
public static const CostoAlMorirWorm:int = 5;
public static const BaseMachineGunReload:int = 40;
public static const ParametrosPlayerPorNivel:Array = [3, 2, 0.8, 3, 150];
public static const VelocidadEnemigoCafe:Number = 0.5;
public static const CostoMina:int = 5;
public static const MachineGunReload:int = 3;
public static const VelocidadEnemigoVerde:Number = 1.5;
public static const EnergiaEnemigoCafe:int = 3;
public static const TiempoEntreDominationCheckPoint:int = 5000;
public static const DominationMoneyPorBase:int = 1;
public static const CostoAlMorirRunner:int = 1;
public static const xInicialPlayer:int = 116;
public static const RadioDisparoBase:int = 50;
public static const DanyoDisparoBase:int = 10;
public static const DanyoToxicMinePorUpdate:Number = 0.05;
public static const FirstWave:int = 5000;
public static const CostoAlMorirIndice:int = 1;
public static const CostoLevelUp:int = 60;
public static const CostoMisil:int = 30;
public static const VelocidadPlayer:Number = 10;
public static const TamanyoTile:int = 32;
public static const CostoAlMorirSargento:int = 1;
public static const EnergiaInicialBase:int = 20;
public static const CostoAlMorirKamikaze:int = 1;
public static const TiempoExplosionDinamita:int = 1000;
public static const EnergiaCadaverEnemigoVerde:int = 1;
public static const UpgradePropiedadesJugador:Array = [1, 0.25, 0.1, 0.75, 10];
public static const EnergiaCadaverEnemigoRojo:int = 2;
public static const CostoBarril:int = 5;
public static const CostoAlMorirPulgar:int = 1;
public static const EnergiaInicialPlayer:int = 10;
public static const TamanyoTileMedios:int = 16;
public static const SlideUpdates:int = 6;
public static const CostoMinaToxica:int = 15;
public static const RadioDinamita:int = 40;
public static var MaximaCantidadDeBases:int = 3;
public function Parametros(){
super();
}
}
}//package
Section 163 (178 B)
//PartExploA (PartExploA)
package {
import flash.display.*;
public dynamic class PartExploA extends MovieClip {
public function PartExploA(){
super();
}
}
}//package
Section 164 (18.9 KiB) ● ● ●
//Player (Player)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
public class Player {
public var nivel:int;
public var updatePlayer:Boolean;
private var currentAnimation:int;
public var danyoDisparo:Number;
private var newAnimationDirection:int;
private var currentRotation:Number;
var actualTic:Number;// = 3000
public var pushBack:Number;// = 0
public var maxNiveles:int;
public var velocidad:Number;
public var conqueringTimeRemaining:int;// = 1000
public var isMovingLeft:Boolean;// = false
private var machineGunCounter:int;
public var rayMC:MovieClip;
var weaponDef:Array;
private var clickDown:Boolean;
public var energyCounter:TextField;
public var currentTileI:int;
public var currentTileJ:int;
public var thisWin:Boolean;
public var domination:int;
var isHealing:Boolean;// = false
private var rayCounter:int;
public var velocidadDiagonal:Number;
var weaponEnabled:Array;
var ticObj:Number;// = 1000
var interval_level:Timer;
public var level:CanvasScenario;
public var aunVivo:Boolean;
public var score:Number;
public var healths:Array;
public var movieClip:MovieClip;
public var particulaA:MovieClip;
private var mouse:Vector2D;
public var particulaB:MovieClip;
public var rateOfFire:Number;
public var posicionAnterior:Vector2D;
public var experiencia:int;
public var particulaC:MovieClip;
public var expIntervalo:Array;
public var origenBala:Array;
public var money:int;
public var bases:Array;
private var deltaMouse:Vector2D;
public var isMovingUp:Boolean;// = false
public var isMovingDown:Boolean;// = false
public var energiaTotal:Number;
public var posicion:Vector2D;
public var dominationTimeRemaining:int;
public var points:Number;
public var energia:Number;
public var isMovingRight:Boolean;// = false
var ticCorazon:Number;// = 1000
private var fireWeapon:Function;
var currentWeapon:int;// = 0
public var _actionMessage:MovieClip;
public var radio:Number;
public var _radio:Number;
public function Player(main:MovieClip, canvas:CanvasScenario){
var i:int;
var j:int;
var newHealth:MovieClip;
isMovingUp = false;
isMovingDown = false;
isMovingLeft = false;
isMovingRight = false;
danyoDisparo = Parametros.DanyoDisparo;
energia = Parametros.EnergiaInicialPlayer;
conqueringTimeRemaining = 1000;
actualTic = 3000;
interval_level = new Timer((1000 / 30), 0);
ticCorazon = 1000;
ticObj = 1000;
pushBack = 0;
isHealing = false;
currentWeapon = 0;
weaponDef = [[3, 0.8, 150, 1.9], [1, 0.2, 50, 3.4], [6, 1, 50, 2.4], [3, 0.5, 200, 1.9], [6, 1.5, 250, 1.65], [9, 1, 125, 1.4]];
weaponEnabled = [1, 0, 0, 0, 0, 0];
super();
level = canvas;
points = 0;
construirTextoEnergia(main);
posicionAnterior = new Vector2D();
posicion = new Vector2D();
posicion.X = (level.posInitPX + level.map.x);
posicion.Y = (level.posInitPY + level.map.y);
currentTileI = Math.floor((posicion.Y / Parametros.TamanyoTile));
currentTileJ = Math.floor((posicion.X / Parametros.TamanyoTile));
bases = new Array((level.baseEsperada.length + 1));
i = 0;
while (i < level.baseEsperada.length) {
bases[i] = new Base(i, level.baseEsperada[i][1], level.baseEsperada[i][0], level, false);
i++;
};
bases[level.baseEsperada.length] = new Base(level.baseEsperada.length, currentTileI, currentTileJ, level, true);
bases[level.baseEsperada.length].energia = 1;
healths = new Array(level.healthEsperada.length);
j = 0;
while (j < level.healthEsperada.length) {
newHealth = new HealthSpace();
newHealth.x = (32 * level.healthEsperada[j][0]);
newHealth.y = (32 * level.healthEsperada[j][1]);
level.map.addChild(newHealth);
healths[j] = newHealth;
j++;
};
movieClip = new Conejo();
movieClip.gotoAndStop(1);
_radio = ((movieClip.height / 2) - 3);
canvas.padre.layerPlayer.addChild(movieClip);
particulaA = movieClip.particula1;
particulaB = movieClip.particula2;
particulaC = movieClip.particula3;
particulaA.alpha = 0;
particulaB.alpha = 0;
particulaC.alpha = 0;
particulaA.stop();
rayMC = new Rayo();
rayMC.visible = false;
level.map.addChild(rayMC);
deltaMouse = new Vector2D();
mouse = new Vector2D();
canvas.objectBeingFollowed = this.movieClip;
movieClip.stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
movieClip.stage.addEventListener(KeyboardEvent.KEY_UP, onKeyUp);
movieClip.stage.addEventListener(MouseEvent.MOUSE_DOWN, onClick);
movieClip.stage.addEventListener(MouseEvent.MOUSE_UP, onUnclick);
clickDown = false;
fireWeapon = fireMachineGun;
money = Parametros.DineroInicialPlayer;
domination = 0;
nivel = 0;
levelUp();
experiencia = 0;
expIntervalo = [5, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100];
maxNiveles = 20;
score = 0;
conqueringTimeRemaining = 1000;
energia = (energiaTotal = Parametros.ParametrosPlayerPorNivel[0]);
velocidad = Parametros.ParametrosPlayerPorNivel[1];
velocidadDiagonal = (velocidad / 1.4142);
rateOfFire = Parametros.ParametrosPlayerPorNivel[2];
danyoDisparo = Parametros.ParametrosPlayerPorNivel[3];
radio = Parametros.ParametrosPlayerPorNivel[4];
thisWin = false;
updatePlayer = true;
pushBack = 0;
_actionMessage = movieClip.actionMessage;
origenBala = [[0, -6], [5.5, 1.5], [4, 8], [3, 6.5], [1.5, 5], [-4, 7], [-5, 8], [-5, 4]];
}
public function corregirPosicion():Boolean{
var i:int;
var j:int;
var xTile:Number;
var yTile:Number;
var sobrePasaArriba:Boolean;
var sobrePasaIzq:Boolean;
var sobrePasaAbajo:Boolean;
var sobrePasaDer:Boolean;
var truncado:Boolean;
i = int((posicion.Y / Parametros.TamanyoTile));
j = int((posicion.X / Parametros.TamanyoTile));
xTile = (j * Parametros.TamanyoTile);
yTile = (i * Parametros.TamanyoTile);
sobrePasaArriba = false;
sobrePasaIzq = false;
sobrePasaAbajo = false;
sobrePasaDer = false;
truncado = false;
if (((isMovingUp) && (((posicion.Y - _radio) < yTile)))){
sobrePasaArriba = true;
if (!level.tilePasable((i - 1), j)){
posicion.Y = posicionAnterior.Y;
truncado = true;
};
};
if (((isMovingDown) && (((posicion.Y + _radio) > (yTile + Parametros.TamanyoTile))))){
sobrePasaAbajo = true;
if (!level.tilePasable((i + 1), j)){
posicion.Y = posicionAnterior.Y;
truncado = true;
};
};
if (((isMovingLeft) && (((posicion.X - _radio) < xTile)))){
sobrePasaIzq = true;
if (!level.tilePasable(i, (j - 1))){
posicion.X = posicionAnterior.X;
truncado = true;
};
};
if (((isMovingRight) && (((posicion.X + _radio) > (xTile + Parametros.TamanyoTile))))){
sobrePasaDer = true;
if (!level.tilePasable(i, (j + 1))){
posicion.X = posicionAnterior.X;
truncado = true;
};
};
if (!truncado){
if (((sobrePasaIzq) && (sobrePasaArriba))){
if ((((posicion.X - xTile) * (posicion.X - xTile)) + ((posicion.Y - yTile) * (posicion.Y - yTile))) < (_radio * _radio)){
if (!level.tilePasable((i - 1), (j - 1))){
posicion.assign(posicionAnterior);
};
};
};
if (((sobrePasaDer) && (sobrePasaArriba))){
if ((((posicion.X - (xTile + Parametros.TamanyoTile)) * (posicion.X - (xTile + Parametros.TamanyoTile))) + ((posicion.Y - yTile) * (posicion.Y - yTile))) < (_radio * _radio)){
if (!level.tilePasable((i - 1), (j + 1))){
posicion.assign(posicionAnterior);
};
};
};
if (((sobrePasaDer) && (sobrePasaAbajo))){
if ((((posicion.X - (xTile + Parametros.TamanyoTile)) * (posicion.X - (xTile + Parametros.TamanyoTile))) + ((posicion.Y - (yTile + Parametros.TamanyoTile)) * (posicion.Y - (yTile + Parametros.TamanyoTile)))) < (_radio * _radio)){
if (!level.tilePasable((i + 1), (j + 1))){
posicion.assign(posicionAnterior);
};
};
};
if (((sobrePasaIzq) && (sobrePasaAbajo))){
if ((((posicion.X - xTile) * (posicion.X - xTile)) + ((posicion.Y - (yTile + Parametros.TamanyoTile)) * (posicion.Y - (yTile + Parametros.TamanyoTile)))) < (_radio * _radio)){
if (!level.tilePasable((i + 1), (j - 1))){
posicion.assign(posicionAnterior);
};
};
};
};
return (false);
}
public function onClick(e:MouseEvent){
if (level.padre.hudMenu.overhud == false){
clickDown = true;
fireWeapon(0);
};
}
public function updateNivelCounter(){
}
public function updateExperience(value:int){
if (nivel < maxNiveles){
experiencia = (experiencia + value);
if ((((expIntervalo[(nivel - 1)] <= experiencia)) && ((nivel < maxNiveles)))){
experiencia = (experiencia - expIntervalo[(nivel - 1)]);
levelUp();
};
trace(((experiencia + "/") + expIntervalo[(nivel - 1)]));
level.padre.hudMenu._expBar.barMask.scaleX = (experiencia / expIntervalo[(nivel - 1)]);
};
}
public function updateEnergyCounter(){
if (level.padre.hudMenu != null){
level.padre.hudMenu._healthBar.barMask.scaleX = (energia / energiaTotal);
};
}
public function setWeapon(value:int){
currentWeapon = value;
danyoDisparo = (weaponDef[value][0] + (level.padre.hudMenu.damageCount * Parametros.UpgradePropiedadesJugador[3]));
radio = (weaponDef[value][2] + (level.padre.hudMenu.rangeCount * Parametros.UpgradePropiedadesJugador[4]));
velocidad = (weaponDef[value][3] + (level.padre.hudMenu.healthCount * Parametros.UpgradePropiedadesJugador[1]));
velocidadDiagonal = (velocidad / 1.4142);
rateOfFire = (weaponDef[value][1] + (level.padre.hudMenu.rateCount * Parametros.UpgradePropiedadesJugador[2]));
}
function fireGun(elapsedTime:int){
if (clickDown){
clickDown = false;
trace("bullet");
level.newAddBullet(((movieClip.x + level.map.x) + origenBala[currentAnimation][0]), ((movieClip.y + level.map.y) + origenBala[currentAnimation][1]), radio, level.padre.mouseInScreen.X, level.padre.mouseInScreen.Y, true);
trace(origenBala[currentAnimation][0]);
};
}
function fireRay(){
deltaMouse.normalize(6);
rayMC.x = (deltaMouse.X + movieClip.x);
rayMC.y = (deltaMouse.Y + movieClip.y);
rayMC.rotation = currentRotation;
deltaMouse.X = (deltaMouse.X * 50);
deltaMouse.Y = (deltaMouse.Y * 50);
if (level.newFireBullet(posicion, deltaMouse, mouse, rayMC.rotation, danyoDisparo, true)){
rayMC.visible = true;
rayCounter = 2;
level.padre.padre.soundSystem.gunA.play(0, 1, level.padre.padre.soundSystem.volPrincipal);
};
}
public function levelUp(){
particulaA.alpha = 1;
particulaA.gotoAndPlay(1);
particulaB.alpha = 1;
particulaC.alpha = 1;
actualTic = 3000;
interval_level.addEventListener(TimerEvent.TIMER, tic);
interval_level.start();
if (nivel > 0){
points = (points + 1);
level.padre.hudMenu.upgradeUpgrade(points);
level.padre.hudMenu._totalPoints.text = ("" + points);
money = (money + 30);
};
nivel++;
updateNivelCounter();
updateMoneyCounter();
if (nivel > 1){
updateScore(nivel);
level.padre.hudMenu._actualLevel.text = ("" + nivel);
};
}
public function sufrirDanyo(danyo:Number){
energia = (energia - danyo);
updateEnergyCounter();
}
function fireMachineGun(elapsedTime:int){
if (level.padre.isRun == true){
if (((clickDown) && ((machineGunCounter <= 0)))){
level.newAddBullet(((movieClip.x + level.map.x) + origenBala[int((currentAnimation / 10))][0]), ((movieClip.y + level.map.y) + origenBala[int((currentAnimation / 10))][1]), radio, level.padre.mouseInScreen.X, level.padre.mouseInScreen.Y, true);
machineGunCounter = (rateOfFire * 1000);
} else {
if (machineGunCounter > 0){
machineGunCounter = (machineGunCounter - elapsedTime);
};
};
};
}
public function updateScore(value:Number){
score = (score + (value * 10));
level.padre.hudMenu._actualScore.text = score.toString();
}
public function updateMoneyCounter(){
}
function tic(event:TimerEvent):void{
actualTic = (actualTic - (1000 / 30));
if (actualTic <= 1){
particulaB.alpha = (particulaB.alpha - 0.1);
particulaC.alpha = (particulaC.alpha - 0.1);
if (actualTic <= 0){
particulaB.alpha = 0;
particulaC.alpha = 0;
particulaA.stop();
particulaA.alpha = 0;
interval_level.stop();
interval_level.removeEventListener(TimerEvent.TIMER, this.tic);
};
};
}
public function danyarBase(baseDestino:int, danyoGolpe:Number){
if (baseDestino == Parametros.MaximaCantidadDeBases){
sufrirDanyo(danyoGolpe);
} else {
bases[baseDestino].sufrirDanyo(danyoGolpe);
};
}
public function onUnclick(e:MouseEvent){
clickDown = false;
}
function update(_mouse:Vector2D, elapsedTime:int){
var k:int;
var j:int;
var newTileI:int;
var newTileJ:int;
if (domination == level.baseEsperada.length){
score = (score + 1000);
updateScore(100);
level.padre.hudMenu._totalPoints.text = ("" + points);
level.padre.hudMenu.upgradeUpgrade(points);
k = 0;
while (k < level.baseEsperada.length) {
bases[k].reset();
k++;
};
};
isHealing = false;
ticCorazon = (ticCorazon - elapsedTime);
j = 0;
while (j < healths.length) {
if ((((((((((healths[j].x <= movieClip.x)) && ((movieClip.x < (healths[j].x + 32))))) && ((healths[j].y <= (movieClip.y + 10))))) && (((movieClip.y + 10) < (healths[j].y + 32))))) && ((energia < 3)))){
energia = (energia + 0.002);
updateEnergyCounter();
isHealing = true;
healths[j].gotoAndStop(2);
if (ticCorazon <= 0){
level.padre.padre.soundSystem.corazon.play(0, 1, level.padre.padre.soundSystem.volPrincipal);
ticCorazon = (ticObj * (energia / 3));
if (ticCorazon < 175){
ticCorazon = 200;
};
};
if (energia >= 3){
energia = 3;
};
} else {
healths[j].gotoAndStop(1);
};
j++;
};
if (((isHealing) && ((energia < 3)))){
particulaA.alpha = 1;
particulaA.play();
} else {
particulaA.alpha = 0;
particulaA.stop();
};
conqueringTimeRemaining = (conqueringTimeRemaining - elapsedTime);
if (conqueringTimeRemaining <= 0){
k = 0;
while (k < bases.length) {
if (!bases[k].isConquered){
bases[k].conquestProgress(bases[k].isConquering);
};
k++;
};
conqueringTimeRemaining = 100;
};
mouse.assign(_mouse);
deltaMouse.X = (mouse.X - posicion.X);
deltaMouse.Y = (mouse.Y - posicion.Y);
currentRotation = (90 - (Math.atan2(-(deltaMouse.Y), deltaMouse.X) * 57.2957));
newAnimationDirection = currentRotation;
if (newAnimationDirection < -22.5){
newAnimationDirection = (newAnimationDirection + 360);
};
newAnimationDirection = (newAnimationDirection + 22.5);
currentAnimation = ((Math.floor((newAnimationDirection / 45)) * 10) + 1);
posicionAnterior.assign(posicion);
if (isMovingUp){
if (isMovingLeft){
posicion.Y = (posicion.Y - velocidadDiagonal);
posicion.X = (posicion.X - velocidadDiagonal);
} else {
if (isMovingRight){
posicion.Y = (posicion.Y - velocidadDiagonal);
posicion.X = (posicion.X + velocidadDiagonal);
} else {
posicion.Y = (posicion.Y - velocidad);
};
};
} else {
if (isMovingDown){
if (isMovingLeft){
posicion.Y = (posicion.Y + velocidadDiagonal);
posicion.X = (posicion.X - velocidadDiagonal);
} else {
if (isMovingRight){
posicion.Y = (posicion.Y + velocidadDiagonal);
posicion.X = (posicion.X + velocidadDiagonal);
} else {
posicion.Y = (posicion.Y + velocidad);
};
};
} else {
if (isMovingLeft){
posicion.X = (posicion.X - velocidad);
} else {
if (isMovingRight){
posicion.X = (posicion.X + velocidad);
};
};
};
};
if (posicion.equals(posicionAnterior)){
if (currentAnimation != movieClip.currentFrame){
movieClip.gotoAndStop(currentAnimation);
};
} else {
corregirPosicion();
if ((currentAnimation + 1) != movieClip.currentFrame){
movieClip.gotoAndStop((currentAnimation + 1));
};
newTileI = Math.floor((posicion.Y / Parametros.TamanyoTile));
newTileJ = Math.floor((posicion.X / Parametros.TamanyoTile));
if (((!((newTileI == currentTileI))) || (!((newTileJ == currentTileJ))))){
AStar.updateEstimate(Parametros.MaximaCantidadDeBases, ((newTileJ - currentTileJ) * Parametros.TamanyoTile), ((newTileI - currentTileI) * Parametros.TamanyoTile), newTileI, newTileJ);
currentTileI = newTileI;
currentTileJ = newTileJ;
bases[Parametros.MaximaCantidadDeBases].setPosicion(posicion.X, posicion.Y, currentTileI, currentTileJ);
};
};
movieClip.x = posicion.X;
movieClip.y = posicion.Y;
if (rayCounter >= 0){
rayCounter--;
if (rayCounter < 0){
rayMC.visible = false;
};
};
fireWeapon(elapsedTime);
if (energia > 0){
if (thisWin == true){
updatePlayer = false;
};
updatePlayer = true;
} else {
updatePlayer = false;
};
}
public function onKeyUp(event:KeyboardEvent){
switch (event.keyCode){
case 37:
case 65:
isMovingLeft = false;
break;
case 38:
case 87:
isMovingUp = false;
break;
case 39:
case 68:
isMovingRight = false;
break;
case 40:
case 83:
isMovingDown = false;
break;
};
}
public function onKeyDown(event:KeyboardEvent){
switch (event.keyCode){
case 37:
case 65:
isMovingLeft = true;
break;
case 39:
case 68:
isMovingRight = true;
break;
case 38:
case 87:
isMovingUp = true;
break;
case 40:
case 83:
isMovingDown = true;
break;
};
}
public function construirTextoEnergia(main:MovieClip){
var format:TextFormat;
format = new TextFormat();
format.font = "Verdana";
format.color = 0xFFFFFF;
format.size = 12;
format.align = "right";
energyCounter = new TextField();
energyCounter.defaultTextFormat = format;
energyCounter.selectable = false;
energyCounter.width = (Canvas.APPLICATION_WIDTH - 5);
energyCounter.height = 30;
energyCounter.y = 5;
energyCounter.x = 5;
main.addChild(energyCounter);
}
public function updateDominationCounter(){
}
public function addTurret(x:int, y:int){
var i:int;
i = 0;
while (i < level.baseEsperada.length) {
if ((((((((level.baseEsperada[i][0] <= x)) && ((x < (level.baseEsperada[i][0] + 1))))) && ((((level.baseEsperada[i][1] <= y)) && ((y < (level.baseEsperada[i][1] + 1))))))) && ((bases[i].isConquered == true)))){
if ((((money >= Parametros.CostoBase)) && ((bases[i].energia <= 0)))){
money = (money - Parametros.CostoBase);
updateMoneyCounter();
bases[i].revivir();
level.avisarNuevaTorreta();
};
};
i++;
};
}
}
}//package
Section 165 (198 B)
//PlayerMC (PlayerMC)
package {
import flash.display.*;
public class PlayerMC extends MovieClip {
public var padre:CanvasScenario;
public function PlayerMC(){
super();
}
}
}//package
Section 166 (718 B)
//PointControled (PointControled)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public dynamic class PointControled extends MovieClip {
public var actualTic:Number;
public var interval:Timer;
public function PointControled(){
super();
addFrameScript(0, frame1);
}
function frame1(){
actualTic = 3;
interval = new Timer(1000, 0);
interval.addEventListener(TimerEvent.TIMER, tic);
interval.start();
}
public function tic(event:TimerEvent):void{
this.actualTic--;
if (this.actualTic == 0){
this.interval.stop();
this.interval.removeEventListener(TimerEvent.TIMER, this.tic);
this.parent.removeChild(this);
};
}
}
}//package
Section 167 (190 B)
//Pulgar (Pulgar)
package {
import flash.display.*;
public dynamic class Pulgar extends MovieClip {
public var mc:MovieClip;
public function Pulgar(){
super();
}
}
}//package
Section 168 (154 B)
//Rayo (Rayo)
package {
import flash.display.*;
public dynamic class Rayo extends MovieClip {
public function Rayo(){
super();
}
}
}//package
Section 169 (160 B)
//Rebote1 (Rebote1)
package {
import flash.media.*;
public dynamic class Rebote1 extends Sound {
public function Rebote1(){
super();
}
}
}//package
Section 170 (160 B)
//Rebote2 (Rebote2)
package {
import flash.media.*;
public dynamic class Rebote2 extends Sound {
public function Rebote2(){
super();
}
}
}//package
Section 171 (160 B)
//Rebote3 (Rebote3)
package {
import flash.media.*;
public dynamic class Rebote3 extends Sound {
public function Rebote3(){
super();
}
}
}//package
Section 172 (160 B)
//Rebote4 (Rebote4)
package {
import flash.media.*;
public dynamic class Rebote4 extends Sound {
public function Rebote4(){
super();
}
}
}//package
Section 173 (162 B)
//RedBar (RedBar)
package {
import flash.display.*;
public dynamic class RedBar extends MovieClip {
public function RedBar(){
super();
}
}
}//package
Section 174 (158 B)
//Robot (Robot)
package {
import flash.display.*;
public dynamic class Robot extends MovieClip {
public function Robot(){
super();
}
}
}//package
Section 175 (156 B)
//Rocket (Rocket)
package {
import flash.media.*;
public dynamic class Rocket extends Sound {
public function Rocket(){
super();
}
}
}//package
Section 176 (160 B)
//Rocket2 (Rocket2)
package {
import flash.media.*;
public dynamic class Rocket2 extends Sound {
public function Rocket2(){
super();
}
}
}//package
Section 177 (162 B)
//Runner (Runner)
package {
import flash.display.*;
public dynamic class Runner extends MovieClip {
public function Runner(){
super();
}
}
}//package
Section 178 (170 B)
//Sargento (Sargento)
package {
import flash.display.*;
public dynamic class Sargento extends MovieClip {
public function Sargento(){
super();
}
}
}//package
Section 179 (1.85 KiB) ●
//ScoreSystem (ScoreSystem)
package {
import mochi.*;
public class ScoreSystem {
public var padre:UICanvas;
public var kongregate;
public function ScoreSystem(){
super();
}
private function scoreSubmitted(scores:Object){
}
public function connectSystem(){
MochiServices.connect("3347596c983d31fe", padre);
}
public function submitScore(value:Number, score:Number){
switch (value){
case 1:
MochiScores.setBoardID("411d5e9943d8599b");
break;
case 2:
MochiScores.setBoardID("585ae175eaff49d8");
break;
case 3:
MochiScores.setBoardID("f8e708bf73d0cb7a");
break;
case 4:
MochiScores.setBoardID("80c0309dc986e1a4");
break;
case 5:
MochiScores.setBoardID("5802ff77fe575d45");
break;
case 6:
MochiScores.setBoardID("a403e2bbdd18a56b");
break;
case 7:
MochiScores.setBoardID("6987d81599832f61");
break;
};
MochiScores.submit(score, padre.local_data.data.playerName, this, "scoreSubmitted");
}
public function showScores(value:Number){
var value = value;
switch (value){
case 1:
MochiScores.setBoardID("411d5e9943d8599b");
break;
case 2:
MochiScores.setBoardID("585ae175eaff49d8");
break;
case 3:
MochiScores.setBoardID("f8e708bf73d0cb7a");
break;
case 4:
MochiScores.setBoardID("80c0309dc986e1a4");
break;
case 5:
MochiScores.setBoardID("5802ff77fe575d45");
break;
case 6:
MochiScores.setBoardID("a403e2bbdd18a56b");
break;
case 7:
MochiScores.setBoardID("6987d81599832f61");
break;
};
MochiScores.showLeaderboard({res:"700x500", clip:padre, numScores:25, showTableRank:true, preloaderDisplay:true, onClose:function (){
padre.addMainMenu();
}, onError:function (errorCode:String){
trace(("show error: " + errorCode));
}});
}
}
}//package
Section 180 (794 B)
//SecCounter (SecCounter)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class SecCounter extends MovieClip {
public var padre:UICanvas;
public var actualTic:Number;// = 8
public var nextScreen:String;
public var interval:Timer;
public function SecCounter(){
actualTic = 8;
super();
x = 275;
y = 200;
gotoAndStop(actualTic);
interval = new Timer(1000, 0);
interval.addEventListener(TimerEvent.TIMER, tic);
interval.start();
}
function tic(event:TimerEvent):void{
actualTic--;
if (actualTic == 0){
interval.stop();
interval.removeEventListener(TimerEvent.TIMER, tic);
padre.gotoAndStop(nextScreen);
padre.removeChild(this);
} else {
gotoAndStop(actualTic);
};
}
}
}//package
Section 181 (166 B)
//Soldado (Soldado)
package {
import flash.display.*;
public dynamic class Soldado extends MovieClip {
public function Soldado(){
super();
}
}
}//package
Section 182 (188 B)
//SonidoDisparoA (SonidoDisparoA)
package {
import flash.media.*;
public dynamic class SonidoDisparoA extends Sound {
public function SonidoDisparoA(){
super();
}
}
}//package
Section 183 (188 B)
//SonidoDisparoB (SonidoDisparoB)
package {
import flash.media.*;
public dynamic class SonidoDisparoB extends Sound {
public function SonidoDisparoB(){
super();
}
}
}//package
Section 184 (188 B)
//SonidoDisparoE (SonidoDisparoE)
package {
import flash.media.*;
public dynamic class SonidoDisparoE extends Sound {
public function SonidoDisparoE(){
super();
}
}
}//package
Section 185 (184 B)
//SonidoMuerteA (SonidoMuerteA)
package {
import flash.media.*;
public dynamic class SonidoMuerteA extends Sound {
public function SonidoMuerteA(){
super();
}
}
}//package
Section 186 (184 B)
//Sound_Shotgun (Sound_Shotgun)
package {
import flash.media.*;
public dynamic class Sound_Shotgun extends Sound {
public function Sound_Shotgun(){
super();
}
}
}//package
Section 187 (2.31 KiB) ●
//SoundSystem (SoundSystem)
package {
import flash.media.*;
public class SoundSystem {
public var gunA:Sound;
public var gunC:Sound;
public var gunB:Sound;
public var gunD:Sound;
public var gunF:Sound;
public var gunBB:Sound;
public var exploDinamita:Sound;
public var mainMenuIntro:Sound;
public var shotgun:Sound;
public var auch:Sound;
public var volPrincipal:SoundTransform;
public var bonus:Sound;
public var rebote1:Sound;
public var rebote2:Sound;
public var rebote4:Sound;
public var rebote3:Sound;
public var entierro:Sound;
public var gunFF:Sound;
public var sonidoMenuB:Sound;
public var padre:UICanvas;
public var volSecundario:SoundTransform;
public var exploMina:Sound;
public var exploRocket:Sound;
public var golpe1:Sound;
public var golpe2:Sound;
public var impactoEnemigo1:Sound;
public var golpe4:Sound;
public var corazon:Sound;
public var gunAA:Sound;
public var golpe3:Sound;
public var sonidoMenuA:Sound;
public var canalSecundario:SoundChannel;
public var canalPrincipal:SoundChannel;
public function SoundSystem(){
gunA = new GunFire();
gunAA = new GunFire_doble();
gunB = new GunFire2();
gunBB = new GunFire2_double();
gunD = new SonidoDisparoB();
gunC = new SonidoDisparoE();
gunF = new Rocket();
gunFF = new Rocket2();
shotgun = new Sound_Shotgun();
exploDinamita = new ExploDinamita();
exploMina = new BumA();
exploRocket = new ExploRocket();
rebote1 = new Rebote1();
rebote2 = new Rebote2();
rebote3 = new Rebote3();
rebote4 = new Rebote4();
golpe1 = new Golpe1();
golpe2 = new Golpe2();
golpe3 = new Golpe3();
golpe4 = new Golpe4();
auch = new GolpeEnemigo5();
impactoEnemigo1 = new ExplosionDisparoEnemigo1();
sonidoMenuA = new clickAnalogico();
sonidoMenuB = new clickBurbuja();
bonus = new Bonus();
mainMenuIntro = new MainMenuShotGun();
corazon = new Corazon();
entierro = new Entierro();
canalPrincipal = new SoundChannel();
volPrincipal = new SoundTransform(0);
canalSecundario = new SoundChannel();
volSecundario = new SoundTransform();
super();
canalPrincipal.soundTransform = volPrincipal;
trace(("VOL: " + canalPrincipal.soundTransform.volume));
volSecundario.volume = 0.05;
canalSecundario.soundTransform = volSecundario;
}
}
}//package
Section 188 (3.68 KiB) ●
//SpecialContent (SpecialContent)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class SpecialContent extends MovieClip {
public var padre:UICanvas;
public var thumbBase10:ThumbnailButton;
public var backB:SimpleButton;
public var thumbBase3:ThumbnailButton;
public var thumbBase7:ThumbnailButton;
public var thumbBase5:ThumbnailButton;
public var thumbBase2:ThumbnailButton;
public var thumbBase8:ThumbnailButton;
public var thumbBase9:ThumbnailButton;
public var thumbBase6:ThumbnailButton;
public var thumbBase1:ThumbnailButton;
public var thumbBase4:ThumbnailButton;
var interval:Timer;
var big_pic:Loader;
public var back:SimpleButton;
public function SpecialContent(){
thumbBase1 = new ThumbnailButton();
thumbBase2 = new ThumbnailButton();
thumbBase3 = new ThumbnailButton();
thumbBase4 = new ThumbnailButton();
thumbBase5 = new ThumbnailButton();
thumbBase6 = new ThumbnailButton();
thumbBase7 = new ThumbnailButton();
thumbBase8 = new ThumbnailButton();
thumbBase9 = new ThumbnailButton();
thumbBase10 = new ThumbnailButton();
big_pic = new Loader();
super();
backB = back;
alpha = 0;
interval = new Timer((1000 / 24), 0);
thumbBase1.createThumb("specialcontent/Ilus_Mapa_1_thumb.jpg", "specialcontent/Ilus_Mapa_1.jpg", "InGame action drawing #1", this, -260, -125);
thumbBase2.createThumb("specialcontent/Ilus_Mapa_2_thumb.jpg", "specialcontent/Ilus_Mapa_2.jpg", "InGame action drawing #2", this, -260, -75);
thumbBase3.createThumb("specialcontent/Ilus_Mapa_3_thumb.jpg", "specialcontent/Ilus_Mapa_3.jpg", "InGame action drawing #3", this, -260, -25);
thumbBase4.createThumb("specialcontent/PersonajePrincipal_thumb.jpg", "specialcontent/PersonajePrincipal.jpg", "Main Character drawings", this, -260, 25);
thumbBase5.createThumb("specialcontent/PersonajePrincipal_thumb.jpg", "specialcontent/PersonajePrincipal.jpg", "Main Character drawings", this, -260, 75);
thumbBase6.createThumb("specialcontent/PersonajePrincipal_thumb.jpg", "specialcontent/PersonajePrincipal.jpg", "Main Character drawings", this, 190, -125);
thumbBase7.createThumb("specialcontent/PersonajePrincipal_thumb.jpg", "specialcontent/PersonajePrincipal.jpg", "Main Character drawings", this, 190, -75);
thumbBase8.createThumb("specialcontent/PersonajePrincipal_thumb.jpg", "specialcontent/PersonajePrincipal.jpg", "Main Character drawings", this, 190, -25);
thumbBase9.createThumb("specialcontent/PersonajePrincipal_thumb.jpg", "specialcontent/PersonajePrincipal.jpg", "Main Character drawings", this, 190, 25);
thumbBase10.createThumb("specialcontent/PersonajePrincipal_thumb.jpg", "specialcontent/PersonajePrincipal.jpg", "Main Character drawings", this, 190, 75);
this.addChild(big_pic);
backB.addEventListener(MouseEvent.CLICK, backClick);
backB.addEventListener(MouseEvent.ROLL_OVER, backOver);
backB.addEventListener(MouseEvent.ROLL_OUT, backOut);
}
function fadeOut(event:TimerEvent):void{
alpha = (alpha - 0.1);
if (alpha <= 0){
interval.removeEventListener(TimerEvent.TIMER, fadeOut);
padre.addMainMenu();
padre.removeChild(this);
};
}
public function backOver(event:MouseEvent):void{
}
function exitWindow(){
interval.addEventListener(TimerEvent.TIMER, fadeOut);
}
function fadeIn(event:TimerEvent):void{
alpha = (alpha + 0.1);
if (alpha >= 1){
interval.removeEventListener(TimerEvent.TIMER, fadeIn);
};
}
public function backClick(event:MouseEvent):void{
exitWindow();
}
function enterWindow(){
interval.addEventListener(TimerEvent.TIMER, fadeIn);
interval.start();
}
public function backOut(event:MouseEvent):void{
}
}
}//package
Section 189 (174 B)
//SpriteMap (SpriteMap)
package {
import flash.display.*;
public dynamic class SpriteMap extends MovieClip {
public function SpriteMap(){
super();
}
}
}//package
Section 190 (5.88 KiB) ● ●
//Text (Text)
package {
public class Text {
public static const optionVA:String = "TRY AGAIN";
public static const titleVA:String = "YOU WIN!";
public static const titleVB:String = "GAME OVER";
public static const optionVD:String = "NEXT WAVE";
public static const AchieveTitle10:String = "Kill 3000 Index Soldiers";
public static const AchieveTitle11:String = "Kill 3000 Runners";
public static const AchieveTitle12:String = "Kill 25000 Enemies";
public static const optionVB:String = "BACK";
public static const textVBB:String = "drag & drop";
public static const AchieveOptionUP:String = "UP";
public static const textSA:String = "MOVE";
public static const textSB:String = "SHOOT & AIM";
public static const textSC:String = "CONQUEST";
public static const textSE:String = "PLANT TRAPS";
public static const textSD:String = "UPGRADE POINTS";
public static const AchieveDescription01:String = "Survive through all 30 levels in easy mode.";
public static const AchieveDescription02:String = "Survive through all 40 levels in normal mode.";
public static const AchieveDescription04:String = "Survive through all 40 levels in challenge mode.";
public static const AchieveDescription05:String = "Kill 5000 enemies using your gun.";
public static const AchieveDescription06:String = "Kill 3000 thumb soldiers in any mode.";
public static const AchieveDescription07:String = "Kill 3000 Seargents in any mode.";
public static const AchieveDescription08:String = "Kill 3000 Shooters in any mode.";
public static const AchieveDescription09:String = "Kill 3000 Kamikaze in any mode.";
public static const AchieveDescription03:String = "Survive through all 40 levels in hard mode.";
public static const optionIC:String = "HARD,Map:All mighty bunny";
public static const optionIE:String = "ACHIEVEMENTS";
public static const textTA:String = "You gain upgrade points this way.";
public static const textTB:String = "Use your points to upgrade you special abilities: Health, speed, damage, rate of fire and range.";
public static const textTC:String = "Use the money you earn from killing enemies to buy traps. You can drag from the menu at your right and drop them anywhere in the game field.";
public static const optionIB:String = "NORMAL,Map:Five corners";
public static const optionID:String = "CHALLENGE,Map:No way, Jose!";
public static const optionVAB:String = "pause";
public static const optionIA:String = "EASY,Map:Three easy ways";
public static const AchieveDescription11:String = "Kill 3000 Runners in any mode.";
public static const AchieveDescription12:String = "Kill 25000 Enemies in any mode.";
public static const optionB:String = "PLAY";
public static const optionC:String = "HIGHSCORES";
public static const optionD:String = "ACHIEVEMENTS";
public static const AchieveDescription10:String = "Kill 3000 Index Soldiers in any mode.";
public static const optionH:String = "BACK";
public static const textUA:String = "survive the enemy attacks!";
public static const optionA:String = "OK";
public static const textUB:String = "pause";
public static const textUC:String = "Controling";
public static const textUD:String = "Point Controled";
public static const optionVBB:String = "continue";
public static const textVB:String = "You got killed by your enemies! Give it another try!";
public static const textVD:String = "Points availble for upgrade:";
public static const textVF:String = "Damage:";
public static const AchieveDetailA:String = "Ach.Score:";
public static const AchieveDetailB:String = "Progress:";
public static const AchieveTitle:String = "Achievements";
public static const AchieveOptionDOWN:String = "DOWN";
public static const textVAB:String = "Score";
public static const textVE:String = "Speed:";
public static const textVN:String = "Normal";
public static const textVG:String = "Rate of Fire:";
public static const textVH:String = "EXPLOSIVE MINE. High damage, small area of effect.";
public static const textVA:String = "Congratulations, your score has been submited!";
public static const textVK:String = "DYNAMITE. Explodes after 2 seconds, high damage and area of effect.";
public static const textVC:String = "current wave";
public static const textVM:String = "Easy";
public static const textB:String = "SHOOT & AIM";
public static const textD:String = "Level:";
public static const textVJ:String = "FREEZE TRAP. Freezes enemies for 5 seconds.";
public static const textA:String = "MOVE";
public static const textC:String = "Achievements:";
public static const inputA:String = "Type your name.";
public static const textVP:String = "New Enemy";
public static const textVL:String = "Cost:";
public static const textVQ:String = "Boss";
public static const textVS:String = "New Boss";
public static const textVI:String = "POISSON MINE. Periodic damage, medium area of effect.";
public static const textVO:String = "Hard";
public static const optionVC:String = "main Menu";
public static const optionVE:String = "upgrade";
public static const AchieveTitle01:String = "Beat Easy Mode";
public static const titleA:String = "what's your name?";
public static const AchieveTitle03:String = "Beat Hard Mode";
public static const titleC:String = "how to play?";
public static const AchieveTitle05:String = "Make 5000 gun kills";
public static const AchieveOptionBACK:String = "BACK";
public static const AchieveTitle07:String = "Kill 3000 Seargents";
public static const AchieveTitle08:String = "Kill 3000 Shooters";
public static const AchieveTitle02:String = "Beat Normal Mode";
public static const AchieveTitle04:String = "Beat Challenge Mode";
public static const AchieveTitle06:String = "Kill 3000 thumb soldiers";
public static const slogan:String = "Enlightening Entertainment!";
public static const AchieveTitle09:String = "Kill 3000 Kamikaze";
public function Text(){
super();
}
}
}//package
Section 191 (1.3 KiB) ●
//ThumbnailButton (ThumbnailButton)
package {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public class ThumbnailButton extends MovieClip {
public var padre:SpecialContent;
public var picldr:Loader;
public var _caption;
public var imgReq:URLRequest;
public var thumbReq:URLRequest;
public function ThumbnailButton(){
picldr = new Loader();
super();
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
public function createThumb(thumb:String, picture:String, caption:String, _padre:SpecialContent, a:Number, b:Number){
x = a;
y = b;
_caption = caption;
padre = _padre;
thumbReq = new URLRequest(thumb);
imgReq = new URLRequest(picture);
picldr.load(thumbReq);
this.addChild(picldr);
padre.addChild(this);
this.buttonMode = true;
this.addEventListener(MouseEvent.CLICK, onClick);
this.addEventListener(MouseEvent.ROLL_OVER, thumbRollOver);
this.addEventListener(MouseEvent.ROLL_OUT, thumbRollOut);
}
private function onClick(event:MouseEvent):void{
padre.big_pic.load(imgReq);
padre.big_pic.x = -175;
padre.big_pic.y = -125;
}
private function thumbRollOver(event:MouseEvent):void{
}
private function thumbRollOut(event:MouseEvent):void{
}
}
}//package
Section 192 (1.25 KiB) ●
//Trap (Trap)
package {
public class Trap extends Disparable {
public var radioEfecto:int;
public var radioEfectoSquared:int;
public var listaDeEnemigos:ListaEnlazada;
public function Trap(type:int, x:Number, y:Number){
super();
posicion = new Vector2D();
posicion.X = x;
posicion.Y = y;
switch (type){
case TrapMenu.BARREL_TRAP:
movieClip = new Barrel();
radio = (movieClip.width / 2);
energia = 1;
radioEfecto = 120;
break;
};
movieClip.x = posicion.X;
movieClip.y = posicion.Y;
radioEfectoSquared = (radioEfecto * radioEfecto);
radioSquared = (radio * radio);
}
override public function update():Boolean{
if (!movieClip.visible){
return (false);
};
return (true);
}
override public function sufrirDanyo(n:Number, tipo:int, empuje:Vector2D){
var otro:Disparable;
movieClip.visible = false;
otro = Disparable(listaDeEnemigos.primerObjeto);
while (otro != null) {
if (((otro.movieClip.visible) && (((((otro.posicion.X - posicion.X) * (otro.posicion.X - posicion.X)) + ((otro.posicion.Y - posicion.Y) * (otro.posicion.Y - posicion.Y))) < radioEfectoSquared)))){
otro.sufrirDanyo(5, tipo, null);
};
otro = Disparable(otro.sgte);
};
}
}
}//package
Section 193 (3.06 KiB) ●
//TrapMenu (TrapMenu)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class TrapMenu {
var level:CanvasScenario;
var turretIcon:MovieClip;
var levelUpIcon:MovieClip;
var player:Player;
var menu:MovieClip;
var selectedTrap:int;
var levelUpCost:TextField;
var main:MovieClip;
var selectedObject:MovieClip;
var barrelIcon:MovieClip;
public static const TURRET:int = -1;
public static const BARREL_TRAP:int = 1;
public function TrapMenu(main:MovieClip, level:CanvasScenario, player:Player){
var t:TextField;
super();
this.main = main;
this.main.stage.addEventListener(MouseEvent.MOUSE_MOVE, moverCursor);
this.main.stage.addEventListener(MouseEvent.MOUSE_UP, soltarObjeto);
this.level = level;
this.player = player;
menu = new Menu();
menu.y = 0;
menu.x = Canvas.APPLICATION_WIDTH;
main.addChild(menu);
barrelIcon = new Barrel();
barrelIcon.y = 30;
barrelIcon.x = (menu.width / 2);
menu.addChild(barrelIcon);
barrelIcon.addEventListener(MouseEvent.MOUSE_DOWN, barrelSelected);
t = Utils.getTextLabel(Parametros.CostoBarril.toString(), "center", 30, 20);
t.x = -5;
barrelIcon.addChild(t);
turretIcon = new PlayerMC();
turretIcon.y = 70;
turretIcon.x = (menu.width / 2);
menu.addChild(turretIcon);
turretIcon.addEventListener(MouseEvent.MOUSE_DOWN, turretSelected);
t = Utils.getTextLabel(Parametros.CostoBase.toString(), "center", 30, 20);
t.x = -5;
turretIcon.addChild(t);
levelUpIcon = new LevelUp();
levelUpIcon.x = (menu.width / 2);
levelUpIcon.y = ((Canvas.APPLICATION_HEIGHT - (levelUpIcon.height / 2)) - 5);
menu.addChild(levelUpIcon);
levelUpIcon.addEventListener(MouseEvent.CLICK, levelUpSelected);
levelUpCost = Utils.getTextLabel(Parametros.ParametrosPlayerPorNivel[2][4].toString(), "center", 30, 20);
levelUpCost.x = -5;
levelUpIcon.addChild(levelUpCost);
}
public function barrelSelected(e:MouseEvent){
selectedObject = new Barrel();
main.addChild(selectedObject);
selectedTrap = BARREL_TRAP;
}
public function soltarObjeto(e:MouseEvent){
var t:Trap;
if (selectedObject != null){
main.removeChild(selectedObject);
if (e.stageX < Canvas.APPLICATION_WIDTH){
if (selectedTrap > 0){
t = new Trap(selectedTrap, selectedObject.x, selectedObject.y);
level.addTrap(t);
} else {
level.addTurret(selectedObject.x, selectedObject.y);
};
};
selectedObject = null;
};
}
public function levelUpSelected(e:MouseEvent){
player.levelUp();
if ((player.nivel + 1) < Parametros.ParametrosPlayerPorNivel.length){
levelUpCost.text = Parametros.ParametrosPlayerPorNivel[(player.nivel + 1)][4].toString();
} else {
levelUpIcon.visible = false;
};
}
public function turretSelected(e:MouseEvent){
selectedObject = new PlayerMC();
main.addChild(selectedObject);
selectedTrap = TURRET;
}
public function moverCursor(e:MouseEvent){
if (selectedObject != null){
selectedObject.x = e.stageX;
selectedObject.y = e.stageY;
};
}
}
}//package
Section 194 (166 B)
//TreeMap (TreeMap)
package {
import flash.display.*;
public dynamic class TreeMap extends MovieClip {
public function TreeMap(){
super();
}
}
}//package
Section 195 (4.28 KiB) ●
//UICanvas (UICanvas)
package {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public dynamic class UICanvas extends MovieClip {
public var local_data:SharedObject;
public var soundSystem:SoundSystem;
public var insertNameWindow:InsertNameWindow;
public var secCounter:SecCounter;
public var gameSandBox:MovieClip;
public var scoreSystem:ScoreSystem;
public var specialContent:SpecialContent;
public var introCuatic:MovieClip;
var request:URLRequest;
var localConnection:LocalConnection;
public var main:MovieClip;
public var howToPlay:HowToPlay;
public var mainMenu:MainMenu;
public var achievesWindow:AchievesWindow;
public var kongregate;
public var achieveSystem:AchieveSystem;
public var welcomeWindow:WelcomeWindow;
public function UICanvas(value){
localConnection = new LocalConnection();
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4);
language.Language = 1;
kongregate = value;
scoreSystem = new ScoreSystem();
scoreSystem.padre = this;
scoreSystem.connectSystem();
soundSystem = new SoundSystem();
}
public function saveData(){
local_data.flush();
}
function frame2(){
addInsertName();
stop();
}
public function openData(value:String){
local_data = SharedObject.getLocal(("cuaticGames_RunnerDefense_" + value));
}
public function exitGame(value:Boolean){
var dific:int;
dific = main.canvasScenario.dificultad;
main.intervalo.stop();
this.removeChild(main);
main.canvasScenario = null;
main = null;
if (value == false){
addMainMenu();
} else {
newGame(dific);
};
}
function onCLick1(e:Event){
if (language.language_nr == "2"){
request = new URLRequest(language.url1);
} else {
request = new URLRequest((language.url1 + "&utm_content=logo_intro"));
};
navigateToURL(request, "_blank");
}
function onCLick2(e:Event){
if (language.language_nr == "2"){
request = new URLRequest(language.url1);
} else {
request = new URLRequest((language.url1 + "&utm_content=button_mainscreen_moregames"));
};
navigateToURL(request, "_blank");
}
public function addHowToPlay(){
howToPlay = new HowToPlay();
trace(howToPlay);
addChild(howToPlay);
howToPlay.x = 275;
howToPlay.y = 200;
howToPlay.padre = this;
howToPlay.enterWindow();
}
function onCLick4(e:Event){
if (language.language_nr == "2"){
request = new URLRequest(language.url1);
} else {
request = new URLRequest((language.url1 + "&utm_content=button_highscore_3000games"));
};
navigateToURL(request, "_blank");
}
function frame3(){
addMainMenu();
stop();
}
function frame4(){
stop();
}
function onCLick3(e:Event){
if (language.language_nr == "2"){
request = new URLRequest(language.url1);
} else {
request = new URLRequest((language.url1 + "&utm_content=button_gameover_moregames"));
};
navigateToURL(request, "_blank");
}
function frame1(){
addNewCounter("SplashScreen");
stop();
}
public function addSpecialContent(){
specialContent = new SpecialContent();
trace(specialContent);
addChild(specialContent);
specialContent.x = 275;
specialContent.y = 200;
specialContent.padre = this;
specialContent.enterWindow();
}
public function addMainMenu(){
mainMenu = new MainMenu(this);
addChild(mainMenu);
}
public function addAchieveWindow(){
achievesWindow = new AchievesWindow(this);
addChild(achievesWindow);
achievesWindow.x = 275;
achievesWindow.y = 200;
achievesWindow.initAchievements();
achievesWindow.enterWindow();
}
public function newGame(tipo:int){
main = null;
main = new Canvas();
main.padre = this;
this.addChild(main);
main.Load(tipo);
}
public function closeData(){
local_data.close();
}
public function addNewCounter(value:String){
secCounter = new SecCounter();
secCounter.nextScreen = value;
secCounter.padre = this;
addChild(secCounter);
}
public function addWelcomeWindow(){
welcomeWindow = new WelcomeWindow();
welcomeWindow.padre = this;
addChild(welcomeWindow);
welcomeWindow.enterWindow();
}
public function addInsertName(){
insertNameWindow = new InsertNameWindow(this);
insertNameWindow.padre = this;
addChild(insertNameWindow);
}
}
}//package
Section 196 (2.1 KiB) ●
//Utils (Utils)
package {
import flash.text.*;
public class Utils {
static var EPS:Number = 0.001;
public function Utils(){
super();
}
public static function getTextLabel(txt:String, align:String, width:int, height:int):TextField{
var t:TextField;
var format:TextFormat;
format = new TextFormat();
format.font = "Verdana";
format.color = 0xFFFFFF;
format.size = 12;
format.align = align;
t = new TextField();
t.defaultTextFormat = format;
t.selectable = false;
t.width = width;
t.height = height;
t.text = txt;
return (t);
}
public static function RayoCircunferencia(segment:Vector2D, a:Number, preC:Number, origin:Vector2D, centro:Vector2D, radioSquared:Number, interseccion:Vector2D):Boolean{
var b:*;
var c:Number;
var bb4ac:Number;
b = (2 * ((segment.X * (origin.X - centro.X)) + (segment.Y * (origin.Y - centro.Y))));
c = ((centro.X * centro.X) + (centro.Y * centro.Y));
c = (c + preC);
c = (c - (2 * ((centro.X * origin.X) + (centro.Y * origin.Y))));
c = (c - radioSquared);
bb4ac = ((b * b) - ((4 * a) * c));
if ((((Math.abs(a) < EPS)) || ((bb4ac < 0)))){
return (false);
};
return (true);
}
public static function ccw(p0x:Number, p0y:Number, p1x:Number, p1y:Number, p2x:Number, p2y:Number):int{
var dx1:Number;
var dx2:Number;
var dy1:Number;
var dy2:Number;
dx1 = (p1x - p0x);
dy1 = (p1y - p0y);
dx2 = (p2x - p0x);
dy2 = (p2y - p0y);
if ((dx1 * dy2) > (dy1 * dx2)){
return (1);
};
if ((dx1 * dy2) < (dy1 * dx2)){
return (-1);
};
if (((((dx1 * dx2) < 0)) || (((dy1 * dy2) < 0)))){
return (-1);
};
if (((dx1 * dx1) + (dy1 * dy1)) < ((dx2 * dx2) + (dy2 * dy2))){
return (1);
};
return (0);
}
public static function intersect(p0x:Number, p0y:Number, p1x:Number, p1y:Number, p2x:Number, p2y:Number, p3x:Number, p3y:Number):Boolean{
return (((((ccw(p0x, p0y, p1x, p1y, p2x, p2y) * ccw(p0x, p0y, p1x, p1y, p3x, p3y)) <= 0)) && (((ccw(p2x, p2y, p3x, p3y, p0x, p0y) * ccw(p2x, p2y, p3x, p3y, p1x, p1y)) <= 0))));
}
}
}//package
Section 197 (199 B)
//WaveHud (WaveHud)
package {
import flash.display.*;
public dynamic class WaveHud extends MovieClip {
public var waveBar:MovieClip;
public function WaveHud(){
super();
}
}
}//package
Section 198 (1.77 KiB) ●
//Vector2D (Vector2D)
package {
public class Vector2D {
public var y:Number;
public var x:Number;
public function Vector2D(){
super();
this.x = 0;
this.y = 0;
}
public function add(v:Vector2D){
this.x = (this.x + v.X);
this.y = (this.y + v.Y);
}
public function distanceTo(v:Vector2D):Number{
return (Math.sqrt((((this.x - v.X) * (this.x - v.X)) + ((this.y - v.Y) * (this.y - v.Y)))));
}
public function addAndAssign(v1:Vector2D, v2:Vector2D){
this.x = (v1.X + v2.X);
this.y = (v1.Y + v2.Y);
}
public function subAndAssign(v1:Vector2D, v2:Vector2D){
this.x = (v1.X - v2.X);
this.y = (v1.Y - v2.Y);
}
public function get Y():Number{
return (this.y);
}
public function dot(v:Vector2D):Number{
return ((((v.x * this.x) + v.y) + this.y));
}
public function length():Number{
var length_squared:Number;
length_squared = ((x * x) + (y * y));
return (Math.sqrt(length_squared));
}
public function equals(v:Vector2D):Boolean{
if ((((v.X == this.x)) && ((v.Y == this.y)))){
return (true);
};
return (false);
}
public function normalize(n:Number){
var len:Number;
len = this.length();
this.x = ((this.x / len) * n);
this.y = ((this.y / len) * n);
}
public function assign(v:Vector2D){
this.x = v.X;
this.y = v.Y;
}
public function set X(value:Number){
this.x = value;
}
public function set Y(value:Number){
this.y = value;
}
public function limitTo(ratio:Number){
if (ratio < 1){
this.x = (this.x * ratio);
this.y = (this.y * ratio);
};
}
public function squaredDistanceTo(v:Vector2D):Number{
return ((((this.x - v.X) * (this.x - v.X)) + ((this.y - v.Y) * (this.y - v.Y))));
}
public function get X():Number{
return (this.x);
}
}
}//package
Section 199 (2.58 KiB) ●
//WelcomeWindow (WelcomeWindow)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
public class WelcomeWindow extends MovieClip {
public var insertName:TextField;
public var counter:Number;// = 0
public var padre:UICanvas;
public var maxCount:Number;// = 5
public var skipIt:SimpleButton;
public var playerName:TextField;
public var level:TextField;
public var skipButton:SimpleButton;
public var newPlayer:Boolean;
public var achieveLevel:TextField;
public var achieveScore:TextField;
public var interval:Timer;
public var achievescore:TextField;
public function WelcomeWindow(){
counter = 0;
maxCount = 5;
achieveScore = new TextField();
achieveLevel = new TextField();
super();
addFrameScript(0, frame1, 1, frame2);
skipButton = skipIt;
playerName = insertName;
achieveScore = achievescore;
achieveLevel = level;
skipButton.addEventListener(MouseEvent.CLICK, skipClick);
skipButton.addEventListener(MouseEvent.ROLL_OVER, skipOver);
skipButton.addEventListener(MouseEvent.ROLL_OUT, skipOut);
x = 275;
y = 200;
alpha = 0;
interval = new Timer((1000 / 24), 0);
playerName.maxChars = 12;
}
function count(event:TimerEvent):void{
counter++;
if (counter >= maxCount){
interval.removeEventListener(TimerEvent.TIMER, count);
exitWindow();
};
}
public function skipOver(event:MouseEvent):void{
}
function fadeOut(event:TimerEvent):void{
alpha = (alpha - 0.1);
if (alpha <= 0){
interval.removeEventListener(TimerEvent.TIMER, fadeOut);
padre.gotoAndStop("MainMenu");
padre.removeChild(this);
};
}
public function skipClick(event:MouseEvent):void{
exitWindow();
}
function frame1(){
stop();
}
public function skipOut(event:MouseEvent):void{
}
public function changeFrame(){
gotoAndStop(2);
}
function exitWindow(){
interval.delay = (1000 / 24);
interval.addEventListener(TimerEvent.TIMER, fadeOut);
playerName.text = "";
}
function frame2(){
stop();
}
function fadeIn(event:TimerEvent):void{
alpha = (alpha + 0.1);
if (alpha >= 1){
interval.removeEventListener(TimerEvent.TIMER, fadeIn);
interval.delay = 1000;
interval.addEventListener(TimerEvent.TIMER, count);
playerName.text = padre.local_data.data.playerName;
};
}
function enterWindow(){
achieveScore.text = (padre.local_data.data.achieveScore + "");
achieveLevel.text = (padre.local_data.data.achieveLevel + "");
interval.addEventListener(TimerEvent.TIMER, fadeIn);
interval.start();
}
}
}//package