I'm seeing if it is possible to write a pong game only using standard C with maximum portability. I've worked out everything except user input. When the game is playing, If the user has no key pressed down, the paddle does not move but the ball should keep moving. I can only think of two way's of doing this. One is to get the user to hold down an extra key at all times. The other is to shut off the buffer on stdin using setvbuf(), which will hopefully make getchar() return EOF or NULL when no key is being pressed. Would these work? Does anyone have any other idea's?
Thanks.
Hiroshe 499 Posting Whiz in Training
yellowSnow 607 Posting Whiz in Training
Hiroshe 499 Posting Whiz in Training
Dave Sinkula 2,398 long time no c Team Colleague
deepugtm -8 Junior Poster in Training
invisal 381 Search and Destroy
Hiroshe 499 Posting Whiz in Training
Dave Sinkula 2,398 long time no c Team Colleague
Hiroshe commented: Lot's of help +4
Hiroshe 499 Posting Whiz in Training
Hiroshe 499 Posting Whiz in Training
Duoas 1,025 Postaholic Featured Poster
Hiroshe 499 Posting Whiz in Training
Duoas 1,025 Postaholic Featured Poster
Hiroshe 499 Posting Whiz in Training
Dave Sinkula 2,398 long time no c Team Colleague
Hiroshe 499 Posting Whiz in Training
Duoas 1,025 Postaholic Featured Poster
Hiroshe 499 Posting Whiz in Training
Duoas 1,025 Postaholic Featured Poster
iamthwee commented: get some R and R baby. +22
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.