home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 108
/
jogo-disk-108.iso
/
Games
/
Titans
/
beastboy.swf
/
scripts
/
frame_15
/
DoAction.as
Wrap
Text File
|
2010-05-15
|
1KB
|
71 lines
r.nx = p._x;
r.ny = p._y;
sx1 = b[0].x1;
sx2 = b[0].x2;
sy1 = b[0].y1;
sy2 = b[0].y2;
var i = 1;
while(i < b.length)
{
if(b[i].x1 < sx1)
{
sx1 = b[i].x1;
}
if(b[i].x2 > sx2)
{
sx2 = b[i].x2;
}
if(b[i].y1 < sy1)
{
sy1 = b[i].y1;
}
if(b[i].y2 > sy2)
{
sy2 = b[i].y2;
}
i++;
}
xmin = sx1 + 50;
xmax = sx2 - 50;
ymin = sy1;
ymax = sy2;
sx1 = - sx1;
sx2 = - sx2 + 600;
sy1 = - sy1;
sy2 = - sy2 + 400;
m._x = r.cenx - r.nx;
m._y = r.ceny - r.ny;
onenterframe = function()
{
mxpos = r.cenx - r.nx;
mypos = r.ceny - r.ny;
mxnew = math.floor(mxpos + (m._x - mxpos) / 1.4);
mynew = math.floor(mypos + (m._y - mypos) / 1.4);
if(mxnew > r.sx1)
{
mxnew = r.sx1;
}
else if(mxnew < r.sx2)
{
mxnew = r.sx2;
}
if(mynew > r.sy1)
{
mynew = r.sy1;
}
else if(mynew < r.sy2)
{
mynew = r.sy2;
}
m._x = mxnew;
m._y = mynew;
if(r.inv > 0)
{
r.inv--;
}
if(r.nochange > 0)
{
r.nochange--;
}
};