Skip to main content
edited tags
Link
Nicol Bolas
  • 26.1k
  • 3
  • 78
  • 104
deleted 24 characters in body; edited title
Source Link
House
  • 73.5k
  • 17
  • 188
  • 276

HELP - Block breaker with air hockey PLAYED with 2 HUMAN PLAYERS Detecting long held keys on keyboard

I just want to ask if can I check for "KEY"(keyboard) that is HOLD/PRESSED for a long time, because I am to create a clone of breakout with air hockey for 2 different human players. Here's the list of my concern:

  1. Do I need other/ 3rd party library for KEY HOLDS?

  2. Is multi-threading needed? I don't know anything about this multi-threading stuff and I don't think about using one(I'm just a NEWBIE).

  3. One more thing, what if the two players pressed their respective key at the same time, how can I program to avoid error or worse one player's key is prioritized first before the the key of the other. example: Player 1 = W for UP & S for DOWN Player 2 = O for UP & L for DOWN

Player 1 = W for UP & S for DOWN Player 2 = O for UP & L for DOWN

(example: W & L is pressed at the same time)

Great thanks for help.

PS: I use GLUT for the visuals of the game.

HELP - Block breaker with air hockey PLAYED with 2 HUMAN PLAYERS

I just want to ask if can I check for "KEY"(keyboard) that is HOLD/PRESSED for a long time, because I am to create a clone of breakout with air hockey for 2 different human players. Here's the list of my concern:

  1. Do I need other/ 3rd party library for KEY HOLDS?

  2. Is multi-threading needed? I don't know anything about this multi-threading stuff and I don't think about using one(I'm just a NEWBIE).

  3. One more thing, what if the two players pressed their respective key at the same time, how can I program to avoid error or worse one player's key is prioritized first before the the key of the other. example: Player 1 = W for UP & S for DOWN Player 2 = O for UP & L for DOWN

(example: W & L is pressed at the same time)

Great thanks for help.

PS: I use GLUT for the visuals of the game.

Detecting long held keys on keyboard

I just want to ask if can I check for "KEY"(keyboard) that is HOLD/PRESSED for a long time, because I am to create a clone of breakout with air hockey for 2 different human players. Here's the list of my concern:

  1. Do I need other/ 3rd party library for KEY HOLDS?

  2. Is multi-threading needed? I don't know anything about this multi-threading stuff and I don't think about using one(I'm just a NEWBIE).

  3. One more thing, what if the two players pressed their respective key at the same time, how can I program to avoid error or worse one player's key is prioritized first before the the key of the other. example:

Player 1 = W for UP & S for DOWN Player 2 = O for UP & L for DOWN

(example: W & L is pressed at the same time)

PS: I use GLUT for the visuals of the game.

edited title
Link

HELP - Block breaker with air hockey PLAYED aswith 2 HUMAN PLAYERS

Source Link
Loading