Sign in to follow this  
Bow_vernon

How do you process input?

Recommended Posts

I have a buffer for keypress, now Id like to relate it to my game. But Id like to know people thought/experience, since experience is the best teacher, so coders, please share your thought and experiences here...and also if you know any good links, please share it here...Help me help others
Cheers!

Share this post


Link to post
Share on other sites
Whenever I process messages, I fill a [font="Courier New"]BOOL keypress[256][/font] array with the states of every key. I pass a pointer to that array to every object that accepts input. That object checks whatever keys are relevant and acts appropriately.

It needs work.

Share this post


Link to post
Share on other sites
When a key press is detected, it is passed to a part of the code for processing. That code translates the key press into a command for the game. The game logic step handles these commands. For example, the escape key generates an "Exit" command. The game logic step receives the "Exit" command and shuts down the game.

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