shouldn't this work?

Non-platform specific questions.

shouldn't this work?

Postby Hblade » Sat Jan 23, 2010 6:45 pm

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
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: shouldn't this work?

Postby DST » Sat Jan 23, 2010 7:08 pm

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.
It's easier to be clever than it is to be kind.
http://www.lostsynapse.com
http://www.dstgames.com
User avatar
DST
 
Posts: 1117
Joined: Sun Apr 15, 2007 5:36 pm
Location: 20 minutes into the future
Score: 151 Give a positive score

Re: shouldn't this work?

Postby Hblade » Sat Jan 23, 2010 7:39 pm

Solved :D
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron