Questions tagged [polling]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
89 views

How to detect taps vs tilts in analog stick input

I'm trying to detect when a player taps vs tilts the analog stick. Ultimately, I'm trying to implement controls like Super Smash Bros. Melee. On top of this, I also want to incorporate an input buffer ...
Kory's user avatar
  • 1
1 vote
1 answer
1k views

SDL2 SDL_PollEvent endless polling on key hold

What is wrong with SDL2 SDL_PollEvent() function? When I press-and-hold a key it enters "while (SDL_PollEvent())" block each frame. If in previous frame event queue was emptied and in new frame I ...
kgre90r's user avatar
  • 11
1 vote
1 answer
1k views

What alternatives are there for creating Keyboard/Mouse controls in LWJGL?

So I'm currently working my way through openGL tutorials, using LWJGL to do all my work in. However as I get to the part on how to access Keyboard and Mouse events in this library, I stumble across ...
dammkewl's user avatar
  • 246
1 vote
3 answers
3k views

How do I write a game server with single-threaded networking?

I want to write a game server with one thread for clients message handling and use something like epoll to accept network messages. All I/O and database access will ...
upton's user avatar
  • 111
0 votes
6 answers
2k views

Avoiding constant IF checks for loops

As an example, I have 3 different loops that are executed in certain conditions. I want to know if there's any way short of something like this: ...
parreirat's user avatar
  • 245
1 vote
1 answer
1k views

Turn based card game multiplayer: http polling or TCP

I am working on card games for mobile devices. For multiplayer I will be communicating through a central server. For the purpose I sorted out three options: HTTP polling TCP Websocket (client ...
user739711's user avatar
3 votes
1 answer
505 views

Game based on Ajax polling for 12 players

I am planning on writing a small browser game. The webserver is a shared server, with no root / install possible. I want to use AJAX for client/server communication. There will be 12 players. So ...
Shlomo's user avatar
  • 131
0 votes
1 answer
156 views

What is the best way to turn image voting into a game? [closed]

I'm trying to come up with a design for an image voting site that turns the (potentially boring) task of voting on thousands of images into a game. The goal is to get the user to vote on as many image ...
user257543's user avatar
3 votes
1 answer
3k views

Recommended Polling Rate

I'm using the XInput API to support gamepads. As XInput is not event-driven, but requires polling, my question is, what is the recommended polling rate (ms) for gamepads or specific, the XBOX 360 ...
ordag's user avatar
  • 31
1 vote
4 answers
2k views

How do I respond to keyboard events which occur between polling?

In my games update loop, which happens on a fixed timestep of 30 times per second, I am checking the current state of several keys to determine how to move the player. For example: ...
beeglebug's user avatar
  • 143
21 votes
3 answers
14k views

Polling vs event driven input

I'm developing a game using polling for the input method. However, now that I'm delving deeper into the game menus and other UI components, I'm finding that I'd probably like to have event driven ...
House's user avatar
  • 73.2k
9 votes
3 answers
2k views

Key combinations on poll-based input

So assume you have an input system that is based on polling void update() { if( Keyboard[ 'A' ] ) // A is down } Say you want to be able to recognize ...
bobobobo's user avatar
  • 17.1k