Computer Science Canada Pong Paddle Movement Problem |
Author: | LoganJAVA [ Sat Jan 17, 2009 10:59 pm ] | ||||
Post subject: | Pong Paddle Movement Problem | ||||
Hello, I am making pong, and I know that the logic is missing, but could anyone edit my code so that the paddle moves up and down.
Mod Edit: Remember to use syntax tags! Thanks
|
Author: | LoganJAVA [ Sat Jan 17, 2009 11:01 pm ] |
Post subject: | Re: Pong Paddle Movement Problem |
I am trying to make Pong, and if you could help, that would be great. I am trying to use arrow key inputs to make the paddle move, and it is only one player. Please Help. I am from the USA.. but, |
Author: | DemonWasp [ Mon Jan 19, 2009 10:34 am ] |
Post subject: | RE:Pong Paddle Movement Problem |
A few things first: 1. Use [ syntax = "java" ] and [ / syntax ], without the spaces, to format your code properly. This makes it easier for us to read, and more likely that we'll help. I see the <code> attempt, but it's BBCode, not HTML, so you want [ code ]; even that isn't as good as [ syntax ]. 2. We aren't going to modify your code for you. We'll point you in the right direction, but we won't write your code for you. 3. There is an edit button, please use that instead of double-posting, particularly only 2 minutes after your original post. It looks like all you'll need to do (assuming your code is set up properly, which I can't really tell without proper formatting) is make sure you redraw the paddle after changing it. You seem to be changing the value of ypaddletop corresponding to your keystrokes, but I can't see where you're drawing the paddle in its new location. |
Author: | S_Grimm [ Mon Jan 19, 2009 3:48 pm ] | ||
Post subject: | RE:Pong Paddle Movement Problem | ||
1) Learn to buffer your program. 2)put the draw commands inside a method.
|