Results 1 to 3 of 3

Thread: AS3 music game - how to avoid lag?

  1. #1

    AS3 music game - how to avoid lag?

    Okay, I am designing a game where it is very important that you hit notes to the beat.
    You could say it's a bit like Guitar Hero.

    The soundtrack and sound effects should match the beat of the game.

    This is the biggest problem I can think of: If for some reason the game lags (like if the player is on an old computer or they decide to schedule their annual DVD backup and reencryption on that day) even if it is just for a few seconds, when the computer restores to normal, the soundrack might be off.

    Even by being off by 1/10th of a second, it will throw the user off and basically kill the game.

    I have no problem using MIDI files for the game soundtrack and most sound effects, so would there be any way to time the MIDI to play correctly, avoiding lag?

    Is there any other way I could do this?


    < Music to my ears
    Last edited by IQAndreas; March 19th, 2009 at 11:40 PM.

  2. #2
    If you use a timer rather than enter frames to control the game, then you won't get lag caused by slow computers.
    My new hero: Chrysippus
    "Chrysippus is said to have died in a fit of laughter- having given wine to his donkey, he died of laughter after seeing it attempt to eat figs."
    What a legend!

  3. #3
    But what would flash do if I created a timer that executes every 100 milliseconds, but now and then, it may take 150 milliseconds to execute the code each time?

    How does flash treat timers and entering frames differently?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012