Why does my program stutter so much?

Posted by user36322 on Game Development See other posts from Game Development or by user36322
Published on 2014-05-31T18:46:30Z Indexed on 2014/05/31 22:05 UTC
Read the original article Hit count: 288

Filed under:
|

I've been very frustrated trying to solve this. I've looked it up, and all the answers are the same: set IsFixedTimeStep = false. This doesn't help me at all, the program is still jittery and stutters.

I have absolutely no idea what is going on, can you guys help?

Code for movement (objects is a list):

            speed = Math.Min(speed + (speedIncrement * gameTime.ElapsedGameTime.Milliseconds / 200), maxSpeed);
            for (int i = objects.Count - 1; i >= 0; i--)
            {
                objects[i].rect.Y += (int)(speed * gameTime.ElapsedGameTime.Milliseconds);
                //Check if the object is past the screen. If it is, remove it
                if (objects[i].rect.Y > screenHeight)
                {
                    objects.Remove(objects[i]);
                }
            }

© Game Development or respective owner

Related posts about XNA

Related posts about c#