Pong Questions:
I don't really know what's going on in your program, but from your description it sounds like your keyboard input is directly controlling the speed of the ball in some way. Is it being influenced by the keyboard repeat rate or something? If so, that's not a good idea in a realtime game.
I suggest you have a single timer which controls all game activity and redraws the screen (it's only Pong, no need to get sophisticated!). Every time the timer fires, you move the paddles and the ball, then redraw the screen. The keyboard events shouldn't move the paddles or update the screen directly - instead, when you receive a keyboard event, make a note of what it was and utilise that information the next time the timer fires.
I suggest you have a single timer which controls all game activity and redraws the screen (it's only Pong, no need to get sophisticated!). Every time the timer fires, you move the paddles and the ball, then redraw the screen. The keyboard events shouldn't move the paddles or update the screen directly - instead, when you receive a keyboard event, make a note of what it was and utilise that information the next time the timer fires.
| Messages In This Thread |
|
Pong Questions: - blobbo - Jan 19, 2004, 08:34 PM
Pong Questions: - skyhawk - Jan 19, 2004, 10:10 PM
Pong Questions: - blobbo - Jan 20, 2004, 05:48 PM
Pong Questions: - NCarter - Jan 20, 2004 06:27 PM
Pong Questions: - blobbo - Jan 21, 2004, 04:14 PM
Pong Questions: - blobbo - Jan 21, 2004, 06:08 PM
Pong Questions: - NCarter - Jan 21, 2004, 06:22 PM
Pong Questions: - skyhawk - Jan 21, 2004, 07:45 PM
Pong Questions: - blobbo - Jan 21, 2004, 08:16 PM
|
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| [Request] Pong Source & One Question | McSpider | 6 | 6,776 |
Sep 18, 2011 07:21 AM Last Post: fudog |
|
| Pong AI trouble | saxplayer13 | 15 | 7,117 |
Dec 16, 2005 10:40 AM Last Post: jamil5454 |
|
| My first Cocoa Game that works! (Pong) | blobbo | 16 | 9,206 |
Aug 4, 2005 03:15 PM Last Post: Andrew |
|
| Pong "Physics" | Nick | 9 | 5,780 |
Sep 28, 2004 07:36 PM Last Post: aarku |
|
| Tic Tac Toe almost done... Next up: Pong! | blobbo | 15 | 7,144 |
Jan 16, 2004 06:33 PM Last Post: blobbo |
|

