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

  • SEARCH
  • Home
  • 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 589325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:24:45+00:00 2026-05-13T15:24:45+00:00

I understand why it does that but I don’t really have any idea of

  • 0

I understand why it does that but I don’t really have any idea of how to prevent that. So the scenario is, every frame I move the car by a certain of predefined pixels. What happens is when I go on slow or faster computer… well I get less or more frames per seconds so the car moves either slower or faster. I was wondering how I could prevent that.

I suspect that I would have the same problem using any library… This is my first time doing real time stuff like that.

  • 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-05-13T15:24:45+00:00Added an answer on May 13, 2026 at 3:24 pm

    I suspect your current code looks somehow like this

     // to be called every frame
     void OnEveryFrame()
     {
         MoveCar();
         DrawCarToScreen();
     }
    

    But it should be like this:

     // to be called - for example - 50 times per second:
     void OnEveryTimerEvent()
     {
         MoveCar();
     }
    
     // to be called every frame
     void OnEveryFrame()
     {
         LockTimerEvents();
         DrawCarToScreen();
         UnlockAndProcessOutstandingTimerEvents();
     }
    

    You have to set up an according timer event, of course.

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

Sidebar

Related Questions

Does anyone have any experience in using compression on their cached data? I understand
I have some Haskell code that does work correctly on an infinite list, but
I understand the Android OS is based on Linux. Does that mean the G1
Which algorithm does the JavaScript Array#sort() function use? I understand that it can take
I don’t think I’ve grokked currying yet. I understand what it does, and how
I understand what System.WeakReference does, but what I can't seem to grasp is a
I don't understand, why does the following regular expression: ^*$ Match the string 127.0.0.1?
In my code, I use a regexp I googled somewhere, but I don't understand
I don't understand how using a 'challenge token' would add any sort of prevention:
I am aware that System.Threading.Timer exists, but I already have a Thread. This thread

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.