Advice on separating Input from Entities

Started by
20 comments, last by Zipster 14 years, 2 months ago
Quote:Original post by stellamary
What is the analogue inputs which used in the game.


Just some thoughts:

You may consider mouse's movement or joystick's stick as analogue input. It means that the input event contains information about the scale/strenght of the movement. Moving a mouse generates an event which contains information how much the mouse has moved.

On the contrary, pressing a key on a keyboard generates event containing information which key is pressed down / released. It doesn't tell how strong you pushed the button (which would be nice some times actually).

Cheers!
Advertisement
On Windows you can rely on WM_* messages for the keyboard and mouse, but for everything else you'll probably have to poll your input API. In that case you can wrap your own event system around the polling and send events whenever the values change (for both digital and analog inputs), or for analog inputs you can always rely on polling. Again it's up to you.

This topic is closed to new replies.

Advertisement