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 639219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T20:49:06+00:00 2026-05-13T20:49:06+00:00

In our school, it is common to build games as class projects in implementing

  • 0

In our school, it is common to build games as class projects in implementing the different concepts we learn from our computer science classes. Now we developed our games in our machine and everything seems to work fine, game speed is normal and so on. Now, when we try testing our games in our school’s computer, or when our professor test our games in his own computer, let’s say his computer is much powerful compare to the unit where we developed our games, the speed of the game changes dramatically… in most cases the game animation would happen so fast than expected. So my question, how do you prevent this kind of problem in game applications? And yeah, we use Java. We usually use passive rendering as the rendering technique in most applications that we built. tnx in advance!

  • 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-13T20:49:06+00:00Added an answer on May 13, 2026 at 8:49 pm

    You shouldn’t rely on the speed of rendering for your game logic. Instead, keep track of the time spent since the last logical step in the game to the current one. Then if the time spent has exceeded a certain amount, you execute a game step (in rare cases, where the computer is so slow that two steps should have happened, you may want to come up with a smart solution for making sure the game doesn’t lag behind).

    This way, game logic is separate from rendering logic, and you don’t have to worry about the game changing speeds depending on whether vertical sync is on or off, or if the computer is slower or faster than yours.

    Some pseudo-code:

    // now() would be whatever function you use to get the current time (in
    // microseconds or milliseconds).
    int lastStep = now();
    // This would be your main loop.
    while (true) {
        int curTime = now();
    
        // Calculate the time spent since last step.
        int timeSinceLast = curTime - lastStep;
    
        // Skip logic if no game step is to occur.
        if (timeSinceLast < TIME_PER_STEP) continue;
    
        // We can't assume that the loop always hits the exact moment when the step
        // should occur. Most likely, it has spent slightly more time, and here we
        // correct that so that the game doesn't shift out of sync.
        // NOTE: You may want to make sure that + is the correct operator here.
        //       I tend to get it wrong when writing from the top of my head :)
        lastStep = curTime + timeSinceLast % TIME_PER_STEP;
    
        // Move your game forward one step.
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 424k
  • Answers 424k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer cellForRowAtIndexPath: method is not provided by UITableView, that method is… May 15, 2026 at 12:06 pm
  • Editorial Team
    Editorial Team added an answer One way of solving this issue ( a non elegant… May 15, 2026 at 12:06 pm
  • Editorial Team
    Editorial Team added an answer I would not have thought that introducing a filter on… May 15, 2026 at 12:06 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.