Qbasicnews.com
July 06, 2020, 08:18:17 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: 2 key challenge  (Read 2423 times)
Nub
New Member

Posts: 1


« on: October 21, 2004, 10:27:44 AM »

I'm working on my first game program in qbasic.
The game that i have chosen to make is the Tron light bike game.
So far it looks kind of nice but there is a problem that occurs when player one and player two both try to move at the same time. I'm useing a INKEY$ command for both players and it will only read one key at a time.

Now the challenge is how do I get more then one key to be read in at exactly the same time?
Logged
Meg
Ancient QBer
****
Posts: 483


« Reply #1 on: October 21, 2004, 11:52:31 AM »

This really should be posted in the programming help forum instead of the challenge section.

The easiest way to do this is to use a keyhandler.  This one seems to work for most people:
http://faq.qbasicnews.com/?blast=MiloSedlaceckKeyboardHandler

*peace*

Meg.
Logged
RST
Wandering Guru
***
Posts: 326



« Reply #2 on: October 28, 2004, 05:03:15 PM »

Going just a little off topic, but...

This reminds me:
Wasn't there going to be a second 1-key challenge this year?
Logged
PlayGGY
Forum Regular
**
Posts: 144



« Reply #3 on: October 30, 2004, 02:58:06 PM »

I made a key handler here a year or so back... search for it.

As to the one button comment: I also made a 10 line pong clone (no colons!) using only one button.  It's in the challenege section somewhere...
Logged
computerkid14
Forum Regular
**
Posts: 143



« Reply #4 on: October 31, 2004, 11:15:49 AM »

is this the only way to have a multiplayer function? im pretty new to qbasic, and i didnt understand teh key handler. Is it just like creating another INKEY$  ?   I have been working on a light cycle game too for a while, and i had the same problem. there isnt an easier way is there?
Logged
Meg
Ancient QBer
****
Posts: 483


« Reply #5 on: November 01, 2004, 10:15:45 AM »

Using a keyhandler is the easiest option, in my opinion.

This one might be easier to understand:

http://forum.qbasicnews.com/viewtopic.php?t=5307

*peace*

Meg.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!