home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
404 Jogos
/
CLJG.iso
/
Puzzle
/
casual_gameplay_escape.swf
/
scripts
/
DefineSprite_540_shotcontrol
/
frame_31
/
DoAction.as
Wrap
Text File
|
2008-09-05
|
13KB
|
389 lines
player = this._parent.player;
curspot = this._parent.player.currentspot;
object = this._parent.getInstanceAtDepth(curspot);
if(object.tempcooloff)
{
object.tempcooloff = false;
object = undefined;
}
level = this._parent.curlevel;
divisor = 29;
lasers = 0;
sl = 1;
while(sl <= 105)
{
objectsl = this._parent.getInstanceAtDepth(sl);
if(objectsl == this._parent["shotswitch" + sl])
{
if(objectsl.switched == true)
{
objectsl.laser();
lasers++;
}
}
sl++;
}
if(lasers > 0)
{
}
if(object.isswitch || this._parent.levels[this._parent.curlevel][curspot] == 2)
{
object = undefined;
}
if(this._parent.thwomp.going)
{
this._parent.thwomp._y = this._parent.pa[this._parent.thwomp.curposition][1];
if(this._parent.levels[lvl][this._parent.thwomp.curposition + 15] != 3 && this._parent.thwomp.curposition <= 105)
{
this._parent.thwomp.curposition += 15;
}
}
if(this._parent.thwomp.waitforcontrol)
{
this._parent.thwomp.going = true;
}
if(level == 1)
{
maxmod = 5;
}
if(level == 2)
{
maxmod = 10;
}
if(level == 3)
{
maxmod = 60;
}
if(player.dead != true)
{
this.onEnterFrame = undefined;
player._x = this._parent.pa[curspot][0];
player._y = this._parent.pa[curspot][1];
}
else if(this._parent.shotfader1._currentframe == 1)
{
this.started = false;
this.gotoAndStop(29);
if(player.fading)
{
if(level == 2)
{
this._parent._parent.trimask.play();
this._parent._parent._parent.slider2.play();
this._parent._parent._parent.al2.blinkmode = "flashgreen";
_root.slide2open = true;
_root.savedata();
}
if(level == 3)
{
this._parent._parent.trimask.play();
this._parent._parent._parent.slider3.play();
this._parent._parent._parent.al3.blinkmode = "flashgreen";
_root.slide3open = true;
_root.savedata();
}
if(level == 4)
{
this._parent._parent.trimask.play();
this._parent._parent._parent.slider1.play();
this._parent._parent._parent.slider2.play();
this._parent._parent._parent.slider3.play();
_root.slide1open = false;
_root.slide2open = false;
_root.slide3open = false;
this._parent._parent._parent.al1.blinkmode = "flashgreen";
this._parent._parent._parent.al2.blinkmode = "flashgreen";
this._parent._parent._parent.al3.blinkmode = "flashgreen";
_root.puzze8solved = true;
_root.savedata();
}
}
this._parent.shotfader1.play();
this._parent.shotfader2.play();
this._parent.shotfader3.play();
}
else if(this._parent.shotfader1._currentframe == 50)
{
this._parent.playin = false;
this._parent.levelspawn(level);
this.onEnterFrame = undefined;
}
this.shoot = function()
{
player.shoot();
object.tempcooloff = true;
};
this.goright = function()
{
player.facing = "right";
player._xscale = 100;
if(player.getDepth() != 106)
{
player.swapDepths(106);
player.onRelease = undefined;
}
if((curspot + 1) % 15 <= maxmod && this._parent.levels[level][curspot + 1] != 3 && this._parent.thwomp.curposition != curspot + 1 && this._parent.thwomp.curposition != curspot + 16)
{
bc = 1;
while(bc <= 7)
{
if(bc == 0)
{
}
if(this._parent.levels[level][curspot + 1 + bc * 15] == 3 || this._parent.thwomp.curposition == curspot + 1 + (bc + 1) * 15 || curspot + 1 + bc * 15 > 105)
{
oldspot = curspot;
curspot = curspot + 1 + (bc - 1) * 15;
if(this._parent.getInstanceAtDepth(curspot) == this._parent["shotdoor" + curspot])
{
this._parent["shotdoor" + curspot].door();
}
this.diff = bc;
bc = 8;
player.currentspot = curspot;
this.divx = (this._parent.pa[curspot][0] - this._parent.pa[oldspot][0]) / divisor;
this.divy = (this._parent.pa[curspot][1] - this._parent.pa[oldspot][1]) / divisor;
if(curspot == oldspot + 1)
{
if(!player.shotguy.running)
{
player.run();
}
this.onEnterFrame = function()
{
player._x += this.divx;
player._y += this.divy;
};
}
else
{
player.jump();
this.framecounter = 0;
this.onEnterFrame = function()
{
this.framecounter = this.framecounter + 1;
player._x += this.divx;
player._y = this._parent.pa[oldspot][1] + this.divy * framecounter - (8 * Math.pow(this.diff - 1,1.3200000000000003) + 12) * Math.sin(3.141592653589793 / divisor * this.framecounter);
};
}
}
bc++;
}
}
else
{
player.stand();
this.standcount = this.standcount + 1;
}
};
this.goleft = function()
{
player.facing = "left";
player._xscale = -100;
if((curspot - 1) % 15 != 0 && this._parent.levels[level][curspot - 1] != 3 && this._parent.thwomp.curposition != curspot - 1 && this._parent.thwomp.curposition != curspot + 14)
{
bc = 1;
while(bc <= 7)
{
if(bc == 0)
{
}
if(this._parent.levels[level][curspot - 1 + bc * 15] == 3 || this._parent.thwomp.curposition == curspot - 1 + (bc + 1) * 15 || curspot + 1 + bc * 15 > 105)
{
oldspot = curspot;
curspot = curspot - 1 + (bc - 1) * 15;
this.diff = bc;
bc = 8;
player.currentspot = curspot;
if(this._parent.getInstanceAtDepth(curspot) == this._parent["shotdoor" + curspot])
{
this._parent["shotdoor" + curspot].door();
}
this.divx = (this._parent.pa[curspot][0] - this._parent.pa[oldspot][0]) / divisor;
this.divy = (this._parent.pa[curspot][1] - this._parent.pa[oldspot][1]) / divisor;
if(curspot == oldspot - 1)
{
if(!player.shotguy.running)
{
player.run();
}
this.onEnterFrame = function()
{
player._x += this.divx;
player._y += this.divy;
};
}
else
{
player.jump();
this.framecounter = 0;
this.onEnterFrame = function()
{
this.framecounter = this.framecounter + 1;
player._x += this.divx;
player._y = this._parent.pa[oldspot][1] + this.divy * framecounter - (8 * Math.pow(this.diff - 1,1.3200000000000003) + 12) * Math.sin(3.141592653589793 / divisor * this.framecounter);
};
}
}
bc++;
}
}
else
{
player.stand();
this.standcount = this.standcount + 1;
}
};
this.jump = function()
{
if(player.facing == "left")
{
offset = -1;
}
else
{
offset = 1;
}
jumptype = 0;
if((this._parent.levels[level][curspot + offset] == 3 || this._parent.thwomp.curposition == curspot + offset + 15) && this._parent.thwomp.curposition != curspot + offset && this._parent.levels[level][curspot + offset - 15] != 3)
{
if(player.facing == "right" && (curspot + 1) % 15 <= maxmod || player.facing == "left" && curspot - 1 != 0 && (curspot - 1) % 15 != 0)
{
this.jumptype = 1;
}
else
{
player.stand();
this.standcount = this.standcount + 1;
}
}
if(this._parent.levels[level][curspot + offset] != 3 && this._parent.thwomp.curposition != curspot + offset + 15 && this._parent.levels[level][curspot + offset * 2] != 3 && this._parent.thwomp.curposition != curspot + offset * 2 + 15)
{
if(player.facing == "right" && (curspot + 1) % 15 <= maxmod || player.facing == "left" && curspot - 1 != 0 && (curspot - 1) % 15 != 0)
{
if(player.facing == "right" && (curspot + 2) % 15 <= maxmod || player.facing == "left" && curspot - 2 != 0 && (curspot - 2) % 15 != 0)
{
this.jumptype = 2;
}
else
{
if(player.facing == "right")
{
this.goright();
}
if(player.facing == "left")
{
this.goleft();
}
}
}
else
{
player.stand();
this.standcount = this.standcount + 1;
}
}
if(jumptype == 0)
{
if(player.facing == "right")
{
this.goright();
}
if(player.facing == "left")
{
this.goleft();
}
}
if(jumptype == 1)
{
oldspot = curspot;
this.curspot = this.curspot + offset - 15;
if(this._parent.getInstanceAtDepth(curspot) == this._parent["shotdoor" + curspot])
{
this._parent["shotdoor" + curspot].door();
}
player.currentspot = curspot;
this.divx = (this._parent.pa[curspot][0] - this._parent.pa[oldspot][0]) / divisor;
this.divy = (this._parent.pa[curspot][1] - this._parent.pa[oldspot][1]) / divisor;
player.jump();
this.framecounter = 0;
this.onEnterFrame = function()
{
this.framecounter = this.framecounter + 1;
player._x += this.divx;
player._y = this._parent.pa[oldspot][1] + this.divy * framecounter - 40 * Math.sin(3.141592653589793 / divisor * this.framecounter);
};
}
if(jumptype == 2)
{
bc = 1;
while(bc <= 7)
{
if(this._parent.levels[level][curspot + offset * 2 + bc * 15] == 3 || this._parent.thwomp.curposition == curspot + offset * 2 + (bc + 1) * 15 || curspot + offset * 2 + bc * 15 > 105)
{
oldspot = curspot;
curspot = curspot + offset * 2 + (bc - 1) * 15;
this.diff = bc;
bc = 8;
player.currentspot = curspot;
if(this._parent.getInstanceAtDepth(curspot) == this._parent["shotdoor" + curspot])
{
this._parent["shotdoor" + curspot].door();
}
this.divx = (this._parent.pa[curspot][0] - this._parent.pa[oldspot][0]) / divisor;
this.divy = (this._parent.pa[curspot][1] - this._parent.pa[oldspot][1]) / divisor;
player.jump();
this.framecounter = 0;
this.onEnterFrame = function()
{
this.framecounter = this.framecounter + 1;
player._x += this.divx;
player._y = this._parent.pa[oldspot][1] + this.divy * framecounter - (8 * Math.pow(this.diff - 1,1.3200000000000003) + 12) * Math.sin(3.141592653589793 / divisor * this.framecounter);
};
}
bc++;
}
}
};
if(player.dead != true)
{
if(this._parent.levels[level][curspot] == 1 || object == player && this.started != true || object == undefined || object == player && player.facing == "left")
{
if(object.arrowinner._currentframe == 1 || object == player && this.started != true || object == undefined && player.facing == "right")
{
this.started = true;
goright();
}
else if(object.arrowinner._currentframe == 2)
{
jump();
}
else if(object.arrowinner._currentframe == 3 || object == undefined && player.facing == "left" || object == player && player.facing == "left")
{
goleft();
}
else if(object.arrowinner._currentframe == 4)
{
shoot();
}
}
if(this._parent.levels[level][curspot] == 7 && object.isdoor && player.fading != true)
{
player.stand();
player.fadeout();
object.door();
}
else if(player.fading == true)
{
player.kill();
this._parent.curlevel += 1;
_root.curlevel = this._parent.curlevel;
_root.savedata();
}
if(this.standcount >= 3)
{
player.kill();
}
this.gotoAndPlay(2);
}