Following an actor (Catterpillar Script)
Posted: Tue Mar 20, 2007 6:47 pm
This is a catterpillar script, the download is in my second message
Game Editor discussion board
http://game-editor.com/forum/
char *key=GetKeyState();
if (key[KEY_UP] == 1 && key[KEY_DOWN] == 0)
{
ChangeAnimation("Event Actor", "U............", FORWARD);
}
if (key[KEY_RIGHT] == 1 && key[KEY_LEFT] == 0)
{
ChangeAnimation("Event Actor", "Wingingiliki", FORWARD);
}
if (key[KEY_RIGHT] == 1 && key[KEY_LEFT] == 0 && key[KEY_UP] == 1)
{
ChangeAnimation("Event Actor", "U............", FORWARD);
}
if (key[KEY_DOWN] == 1 && key[KEY_UP] == 0)
{
ChangeAnimation("Event Actor", "WINGIHIIIIIIII.", FORWARD);
}
if (key[KEY_DOWN] == 1 && key[KEY_UP] == 0 && key[KEY_RIGHT] == 1)
{
ChangeAnimation("Event Actor", "Wingingiliki", FORWARD);
}
if (key[KEY_LEFT] == 1 && key[KEY_RIGHT] == 0)
{
ChangeAnimation("WNRIHIHIHIHIHIHIHIHI", "RINGIHIHIHIHIHIHIHIHI.", FORWARD);
}
if (key[KEY_RIGHT] == 1 && key[KEY_LEFT] == 0 && key[KEY_UP] == 1)
{
ChangeAnimation("Event Actor", "U............", FORWARD);
}
if (key[KEY_LEFT] == 1 && key[KEY_RIGHT] == 0 && key[KEY_UP] == 1)
{
ChangeAnimation("Event Actor", "U............", FORWARD);
}
if (key[KEY_RIGHT] == 1 && key[KEY_LEFT] == 1)
{
ChangeAnimation("Event Actor", "RINGIHIHIHIHIHIHIHIHI.", FORWARD);
}
char*key=GetKeyState();
yvelocity += 1;
if(SLASH == 0)
{
if(key[KEY_LEFT] == 1 && key[KEY_RIGHT] == 0)
{
gs = 0;
if(j == 0)x -= 5;
if(j == 1 && xvelocity > - 5 && hw == 0)xvelocity -= 1;
if(af == 1 && key[KEY_DOWN] == 0 && j == 0)
{
ChangeAnimation("Event Actor", "WL", FORWARD);
af = 0;
}
if(af == 1 && key[KEY_DOWN] == 0 && j == 1)
{
ChangeAnimation("Event Actor", "JL", FORWARD);
af = 0;
}
if(af == 1 && key[KEY_DOWN] == 1 && j == 0)
{
ChangeAnimation("Event Actor", "CL", FORWARD);
af = 0;
}
}
if(key[KEY_LEFT] == 0 && key[KEY_RIGHT] == 1)
{
gs = 1;
if(j == 0)x += 5;
if(j == 1 && xvelocity < 5 && hw == 0)xvelocity += 1;
if(af == 1 && key[KEY_DOWN] == 0 && j == 0)
{
ChangeAnimation("Event Actor", "WR", FORWARD);
af = 0;
}
if(af == 1 && key[KEY_DOWN] == 0 && j == 1)
{
ChangeAnimation("Event Actor", "JR", FORWARD);
af = 0;
}
if(af == 1 && key[KEY_DOWN] == 1 && j == 0)
{
ChangeAnimation("Event Actor", "CR", FORWARD);
af = 0;
}
}
}
if(key[KEY_UP] == 1 && j == 0 && SLASH < 2)
{
if(gs == 0)ChangeAnimation("Event Actor", "JL", FORWARD);
if(gs == 1)ChangeAnimation("Event Actor", "JR", FORWARD);
PlaySound2("data/jump2.wav", 0.555556, 1, 0.000000);
yvelocity = - 15;
j = 1;
}
if(key[KEY_SPACE] == 1 && SLASH == 0 && j == 0)
{
PlaySound2("data/Swipe1.wav", 0.211111, 1, 0.000000);
if(gs == 0)ChangeAnimation("Event Actor", "SLL", FORWARD);
if(gs == 1)ChangeAnimation("Event Actor", "SLR", FORWARD);
SLASH = 1;
}
if(key[KEY_SPACE] == 1 && SLASH == 0 && j == 1)
{
PlaySound2("data/Swipe1.wav", 0.211111, 1, 0.000000);
if(gs == 0)ChangeAnimation("Event Actor", "!JLSpiral", FORWARD);
if(gs == 1)ChangeAnimation("Event Actor", "!JRSpiral", FORWARD);
SLASH = 1;
}
if(SLASH == 2 && animpos > 3)
{
if(gs == 0)ChangeAnimation("Event Actor", "SL", FORWARD);
if(gs == 1)ChangeAnimation("Event Actor", "SR", FORWARD);
SLASH = 0;
}
if(yvelocity > 4)j = 1;
if(yvelocity < -3)j = 1;
if(Health <= 0)
{
Life_Count -= 1;
PlaySound2("data/click.wav", 0.255556, 4, 0.066667);
x = Spawnpoint.x;
y = Spawnpoint.y;
Health = 18;
CreateActor("effect1", "Effect2", "(none)", "(none)", 0, 0, false);
}
if(Life_Count < 0)
{
directional_velocity = 0;
SLASH = -1;
transp = .999;
ChangeAnimationDirection("Event Actor", STOPPED);
}
if(sentryCount.textNumber == 0)
{
if(distance(xscreen, yscreen, portal.xscreen, portal.yscreen) < 400)
{
if(yscreen < portal.yscreen)yvelocity += 1;
if(yscreen > portal.yscreen)yvelocity -= 2;
if(xscreen > portal.xscreen)xvelocity -= 1;
if(xscreen < portal.xscreen)xvelocity += 1;
}
}
if(key[KEY_LEFT] == 1 && key[KEY_RIGHT] == 1)
{
if(gs == 1 && af == 1)
{
ChangeAnimation("Event Actor", "SR", FORWARD);
}
if(gs == 0 && af == 1)
{
ChangeAnimation("Event Actor", "SL", FORWARD);
}
}