if(my.state == 12) //Obilicleon Wall-Running
{
while(key_enter || joy_3)
wait(1);
while(my.state == 12)
{
while((dash<100) && WallRunning == 0)
{
dash += 10 * time_step;
my.animation = 75; //75% animation frame is run3
ent_animate(me, "run", my.animation, 0);
c_move(me, vector(dash*time_step, 0, 0), vector(0, 0, -distancedown), USE_POLYGON |IGNORE_PASSABLE);
if((dash > 100) && (hit.nx != 0))
{
dash = 0; my.animation = 0; WallRunning = 1;
my.roll += 90; //temporary. Will replace with code to orient model to normal of hit surface
CameraChaseWallRun(me);
}
else if((dash>100) && hit.nx == 0)
{my.state = 3;} //state that waits for button release before reverting to state 1
wait(1);
}
....rest of wall-run state code
}
}