Sign in to follow this  
Quak

Input with VB

Recommended Posts

Quak    206
Hi, I've written a little game during my Visual Basic computing lessons (because it is so boring). I've been using scrollbars for the input so far because I could not figure out how to test if any key is pressed. I'm using for the game loop a timer so I want to test the state of any key out of the timer. Any ideas ? Thx for answers :) (btw. VB really s****, it is a pitty their is no c++ compiler on the system ;) )

Share this post


Link to post
Share on other sites
Wavewash    202
Visual Basic isn't all that bad. I havn't used vb in awhile but the basic idea is

Make an array of to check if the keys are down.
Dim key(255) as bool

and then on the Keydown function make whatever key was pressed equal to true and then keyup make whatever key was pressed equal to false again. Then in your functions always check for particular keys to see if the action should be preformed.

http://www.vbexplorer.com/VBExplorer/userinput.asp

That's a great tutorial. Should send you on your way.

~Wave

Share this post


Link to post
Share on other sites
Quak    206
Thanks, year VB might be useful in toolprogramming and things like that but I "hate" it :) (as a native c/c++ programmer)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this