Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Multiple Keystroke Values
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Prince Pwn




PostPosted: Mon Jun 18, 2007 12:26 pm   Post subject: Multiple Keystroke Values

How am I able to allow multiple keystrokes at the same time. For example, in the blow program I want to be able to hold DOWN and RIGHT to move in a downright position, so I need the value for DOWN and RIGHT.

Applet

Source Code.
Sponsor
Sponsor
Sponsor
sponsor
rizzix




PostPosted: Mon Jun 18, 2007 3:49 pm   Post subject: RE:Multiple Keystroke Values

Haha! Yes.. lets just say its not possible Smile AWT/Swing was not designed for games, and they will not work the way you want for most games.

What you want is a polling mechanism not an IoC event handling mechanism. So, java game programmers have created a new api to resolve these issues: JInput (which also supports game controller/joysticks etc...)

You might have to do some reading to learn how to use it. You might even have to restructure your code to use it (..or maybe not). But it will be worth the effort. Smile
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: