Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
2 key challenge
#1
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?
Reply
#2
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=MiloSed...ardHandler

*peace*

Meg.
Reply
#3
Going just a little off topic, but...

This reminds me:
Wasn't there going to be a second 1-key challenge this year?
Reply
#4
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...
Reply
#5
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?
Reply
#6
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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)