Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7802285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T01:13:05+00:00 2026-06-02T01:13:05+00:00

I unlimited the frames per second in my game by doing. graphics.SynchronizeWithVerticalRetrace = false;

  • 0

I unlimited the frames per second in my game by doing.

graphics.SynchronizeWithVerticalRetrace = false;
IsFixedTimeStep = false;

But now my sprite/player moves WAY faster then it did before. I don’t know why it does this, and I am not sure how to fix it.

if (keyboard.IsKeyDown(Keys.W) || keyboard.IsKeyDown(Keys.Up))
{
    position.Y -= spd;
}
if (keyboard.IsKeyDown(Keys.A) || keyboard.IsKeyDown(Keys.Left))
{
    position.X -= spd;
}
if (keyboard.IsKeyDown(Keys.S) || keyboard.IsKeyDown(Keys.Down))
{
    position.Y += spd;
}
if (keyboard.IsKeyDown(Keys.D) || keyboard.IsKeyDown(Keys.Right))
{
    position.X += spd;
}

That is currently how I am getting the sprite to move. spd = 4 at the moment. It worked perfectly fine, but now it seems as if it is moving like 2000 times faster. Just taping one of the keys takes him off screen.

Any and all help will be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T01:13:07+00:00Added an answer on June 2, 2026 at 1:13 am

    The game loop in XNA is based around update and draw. Fixed time step also refers to update, so by setting that to false, you are telling update to be called as often as possible. As your code is in the update function, its being called more than the default, fixed 60 times per second.

    rather than just using spd, change it to

    spd * (gameTime.ElapsedGameTime.Milliseconds / 16);
    

    That will change it so that the spd is scaled by the elapsed time. The 16 is the number of milliseconds an update takes at 60 fps (approx) which is what your spd value is currently working at.

    EDIT: For not part of Game.cs:

    Have an update on the class you are interested in moving (Im going to call it Ship, but it could be anything you want)

    class Ship
    {
      public void Update(GameTime gameTime)
      {
        ...
        position.Y += spd * (gameTime.ElapsedGameTime.Milliseconds / 16);
        ...
      }
      ..
    }
    

    Then in the Game.cs file:

    public override Update(GameTime gameTime)
    {
      myShip.Update(gameTime);
      ...
    }
    

    myShip being the variable for the class of the sprite you want to move. Note update is no longer overriding a base method, so the call to base.Update is also gone

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

BitBucket now states that they offer unlimited repositories (Git and Mercurial) with the only
So I stumbled upon this "new" graphics engine/technology called Unlimited Detail . This seems
is there any example that shows a asteroid like game with unlimited enemy/asteroids spawning?
Is there a free SMTP server to send unlimited emails per day?
I'm in a loop to display products... 4 per row, unlimited rows' I need
I have this code that edits addresses in a game to get unlimited ammo
I Declare an 2D Unlimited array. My code: Dim array As String(,) = New
Looking to nest (to unlimited levels) elements in XML. Like so: <items> <item> <name>Item
I have an array made of unlimited number of objects. These objects have the
How i can convert this array to an UNLIMITED range array? Dim multiArray(2, 2)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.