How to create a timer in Jack

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to create a timer in Jack

peterxu422
I would like to create a countdown timer for my game in Jack. Has anyone done something like this or have any suggestions to share on how to do this?

A few additional questions to this:
How would you control the precision of the clock?
How would constantly redrawing the screen (or the part of the screen where the timer is placed) affect the speed of the program?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to create a timer in Jack

cadet1620
Administrator
There is no way to do accurate timing in Hack. You can use software delay loops to slow your program down and you can use the Sys.wait() function, but neither of these will be consistent from one computer to another.

How much the timer display will affect speed will depend on whether you are emulating the OS .vm files or using the built in OS functions.

--Mark
Loading...