because of bullet missing enemy..etc
...
now when the actor is walking every 3 seconds or so he speeds up then slows down
and on top of that when he jumps he jumps higher and faster so ifyou keep jumping you will eventually jump past the screen and die. lol
help?
here is my actor script..
- Code: Select all
char*key=GetKeyState();
int spd = 5;
yvelocity += gravity;
if(damage > 100)DestroyActor("Event Actor");
if(wt > 0)wt--;
else
if(key[KEY_LEFT] == 1 && key[KEY_RIGHT] == 0)
{
if(j == 0 && xvelocity > -spd)xvelocity--;
if(j == 1)x -= spd;
if(ld == 1)
{
ld = 0;
af = 1;
}
if(af == 1)
{
ChangeAnimation("Event Actor", "RANDAL- pistols left walk 1", FORWARD);
af = 0;
}
}
if(key[KEY_LEFT] == 0 && key[KEY_RIGHT] == 1)
{
if(j == 0 && xvelocity < spd)xvelocity++;
if(j == 1)x += spd;
if(ld == 0)
{
ld = 1;
af = 1;
}
if(af == 1)
{
ChangeAnimation("Event Actor", "RANDAL- pistols right walk 1", FORWARD);
af = 0;
}
}
if(key[KEY_LEFT] == 0 && key[KEY_RIGHT] == 0)
{
af = 1;
if(ld == 0)ChangeAnimation("Event Actor", "RANDAL pistol left", FORWARD);
else ChangeAnimation("Event Actor", "RANDAL pistol right", FORWARD);
}
if(key[KEY_LEFT] == 1 && key[KEY_RIGHT] == 1)
{
af = 1;
if(ld == 0)ChangeAnimation("Event Actor", "RANDAL pistol left", FORWARD);
else ChangeAnimation("Event Actor", "RANDAL pistol right", FORWARD);
}
if(j == 1 && key[KEY_z] == 1)
{
if(key[KEY_LEFT] == 1)xvelocity = -spd;
if(key[KEY_RIGHT] == 1)xvelocity = spd;
yvelocity = -(gravity * 13);
j = 0;
}