home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 35
/
jogo-disk-35.iso
/
Games
/
red_beard.swf
/
scripts
/
DefineSprite_115
/
frame_1
/
DoAction.as
Wrap
Text File
|
2007-02-27
|
3KB
|
75 lines
if(startup == null)
{
starty = _Y - 1;
startup = "done";
}
if(eval("_root.codeMC:colourActive") == "blue" or eval("_root.codeMC:blueSwitch") == "on")
{
if(_Y > starty)
{
direction = -1;
}
if(_Y < starty - 100)
{
direction = 1;
}
_Y = _Y + direction;
}
if(getProperty("_root.BackgroundMC", _X) + _X > 0 and getProperty("_root.BackgroundMC", _X) + _X < 450 and getProperty("_root.BackgroundMC", _Y) + _Y > 0 and getProperty("_root.BackgroundMC", _Y) + _Y < 300)
{
if(eval("_root.codeMC:state") != "dead")
{
range = 10;
if(getProperty("_root.playerMC", _Y) > _Y + getProperty("_root.BackgroundMC", _Y) - range and getProperty("_root.playerMC", _Y) < _Y + getProperty("_root.BackgroundMC", _Y) + range)
{
inRange = "on";
}
else
{
inrange = "off";
}
if(getProperty("_root.playerMC", _Y) < _Y + getProperty("_root.BackgroundMC", _Y) and getProperty("_root.playerMC", _Y) + eval("_root.CodeMC:fallspeed") > _Y + getProperty("_root.BackgroundMC", _Y))
{
yCollision = "on";
}
else
{
yCollision = "off";
}
if(getProperty("_root.playerMC", _X) > _X + getProperty("_root.BackgroundMC", _X) and getProperty("_root.playerMC", _X) < _X + _width + getProperty("_root.BackgroundMC", _X))
{
xCollision = "on";
}
else
{
xCollision = "off";
}
if(inRange == "on" and xCollision == "on")
{
if(collision != "on")
{
set("_root.CodeMC:platformActive",eval("_root.CodeMC:platformActive") + 1);
}
collision = "on";
set("_root.CodeMC:currentGround",_Y + getProperty("_root.BackgroundMC", _Y));
setProperty("_root.playerMC", _Y, _Y + getProperty("_root.BackgroundMC", _Y));
if(getProperty("_root.playerMC", _Y) > eval("_root.codeMC:scrollPointLower"))
{
setProperty("_root.backgroundMC", _Y, getProperty("_root.backgroundMC", _Y) - getProperty("_root.playerMC", _Y) + eval("_root.codeMC:scrollPointLower"));
}
if(getProperty("_root.playerMC", _Y) < eval("_root.codeMC:scrollPointUpper"))
{
setProperty("_root.backgroundMC", _Y, getProperty("_root.backgroundMC", _Y) - getProperty("_root.playerMC", _Y) + eval("_root.codeMC:scrollPointUpper"));
}
}
else if(collision == "on")
{
if(inRange == "off" or xCollision == "off")
{
set("_root.CodeMC:platformActive",eval("_root.CodeMC:platformActive") - 1);
collision = "off";
}
}
}
}