Game won't wait...

I wanted to make sure my game was actually setting the frame rate so I set it to 1 fps...but...it still goes at what it's always done...it waits initially (first key press) and then just goes full speed.
here's the code I'm using
public void run()
          while(true){
          //Get the Time this cycle Started
               tick_start_time = System.currentTimeMillis();
               // Get the Time this cycle Ended
               // This code is to lock the Maximun frame rate so the applet will not run at
               // a stupid frame rate on fast computers (NOTE: will not stop the Applet from slowing down!)
               tick_end_time = System.currentTimeMillis();
               tick_duration = tick_end_time - tick_start_time;     //Calculate the Time this Game cycle took in Ms
               sleep_duration = MAX_MS_PER_FRAME - tick_duration;     //Calculate howmany Ms this thread should Sleep for
               //Make sure the thread does sleep some if the cycle was too slow
               if (sleep_duration < MIN_SLEEP_TIME)
                    sleep_duration = MIN_SLEEP_TIME;
               actual_fps = 1000 / (sleep_duration + tick_duration);
               try
                    Thread.sleep(sleep_duration);
                    repaint();
               catch (InterruptedException e) {}
I got the code from someplace online I think...can't remember where...
I also declare these...for this
//long start=1;
long tick_start_time;
     long tick_end_time;
     long tick_duration;
     long sleep_duration;
     long actual_fps;
     static final int MAX_FPS = 1;                         //Max Game Cycles per second
     static final int MIN_SLEEP_TIME = 1000;     //Min number of Ms the Game cycle must sleep for
     static final int MAX_MS_PER_FRAME = 1000/MAX_FPS;     //Max Milli seconds per Game Cycle//long start=1;
long tick_start_time;
     long tick_end_time;
     long tick_duration;
     long sleep_duration;
     long actual_fps;
     static final int MAX_FPS = 1;                         //Max Game Cycles per second
     static final int MIN_SLEEP_TIME = 1000;     //Min number of Ms the Game cycle must sleep for
     static final int MAX_MS_PER_FRAME = 1000/MAX_FPS;     //Max Milli seconds per Game Cycle
It just doesn't slow down at all...any ideas...or better code that definately works?

it's ok I got it...Animated gifs were forcing a call to update.Just as a note, you should not be using Animated gifs in a game to achieve animation. The more proper implementation is to place all the frames of an animation into a single image, break the image up into an array upon startup/loading, and then transverse the array based on a set interval.

Similar Messages

  • HT5137 I made a purchase with my debit card on The Simpson Tapped out game, And now my game won't open. It just kicks me out every time I click on it. How do I fix this problem with out deleting my app?

    I made a purchase with my debit card on The Simpson Tapped out game, And now my game won't open. It just kicks me out every time I click on it. How do I fix this problem with out deleting my app?

    Personally, I would never use a debit card online, for security reasons.  If your card gets hacked its your money that is stolen.  At least with a credit card it is the card providers money that is stolen.
    Anyway,  I would delete the app and re-install.  If you paid for the app in the first place you will be able to re-install free of charge.  Also, the app should allow the in-app purchase to happen again as it should recognise that you have already purchased it previously.
    Finally, it might be that the 3G doesnt have as much ram as more recent models of iphone and you may have applications running in the background that are preventing the app to function with the in-app purchase unless you shut down any apps eating all you memory that are running in the background.  Shut-down these apps (and the simpson tap out app) by exiting to your home screen and double-tapping the home button to show what apps are running in the background.  press and hold any of the open apps until it starts shaking.  close all the apps down.  exit then re-launch the app.
    good luck.

  • Did up-grade on a game - now game won't open for play

    did free upgrade on game superslots - now game won't open for play can anyone
    assist me with this - thanks

    Me too... The other post relating to this was with a PC but the same is happening for macs too by the look of it. Has anyone got an idea of how to sort this out? I don't suppose it's possible to find an earlier version of iTunes to download? I'm going to have a search now cos I need iTunes to be working!

  • Games won't open, keep getting message that it can't connect to Games Center even when opened thru same; reset and reboot not help; any suggestions?

    I keep getting messages that the games cannot connect to the game center.  Even when I try to open using the "play" incon in the Game Center, I get the same message.  The message refuses to do anything when I press either "cancel" or "retry,", it just sits there and the game won't open when it appears.
    I have tried resetting the IPad, turning it off/on; re-syncing, etc., and nothing seems to work.   Can any one suggest a way to get the stupid Game Center message to close or some other method to open the game?
    Thanks.

    Start Firefox in [[Safe Mode]] to check if one of the add-ons is causing the problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    * Don't make any changes on the Safe mode start window.
    See:
    * [[Troubleshooting extensions and themes]]
    * [[Troubleshooting plugins]]
    If it does work in Safe-mode then disable all extensions and then try to find which is causing it by enabling one at a time until the problem reappears.
    * Use "Disable all add-ons" on the [[Safe mode]] start window to disable all extensions.
    * Close and restart Firefox after each change via "File > Exit" (Mac: "Firefox > Quit"; Linux: "File > Quit")

  • WTD game won't load, won't sync, won't go away

    I downloaded an app called WTD, a free game. It won't load. Got a message that said I had to connect iPad to my computer to download 200 mb of materials. Okay so I don't even care about this game, but I connected ipad, syncd ipad, but the game won't load on ipad, won't sync. Won't go away. How caqn I get rid of a game that is listed on my ipad as 'loading'

    Also the WTD game won't delete. Doesn't have the X on it when i shake the apps.

  • Running Mac 10.8.5 with safari.  pogo game won't load. told I don't have latest version of adobe. ru

    Running Mac with Mountain Lion 10.8.5 using Safari.  pogo game won't load.  it sez I don't have latest version of adobe flash.  My computer tells me I have the latest version, which I just downloaded.  What now?  How do I get  pogo to recognize that I have the latest version

    Running Mac with Mountain Lion 10.8.5 using Safari.  pogo game won't load.  it sez I don't have latest version of adobe flash.  My computer tells me I have the latest version, which I just downloaded.  What now?  How do I get  pogo to recognize that I have the latest version

  • Why games won't open in facebook

    Why games won't open in facebook

    What is your operating system, version & edition?
    What is your web browser?
    What means "won't open"; what do you see instead of the expected Flash content?

  • Pogo Games won't load after upgrade to Lion

    Upgraded to Lion recently.  Everything seems to be working okay, except that I play a lot of games on Pogo.com, and now none of the games will load.  I made sure everything (Java, etc) was up to date, but none of it fixed the problem.  I tried the games on both Safari and Firefox, and got the same result.  Any game I try to open just says "Now Loading (Name of Game)..." and that's all it does.
    I went back to an older mac that is still running Snow Leopard, and the games loaded just fine. So I figured it was an issue with Lion.
    BUT... on the Snow Leopard computer, I noticed I had an old version of Firefox installed, so I upgraded that to the newest version, and now Pogo games won't load on that either!  So, the problem isn't actually Lion.  It's the newest versions of the browsers.
    I tried contacting EA (pogo) support, but their help page is completely useless.  I thought I'd check and see if anyone here has any ideas.
    thanks,
    Dan

    I'm using Fouiny packages for a year (now it's cvs-20060621-1), as he provides ~all of them & they worked without issue ever since. Latest version's getting a bit old
    EDIT : known problem with new openssl !
    Finally found it here http://bbs.archlinux.org/viewtopic.php?p=192536#192536

  • TS1702 got sims free plays update and now my game won't even open. Can anyone help me with this ? tks

    Got latest update in Sim's Free Play and now my game won't even open! Please Help !! tks

    You might have better luck go to the developer's website since it appears to be a problem with the app not with the iPod.  Also, the developer would know about updates.

  • I changed my password on my iPad and now my games won't connect to Facebook. How do I fix this?

    I changed my password on my iPad and now my games won't connect to Facebook. How do I fix this?

    Update on my problem connecting in Itunes with my Airport Express. Not sure if anything I tried made a difference
    but I finally got the Pop up window saying this device requires a Password. I entered the password and I can once again use the Airport Express as a remote speaker.

  • Ever since the last update my games won;t load on Pogo, I have to play them through Internet Explorer, they were working fine before.

    Ever since Firefox updated the last time, my games won't load on Pogo, I have to play them in Internet Explorer, they were working fine before.

    Mozilla are aware of the issue in Firefox 3.6.14 and are working on a fix, no timescale but they are planning on a quick release. Firefox 3.6.15 will fix the issue with some Java applets not working, which has caused many Pogo games to stop functioning.

  • Pogo games won't load in any versions of Firefox, says "connection was reset"

    After I took the 3.6.24 update, Pogo games won't load. A page comes up saying "The connection was reset while page was loading, check connection to server!" I have tried upgrading, downgrading, checked Java (have latest version), etc. I've cleared caches, history, etc. This can't be a firewall issue, since nothing was changed from playing one game....to "attempting" to load the next one. I really don't know how this issue occured from playing Gin to Hearts (for example). Please help me!! I liked Firefox and I am temporarily using IE, until this issue can be resolved (but IE is very tempermental, too and is not that dependable).

    I have the same problem with connection reset. For awhile I couldn't even bring up pogo home page. I thought it was the ad blocker, but after allowing pogo site on ad blocker, the problem continues. I too am really frustrated with this; everything was fine until I updated Firefox. My solution was to download Google Chrome. Pogo works just fine on that. I still want my Firefox back! Any solutions out there?

  • Pogo games won't load - cleared cache, reloaded firefox, reloaded plugins, reloaded java, reloaded adobe flash - nothing is working - need NEW suggestions please.

    Pogo games won't load - cleared cache, uninstalled and reloaded firefox, reloaded plugins, uninstalled and reloaded java, uninstalled and reloaded adobe flash - nothing is working - need NEW suggestions please.

    Try doing these steps:
    Install Firefox 11 from [http://www.getfirefox.com www.getfirefox.com]. simply install it over your current version of Firefox to make sure all Windows Registry settings get recreated correctly.
    Run all Windows Updates. Service packs, etc. You may have to run this several times to ensure that you get all needed updates.
    Download and Install MalwareBytes Anti-Malware, run a full Scan. [http://www.malwarebytes.org/ http://www.malwarebytes.org/]. This helps check that there are no viruses on your computer causing issues. You can uninstall this program after you clean off any infections.
    Update your graphics driver (Firefox uses your graphics card for some rendering, and an out of date graphics card driver can cause problems. [https://support.mozilla.org/en-US/kb/how-do-i-upgrade-my-graphics-drivers https://support.mozilla.org/en-US/kb/how-do-i-upgrade-my-graphics-drivers].
    After doing all these steps, try restarting your computer, and seeing if Pogo will run.
    If it doesn't work, go into your control panel, and uninstall every installation of Java and Flash that you have. Restart your computer again, then install them from [http://fpdownload.macromedia.com/pub/flashplayer/current/licensing/win/install_flash_player_11_plugin_32bit.exe http://fpdownload.macromedia.com/pub/flashplayer/current/licensing/win/install_flash_player_11_plugin_32bit.exe] for Flash, and [http://javadl.sun.com/webapps/download/AutoDL?BundleId=62313 http://javadl.sun.com/webapps/download/AutoDL?BundleId=62313] for Java. again, restart your PC, then test.
    Try to start Firefox in [[Safe mode|Safe mode]]. This mode disables all extensions, user customizations, hardware acceleration, etc. temporarily for diagnostic and troubleshooting. If Firefox works find in Safe Mode, then this is likely an add-on issue. Restart Firefox in normal mode, then type "About:addons" (without the quotes) in the address bar. Disable your extensions one by one, restarting Firefox between each one, until you find the trouble maker. Once you do, you can disable that add-on and report the issue to that add-on's developer.
    If it does not help the issue, open up your Firefox Profile. [[Backing up your information|Backing up your information]] shows you where that is stored by default. Delete or rename the "pluginreg.dat" file (make sure Firefox is closed when you do this). Test again.

  • Updated iPad and my games won't make any noise

    Updated iPad and my games won't make noise

    Try reset iPad
    Hold down the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears
    Note: Data will not be affected.

  • Older Games won't work...

    I have Zuma and Musika, which I bought for my older 5.5 gen Video Ipod.
    I recently bought a Classic and the games won't sync to it. I looked in the iTunes games store and they indicate only a couple of games are compatible with the Classic.
    Is Apple going to update these games so they work on the Classic or are they just going to screw me out of my games?
    Does anyone know the email for this type of support?

    True. I helped them get even more richer this week by spending $350 on the Complete Bob Dylan and the Complete U2. Great stuff there. Apple is supposed to be making money and there is nothing wrong with that.
    Next generation iPods will require new games then too.

Maybe you are looking for

  • How to Perform a Clean Install of Panther 10.3

    I am currently running Jaguar 10.2.8 (no OS9) on an iMac G3/400, 320 megs ram, dsl internet. I want to perform a clean install of Panther 10.3 (not the upgrade or archive + install). After placing the first Panther disc in the slot, I get a screen on

  • Help scanning photos in Photoshop PSE with OS X Lion

    I just purchased Photoshop PSE for my new Mac with OS X Lion operating system, thinking it would allow me to scan in photos......but I cannot figure out how to accomplish this. Some things I read on line suggested I needed a Twain plug in, but the Ap

  • ECC 6.0 or 5.0 Pdf files for FICO

    Hi sap gurus I am planning to write certification for ECC 6. 0 or 5.0 version for FICO module. Can anybody help me out with the pdf files. My mail ID is [email protected] Thanks in advance Parveem

  • Xml tag name

    Hello i have a query that extracts the xml value of a xml column in a table select extractvalue(xmlMessage, 'a/b/c') from table i'd like to know if there is a way to get the name of the node.. i want to get: 'c', value thanks Rose

  • Bloody Macs (ok I might buy one) - Few tips before I take the plunge?

    Right despite the frankly incredible price of a mac book pro - I have been using a new imac for the past week on a contract up in London and I have been presuaded that it might be a good idea for me to use one considering y line of work... now before