Page 1 of 1

shouldn't this work?

PostPosted: Sat Jan 23, 2010 6:45 pm
by Hblade
Okay My variables are: speed, anim_s, and the original real_fps. What I'm trying to do is... if you have a higher number, for example 6, the animpos will add faster, not slower. For example heres the code
Code: Select all
void WalkAnim(int anim_s, int d)
{
speed = round(real_fps) - anim_s;
    if (d == up)
    {
        temp_up++;
        if (t1 == 0)
        {
            ChangeAnimation("Event Actor", "walking_up", STOPPED);
            t1 = 1;
        }
        if (temp_up == speed)
        {
            animpos++;
            temp_up = 0;
        }
        if (animpos == 4)
        {
            animpos = 0;
            temp_up = 0;
        }
    }
}


But it just freezes the animpos O.o

Re: shouldn't this work?

PostPosted: Sat Jan 23, 2010 7:08 pm
by DST
well for starters, your real_fps can change.

one frame, speed is 4 and temp up is 3. temp_up++;
next frame, speed is 3 and temp_up is 4, temp_up++;
now temp_up is 5 and speed won't reach that. because speed can be less, but never more than your preset fps.

Re: shouldn't this work?

PostPosted: Sat Jan 23, 2010 7:39 pm
by Hblade
Solved :D