I've been learning for some time to use the scripts and came to a problem that is difficult to fix me, because I'm not very good with this.
I'm trying to make a player script that Abanse, turn to walk back and jump, just like a platform game (mario bros, Castelvania.). so far I have this:
Code: Select all
{
//Variables declaradas
DIR[0]
VEL[0]
ANC[0]
FuerzaSalto[0]
VELSALTO[0]
//Orden INICIO
Inicio[()
{
Console(true);
SetAttribute("salud", 100, "Jugador");
AttributeOrder("salud", 100, "Muere");
SetGroup("Smash");
LowLevel("Normal");
}]
//Orden NORMAL
Normal[()
{
walkmove(self.current_yaw+DIR, VEL);
self.yaw_speed=9999;
ChangeYaw();
PlayerRender(false);
if(IsKeyDown(26))
{
if(ANC="Walk")
{
if(self.animate_at_end)
{
Animate("Walk");
}
ChangeYaw();
DIR= ConvertDegrees(0);
VEL=70;
}
else
{
ANC="Walk";
AnimateBlend("Walk",0.5);
ChangePitch(self.ideal_pitch=180);
DIR=ConvertDegrees(0);
VEL=70;
}
//Movimiento ATRAS
}
if(IsKeyDown(28))
{
if(ANC="Walk")
{
if(self.animate_at_end)
{
Animate("Walk");
}
ChangeYaw();
DIR= ConvertDegrees(180);
VEL=70;
}
else
{
ANC="Walk";
AnimateBlend("Walk",0.5);
ChangeYaw();
DIR=ConvertDegrees(180);
VEL=70;
}
}
if(((IsKeyDown(15))=false)and((IsKeyDown(26))=false)and
((IsKeyDown(27))=false)and((IsKeyDown(28))=false))
{
if(ANC="Idle")
{
if(self.animate_at_end)
{
Animate("Idle");
}
DIR=0;
VEL=0;
}
else
{
ANC="Idle";
AnimateBlend("Idle",0.5);
}
DIR=0;
VEL=0;
}
}
}]
}
if(IsKeyDown(26))
{
if(ANC="Walk")
{
if(self.animate_at_end)
{
Animate("Walk");
}
VEL=70;
DIR=0;
}
else
{
ANC="Walk";
AnimateBlend("Walk",0.5);
VEL=70;
DIR=0;
}
http://img186.imageshack.us/img186/3305/frontbackq.jpg
But this script only allows the character to walk forward and walk back, but does not turn back.
I have trouble understanding how to do this. thank you very much in advance that I want to help.
"Hasta la vista!"