On 14/12/2010 16:14, Dilwyn Jones wrote:
Does anyone know of an extension to BASIC similar to PAUSE n which does not return if a key is pressed. That is, a fixed pause.

Or anyone know how or ideas on how best to go about writing one? I guess a suitable keyword name might be WAIT (just to get this started - it wasn't listed in Rich Mellor's BASIC reference manual anyway!)

I considered using job suspensions, but wasn't sure if this would work the same on all systems - I want to introduce short timings which are consistent on all systems and aren't affected by keypresses, so the game can run at a vaguely consistent speed on all systems.

Dilwyn Jones


_______________________________________________
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm


SUSPEND_TASK (turbo toolkit), SJOB -1,x (Tiny Toolkit) or SUSJOB -1,x (Btool) will all suspend a task for a given number of frames - although beware that these commands, as with PAUSE and INKEY$ vary between 50Hz european machines and 60Hz US machines!

--
Rich Mellor
I had considered using something like that, but the best solution for what I am trying to achieve would be an equivalent of INKEY$(n) where a keyboard read and time delay could be combined such that the game doesn't suddenly run faster when you press keys.

Any further ideas in that department, perhaps?

Simon Goodwin's DIY Toolkit has a TIMER set of commands, which can work in units of 1/50 or 1/60 second. I guess an equivalent to what I want could be written as a loop based on the timer, with a keyboard read somewhere in the loop. But of course what happens if multiple keypresses are made within the loop? Maybe that's why PAUSE and INKEY$ work as they do.

Dilwyn Jones


_______________________________________________
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm

Reply via email to