Martin Kalbfuà wrote:
I'm writing a small snake game with the CRT unit. I wan't to set up a timer for the snake movement. What is the best way to do so with gpc.
When you use CRT, it's best to use the Delay procedure (millisecond resolution) from this unit.
Otherwise, the GPC unit has Sleep (seconds) and SleepMicroSeconds, but they don't know about CRT, i.e., you might have to call CRTUpdate before using them, so output is flushed.
If you need to wait conditionally (e.g., until input becomes available), you can use IOSelect or IOSelectRead (unit GPC), but you might also need CRTUpdate.
If possible I would like to use ISO code.
Unfortunately, none of these are ISO Pascal -- it doesn't have any timer routines. And the CRT unit is not ISO either.
Frank