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 / if keystate() (DBC)

Author
Message
hpfan273
17
Years of Service
User Offline
Joined: 19th Jan 2007
Location:
Posted: 12th Mar 2007 01:06
ok... so... i am making a game... and i want it so that the person playing the game... has to type "start" in order to start the game
here is my code

can someone fix this so that when i type in keystate(20) for the 2nd time... the text reads "''"... this is greatly appreciated... thanx

THANKS FOR STOPING AT A RED LIGHT... AND LETTING ME CRASH INTO YOU AT 80 MILES AN HOUR!!!
Terrorist Zero
18
Years of Service
User Offline
Joined: 29th Aug 2006
Location: Teh YouKai
Posted: 12th Mar 2007 01:53 Edited at: 12th Mar 2007 20:29
Hey hpfan,
I've seen your error in the code, and it's a common mistake. What you've done is reset the value of a to 2 each loop, in other words, you need to take a=2 out of the do..loop itteration.

The revised code is here:


In your version of the code, by the time you've pressed keystate(30), and then pressed keystate(20), a has already reverted back to 2.

Hope it helps.

Login to post a reply

Server time is: 2024-11-25 21:25:26
Your offset time is: 2024-11-25 21:25:26