Posted: Mon Apr 16, 2007 6:50 pm
Of Course I Love Jesus! (His Father Too!) He helps me get up every morning! (That and lots and lots of coffie! lol j/k)
Code: Select all
{
WALK [Walk] // define the walking animation in a variable
IDLE [Idle] // define the walking animation in a variable
MOVESPEED [100] // define the speed of this Pawn in a variable
Spawn[ ()
{
Console(true); //enable console for debugging
LowLevel("setup"); // Go to low level
} ]
setup[ ()
{
self.ThinkTime = 0.1;
PlayerRender(false); // Don't render the built-in player
AttachCamera(); // attach the camera to this entity
self.yaw_speed = 99999999; // Rotate VERY fast
AnimateHold(IDLE);
self.think = "loop"; // Start executing order called "loop"
} ]
loop[ ()
{
self.ThinkTime = 0; // execute this order every frame
if(IsKeyDown(15)) // Check if key number 15 is pressed
{
self.ideal_yaw=ConvertDegrees(0);
ChangeYaw();
walkmove(self.current_yaw,MOVESPEED); // move forward
if(self.animate_at_end) // check if the current animation is finished before starting a new one
{
AnimateHold(WALK); // play the walking animation
}
}
if(IsKeyDown(27)) // Check if key number 27 is pressed
{
self.ideal_yaw=ConvertDegrees(180);
ChangeYaw();
walkmove(self.current_yaw,MOVESPEED); // move down
if(self.animate_at_end) // check if the current animation is finished before starting a new one
{
AnimateHold(WALK); // play the walking animation
}
}
if(IsKeyDown(26)) // Check if key number 26 is pressed
{
self.ideal_yaw=ConvertDegrees(270);
ChangeYaw();
walkmove(self.current_yaw,MOVESPEED); // move left
if(self.animate_at_end) // check if the current animation is finished before starting a new one
{
AnimateHold(WALK); // play the walking animation
}
}
if(IsKeyDown(28)) // Check if key number 28 is pressed
{
self.ideal_yaw=ConvertDegrees(90);
ChangeYaw();
walkmove(self.current_yaw,MOVESPEED); // move right
if(self.animate_at_end) // check if the current animation is finished before starting a new one
{
AnimateHold(WALK); // play the walking animation
}
}
else // if the key is not pressed...
{
if(self.animate_at_end) // play idle animation, if it is at end
{
AnimateHold(IDLE);
}
}
} ]
}