home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mobiclic 162
/
MOBICLIC162.ISO
/
pc
/
DATA
/
GAM162
/
GAM162_00
/
GAM162_00.swf
/
scripts
/
gam162_00
/
CapsuleAlgo.as
< prev
next >
Wrap
Text File
|
2014-02-17
|
7KB
|
206 lines
package gam162_00
{
import com.milanpresse.engine.managers.PauseManager;
import gam162_00.engineaddons.facades.GameEngine;
import gam162_00.engineaddons.gamesprotos.Actor;
import gam162_00.engineaddons.gamesprotos.actors.actorClip.ActorClip;
public class CapsuleAlgo
{
private var game:GameEngine;
private var mainTimeline:ActorClip;
protected var currentLabelActorGroup:Actor;
private var testBox:TestBox;
private var actor:Actor;
private var actorClip:ActorClip;
private var comeFromGame:Boolean = false;
private var currentZoneNo:int = -1;
private var _pauseManager_:PauseManager;
private var contentIsSleeping:Boolean = false;
public var toWake:Array;
public function CapsuleAlgo()
{
this.toWake = [];
super();
this.game = Actor.game;
this.game.framerate = 24;
this.game.levelCZ = this.game.config.layers.content;
this.game.moduleConfig = new ModuleConfig(this.game.config.XmlConfig.Module.Config.Params);
this.testBox = new TestBox(this.game,this);
this.testBox.visible = false;
this.mainTimeline = this.game.addActor({
"code":"A_" + this.game.config.moduleName,
"parent":this.game.config.layers.content
});
this.mainTimeline.onLabelEnter = function(param1:* = null):void
{
var result:* = param1;
switch(result.label)
{
case "ATTENTE_01":
currentLabelActorGroup.addActor({
"type":ATTENTE_01,
"container":mainTimeline,
"infos":game.moduleConfig[result.label + "_CONFIG"],
"onEvent":function(param1:* = null):void
{
mainTimeline.gotoAndStop("FIN");
}
});
break;
case "FIN":
game.commentPlay({
"code":"FIN",
"callback":function():void
{
var lastScore:* = game.memo.getValue("MODULE.lastScore",0);
var record:* = game.memo.getValue("MODULE.record",0);
if(lastScore > record)
{
game.memo.setValue("MODULE.record",lastScore);
}
game.moduleConfig["ATTENTE_01_CONFIG"].comeFromEnd = true;
if(record == 0)
{
if(lastScore == 0)
{
game.commentPlay({
"code":"S3",
"callback":function():void
{
game.commentPlay({
"code":"N4",
"callback":function():void
{
mainTimeline.gotoAndStop("ATTENTE_01");
}
});
}
});
}
else
{
game.commentPlay({
"code":"N4",
"callback":function():void
{
mainTimeline.gotoAndStop("ATTENTE_01");
}
});
}
}
else if(lastScore > record)
{
game.commentPlay({
"code":"S1",
"callback":function():void
{
game.commentPlay({
"code":"N1",
"callback":function():void
{
mainTimeline.gotoAndStop("ATTENTE_01");
}
});
}
});
}
else
{
game.commentPlay({
"code":"S2",
"callback":function():void
{
game.commentPlay({
"code":"N2",
"callback":function():void
{
mainTimeline.gotoAndStop("ATTENTE_01");
}
});
}
});
}
}
});
}
};
this.mainTimeline.onLabelExit = function(param1:* = null):void
{
currentLabelActorGroup.destroyChildren();
};
this.mainTimeline.endMODULE = this.endMODULE;
this.currentLabelActorGroup = this.game.addActor(new Actor(this.game));
this.currentLabelActorGroup.name = "currentLabelActorGroup";
}
private function getLastZoneLabels(param1:int) : Object
{
var _loc2_:Object = {
"startLabel":"",
"endLabel":""
};
var _loc3_:int = 0;
while(_loc3_ < this.mainTimeline.currentLabels.length)
{
if(_loc2_.startLabel == "" && this.mainTimeline.currentLabels[_loc3_].name.search("^_0" + param1) != -1)
{
_loc2_.startLabel = this.mainTimeline.currentLabels[_loc3_].name;
}
else if(_loc2_.startLabel != "" && this.mainTimeline.currentLabels[_loc3_].name.search("^_0" + param1) == -1)
{
_loc2_.endLabel = this.mainTimeline.currentLabels[_loc3_ - 1].name;
return _loc2_;
}
_loc3_++;
}
return _loc2_;
}
public function start() : void
{
this.game.playMusic({"code":"MU"});
this.mainTimeline.gotoAndPlay("firstLabel");
}
public function endMODULE() : void
{
}
public function sleep() : void
{
this.toWake = [];
if(this.contentIsSleeping == false)
{
}
}
public function wake() : void
{
var _loc1_:int = 0;
while(_loc1_ < this.toWake.length)
{
this.toWake[_loc1_]();
_loc1_++;
}
}
public function destroy() : void
{
}
}
}