Computer Science Canada timer issue in game |
Author: | tidusraven [ Fri Jan 22, 2010 10:33 am ] | ||
Post subject: | timer issue in game | ||
the issue im having with this program is that the timer goes crazy, it goes everywhere
|
Author: | TheGuardian001 [ Fri Jan 22, 2010 12:03 pm ] | ||||
Post subject: | Re: timer issue in game | ||||
tidusraven wrote:
there's your problem(or at least one of them). If you aren't doing music, you should never be using a process. Essentially every time you repeat your loop, you will restart the timer process and the timer will screw up. This isn't specifically because you're using a process, but the process will screw up other things (like it not waiting a full second sometimes.) Timers can be done properly by using Time.Elapsed. Simply have two variables, one to hold the starting time, and one to hold the current, then compare the two.
|