Jump to content
  • Advertisement
Sign in to follow this  
DefCom

YaBasic Help please

This topic is 4459 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I am an ICT teacher and some Y7s have asked me to teach them about games programming. Long story short, we are using win32 ps2 yabasic. I can't seem to get the keyboard input working properly.
repeat
	press$ = INKEY$
        //doing pong game here

UNTIL (press$ = "q")


but the screen is only updating when i press a key. I have spent ages on google and experimenting, but no success. We don't access to controllers. Any help would be greatly appreciated Thanks. [Edited by - DefCom on March 11, 2006 3:05:34 AM]

Share this post


Link to post
Share on other sites
Advertisement
INKEY$ is a blocking function. Meaning that your program stops and waits there for a key to actually be pressed.

However, as the documentation states, you can pass it a timeout parameter, specifying how long it is going to wait for a keypress. If no key is pressed by that time, it'll just return "".

So, if you do press$ = inkey$(0), it will try to grab a keypress on the fly but will not actually wait, so your program will keep running, and your screen will keep updating.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!