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 / Help! How do I get a program to do a loop while a key is pressed?

Author
Message
Infalet
16
Years of Service
User Offline
Joined: 22nd Apr 2008
Location: South Africa
Posted: 23rd Apr 2008 10:52
Well, I am completely befuddled with this. I am busy creating a Dice Rolling system which I originally was just gonna have run in the background but now I have decided to have it shown and controlled manually by the player.

What I want to do is roll the dice for as long as the player holds down a key. So far I have tried it with the Space Key using the Ascii code of 32 but it has not worked.

Here is my code so far:

SunDawg
19
Years of Service
User Offline
Joined: 21st Dec 2004
Location: Massachusetts
Posted: 23rd Apr 2008 16:23 Edited at: 23rd Apr 2008 16:24
Instead of using repeat, he ought to still use the while loop, because he said wants the dice to roll with the space key, not any key.



Perhaps he didn't know whiles are loops, too.

My site, for various stuff that I make.
Roxas
18
Years of Service
User Offline
Joined: 11th Nov 2005
Location: http://forum.thegamecreators.com
Posted: 25th Apr 2008 09:04 Edited at: 25th Apr 2008 09:07


There you are

Your signature has been erased by a mod because it was too big
Infalet
16
Years of Service
User Offline
Joined: 22nd Apr 2008
Location: South Africa
Posted: 25th Apr 2008 14:31
Thanks guys for your help I have it working the way I wanted it to now

Login to post a reply

Server time is: 2024-09-27 14:25:53
Your offset time is: 2024-09-27 14:25:53