Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Oct 22nd, 2004, 10:31 AM   #1
Johnny_English
Newbie
 
Join Date: Sep 2004
Posts: 7
Rep Power: 0 Johnny_English is on a distinguished road
Hello,

My Visual Basic teacher assigned us a project. We have to make a pong game.

I already know how to manipulate an object's position, but I need to know how to bind the directional keys to particular commands so the user can control a paddle.

Thanks
Johnny_English is offline   Reply With Quote
Old Oct 22nd, 2004, 2:45 PM   #2
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
In the Form Properties window, set KeyPreview to True. Then, in the Form_KeyDown method/procedure/function/whatever it's called now, you can simply use a Select/Case thingy to check whether KeyCode is equal to vbKeyUp, vbKeyDown, vbKeyLeft or vbKeyRight.

Hope that helps.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 2:03 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC