Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Global Key Command

Author
Message
PeterLewis
21
Years of Service
User Offline
Joined: 27th Sep 2003
Location: South Africa
Posted: 17th Oct 2003 22:54
Is there any way to specify that if the user presses a specific key anywhere in the game that the game will execute a piece of code.

For example I have the result of my game showing animations. The could be a sequence of up to 20 different animations of 2sec each ( Sprite animations) At any time during these the user might want to skip the remaining animations and continue with the game.

The only way I can think of now would be to continuously GOSUB to a routine to check if the key had been pressed. This is a tedious method. I am looking for something better.


Thanks in advance

Peter
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 17th Oct 2003 23:05
I'm afraid that it's the tedious method for you ...

One way to make things easier is to only check when you issue a sync command ... for example, instead of using SYNC, use MYSYNC() and the following code (modified appropriately)

Login to post a reply

Server time is: 2024-11-25 12:21:36
Your offset time is: 2024-11-25 12:21:36