southsideskater Guest
|
 |
« on: December 22, 2004, 08:47:01 PM » |
|
right now in intro to C++ we are developing games for our final but im havin some difficulties and i was hoping someone could give me some help. here is what i have soo far. the problem is i cant get my paddle to move when i run my applet
import java.awt.*; import java.applet.*; import java.lang.Thread;
public class Padle extends Applet implements Runnable{ int yourPadle = 70; private Image dbImage; private Graphics dbg; private Thread th; public void init() { setBackground (Color.black); th = new Thread(this); } public void start (){ th.start(); } public void stop(){ th.stop(); }
public boolean keyDown(Event e, int key){ if(key==Event.UP){ yourPadle =- 7; } else if(key==Event.DOWN){ yourPadle =+ 7; } return true; } public void destroy(){ th.stop(); } public void run(){ }
public void paint(Graphics g) { g.setColor(Color.white); g.fillRect(20,yourPadle,20,80); } }
|