home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
404 Jogos
/
CLJG.iso
/
Aventura
/
pendekar.swf
/
scripts
/
DefineSprite_448_challenge02
/
frame_1
/
DoAction.as
Wrap
Text File
|
2006-05-08
|
4KB
|
185 lines
function init()
{
if(runOnce)
{
return undefined;
}
this.runOnce = true;
trace("> Initializing Challenge 02...");
tellTarget(_parent)
{
setStage("Boss Keroyokan",400,"flr_cement","env_arena","bg_mountain02");
addPlayer(_root.player1);
if(_root.music)
{
music = new Sound();
music.attachSound("music08.wav");
music.start(0,9999);
}
registerObject("oPole",100);
}
}
function checkPoint(cp)
{
_parent.isScroll = false;
switch(cp)
{
case 0:
pack01();
break;
case 1:
boss();
break;
case 2:
pack03();
break;
case 3:
pack04();
break;
case 4:
boss();
break;
default:
trace("err: Checkpoint not specified!");
}
}
function pack01()
{
tellTarget(_parent)
{
if(bodyCount == 0)
{
spawnObject("eThug01",stageWidth - 20);
}
else if(bodyCount == 1)
{
spawnObject("eThug01",stageWidth - 20);
spawnObject("eThug01",stageWidth - 20);
}
else if(bodyCount == 3)
{
spawnObject("eThug01",stageWidth - 20);
spawnObject("eThug01",20);
}
else if(bodyCount >= 5)
{
hud.goSign.play();
bodyCount = 0;
isScroll = true;
stageLength += 800;
cp++;
}
}
}
function pack02()
{
tellTarget(_parent)
{
if(bodyCount == 0)
{
spawnObject("eThug01",stageWidth - 20);
}
else if(bodyCount == 1)
{
spawnObject("eThug01",stageWidth - 20);
spawnObject("eThug01",stageWidth - 20);
}
else if(bodyCount == 3)
{
spawnObject("eThug01",stageWidth - 20);
spawnObject("eThug01",20);
}
else if(bodyCount >= 5)
{
hud.goSign.play();
bodyCount = 0;
isScroll = true;
stageLength += 800;
cp++;
}
}
}
function pack03()
{
tellTarget(_parent)
{
if(bodyCount == 0)
{
spawnObject("eThug01",stageWidth - 20);
}
else if(bodyCount == 1)
{
spawnObject("eThug01",stageWidth - 20);
spawnObject("eThug01",stageWidth - 20);
}
else if(bodyCount == 3)
{
spawnObject("eThug01",stageWidth - 20);
spawnObject("eThug01",20);
}
else if(bodyCount >= 5)
{
hud.goSign.play();
bodyCount = 0;
isScroll = true;
stageLength += 800;
cp++;
}
}
}
function pack04()
{
tellTarget(_parent)
{
if(bodyCount == 0)
{
spawnObject("eThug01",stageWidth - 20);
}
else if(bodyCount == 1)
{
spawnObject("eThug01",stageWidth - 20);
spawnObject("eThug01",stageWidth - 20);
}
else if(bodyCount == 3)
{
spawnObject("eThug01",stageWidth - 20);
spawnObject("eThug01",20);
}
else if(bodyCount >= 5)
{
hud.goSign.play();
bodyCount = 0;
isScroll = true;
stageLength += 800;
cp++;
}
}
}
function boss()
{
tellTarget(_parent)
{
if(bodyCount == 0)
{
dimmer.dim(50);
dimmer.lock = true;
hud.bossSign.play();
if(_root.music)
{
music.stop("music08.wav");
music.attachSound("music07.wav");
music.start(0,9999);
}
spawnObject("eJagoan01",stageWidth - 20);
}
else if(bodyCount == 1)
{
bodyCount = 0;
music.stop("music07.wav");
_root.movieName = "stageClear";
_root.gotoAndStop("movies");
}
}
}
this.onLoad = init();