home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 108
/
jogo-disk-108.iso
/
Games
/
Titans
/
beastboy.swf
/
scripts
/
DefineSprite_379
/
frame_7
/
DoAction.as
Wrap
Text File
|
2010-05-15
|
2KB
|
137 lines
if(r.pnow != 2)
{
changeto = 2;
cekb = cekbound(changeto);
if(cekb != 0)
{
gotoAndPlay(20);
}
}
else
{
d = 40;
r.vy = 0;
onenterframe = function()
{
r.xs = 0;
d--;
if(d > 0)
{
gojump = 0;
go = 2;
}
else if(d == 0)
{
gojump = 1;
}
else if(d < -20)
{
go = 0;
}
if(go == 1)
{
r.xs = - r.runspeed;
}
else if(go == 2)
{
r.xs = r.runspeed;
}
if(gojump)
{
if(r.canjump and !r.jump)
{
r.vy = r.jumpforce;
r.jump = 1;
r.canjump = 0;
r.onfloat = 0;
}
}
r.nx = p._x + r.xs;
r.ny = p._y;
if(r.nx < r.xmin)
{
r.nx = r.xmin;
}
else if(r.nx > r.xmax)
{
r.nx = r.xmax;
}
if(r.ny < r.ymin)
{
r.ny = r.ymin;
}
else if(r.ny > r.ymax)
{
r.ny = r.ymax;
}
r.x1 = r.nx - r.pw;
r.x2 = r.nx + r.pw;
r.y1 = r.ny - r.ph;
r.y2 = r.ny;
cekstep();
if(r.xs > 0)
{
r.hd = 1;
cekright(r.pbumper[r.pnow]);
}
else if(r.xs < 0)
{
r.hd = 2;
cekleft(r.pbumper[r.pnow]);
}
if(r.jump)
{
r.vy += r.grav / 10;
if(r.vy < 0)
{
up = cekup();
}
else
{
down = cekdown();
}
}
if(r.jump)
{
r.ny = p._y + r.vy / 10;
if(r.vy < 0)
{
if(r.ny - r.ph < up)
{
r.ny = up + r.ph + 0.1;
r.jump = 1;
r.vy = 0;
}
}
else if(r.ny > down)
{
if(r.floatbelow != 0)
{
r.onfloat = r.floatbelow;
}
r.ny = down;
r.jump = 0;
r.vy = 0;
r.canjump = 1;
gojump = 0;
}
}
p._x = r.nx;
p._y = r.ny;
if(r.jump)
{
r.sta = "jump";
}
else if(r.xs != 0)
{
r.sta = "run";
}
else
{
r.sta = "stand";
}
p.gotoAndStop(r.sta + r.hd);
};
}
stop();