• Advertisement
Sign in to follow this  

How do you process input?

This topic is 2507 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
I get the keypress as a character and use it t call a Lua function in an input script file, via the standard getglobal/push arguments/pcall approach.

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
Sign in to follow this  

  • Advertisement