I want to make a simple pong game. How do I get the input to move the paddle without making the ball thats moving around pause to wait for input?
Keyboard input for simple games
Started by Osnarf, Mar 17 2010 08:35 PM
1 reply to this topic
#1
Posted 17 March 2010 - 08:35 PM
|
|
|
#2
Posted 17 March 2010 - 09:15 PM
Depending on the library you use, there may already be a function that gets input without pausing. In TI-BASIC, I could put a getkey function in a while loop. If a key was pressed, getkey would return a number of the corresponding key, otherwise it just returns 0.
If that's not available, you could use a forking program or something similar. One process would wait for input, and the other would do normal game operations.
The fork() System Call
If that's not available, you could use a forking program or something similar. One process would wait for input, and the other would do normal game operations.
The fork() System Call
Root Beer == System Administrator's Beer
Download the new operating system programming kit! (some assembly required)
Download the new operating system programming kit! (some assembly required)


Sign In
Create Account


Back to top









