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 / Keyboard Programming

Author
Message
Beaverboy
18
Years of Service
User Offline
Joined: 10th Jul 2006
Location:
Posted: 11th Jul 2006 00:06
I need help programming the keyboard.

My goal is to make a bitmap move around the screen with the arrow keys, but I don't know how to code it so I can control it with the arrow keys.

If someone could please give me a sample bit of code that shows how to program the arrow keys that would be great.
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 11th Jul 2006 00:15 Edited at: 11th Jul 2006 00:15
1. Stop triple posting, you have to wait for your posts to be accepeted since your still on authorization.

2. Show some effort, do some searches on the forums and in the code base, read the tutorials that come with Darkbasic and the tutorials found on this site/these forums, you'll get all of the beginning info you need from there.

3. Consult the index in the help files that come with Darkbasic for extra info on every command in DB.

Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 11th Jul 2006 00:30
Well being as most programs use the arrow keys for movement, you could have downloaded almost anything to find that out. Look in the code base at the top. It looks like a $c

CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 11th Jul 2006 00:43
holy crap, is it not clear when people are on approval
deleted the other 2 threads

beaverboy, slow down man

Science, Mathematics, and Physics do not lie - only people do.
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 11th Jul 2006 00:45
Hmmm... check some of the most simple help files. They use the arrowkey commands. Here's one: Upkey().

You can later use the Keystate() command, but for now stick with the simple ones.

My Functions: Mine
Post yours: Post
BluEarth Software
20
Years of Service
User Offline
Joined: 13th Nov 2004
Location:
Posted: 11th Jul 2006 23:20
Yeah man, I can't program in DB very well, but I was able to find that code in the help file with no problem. Search inkey$.

Daemon
18
Years of Service
User Offline
Joined: 16th Dec 2005
Location: Everywhere
Posted: 11th Jul 2006 23:25 Edited at: 12th Jul 2006 00:11
using keystate works better than inkey$ because you can detect it if multiple keys are being pressed.

Yes, I guess you are right.

BluEarth Software
20
Years of Service
User Offline
Joined: 13th Nov 2004
Location:
Posted: 11th Jul 2006 23:30
searching the inkey$ in help will lead you to all INPUT commands, so just search that.

Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 12th Jul 2006 02:37
if upkey() = 1
[code here]
endif
if downkey() = 1
[code here]
endif
if leftkey() = 1
[code here]
endif
if rightkey() = 1
[code here]
endif

Pirates of Port Royale
Live the life of a pirate.
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 12th Jul 2006 03:48
Didn't you ask this on the GameDev forums too?

Login to post a reply

Server time is: 2024-11-26 15:31:49
Your offset time is: 2024-11-26 15:31:49