Sign in to follow this  
EGD Eric

[java] my 2 player java game

Recommended Posts

You need a buddy to try it. Its right here Both players play with opposite sides of the keyboard. If you've got a buddy to play with, you'll probably notice a bug where the controls kind of lock up, one ship might start rotating non-stop. The reason is because the input system can only handle so many keypresses at once. Does anyone have any suggestions as to how I could make it so that the game could handle more keypresses? DirectInput for Java (if that exists)was my guess, but what would Mac users use?

Share this post


Link to post
Share on other sites
Pretty neat, the whole keypress thing is a hardware thing - you can solve using USB only keyboard I think (no ps-2 connector plugged in) or at least that's how I've done it in the past for things like MAME. Rate++ :)

Share this post


Link to post
Share on other sites
you can solve using USB only keyboard I think
so there's nothing I can do on my end other than require the user have a USB only keyboard? I want to be able to show this to potential employers, and I know they won't be impressed if they see a bug.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
its not really a bug,
there are only 4 solutions:
1. redesign the game to work with fewer keypresses,
2. use an alternative form of input, such as gamepad, mouse, etc.
3. force the users to use a usb keyboard that can support more simultanious keypresses.
4. only do multiplayer by network.

Share this post


Link to post
Share on other sites
I am after the same information that EGD Eric was. I don't believe that it's a hardware issue because I am making a JAVA version of one of my C++ games. In the C++ version, I used on many differant computers and keyboards, none of which were USB, the keyboard worked perfectly. It may be that JAVA is not as good at keyboard detection as C++, but it's not a hardware issue.

Anyway I'm using a USB keyboard and I still get the same problems with Erics game.

Does anyone know how to do key detection in JAVA so that it will pick up 6+ keys at a time?

Share this post


Link to post
Share on other sites
I remember reading this in a DirectX book: Something about DirectInput being the solution to LOTS of keypresses. I dunno if they have DirectInput for Java, and even then, it'd only be usefull to windows users.

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