Hello.
I am haveing trouble with doing my controls right for my game. The problem is that it is more of a logical error and I can not get it to work smoothly. Like when i push and hold on the up arrow, it will go up then stop for like half a seconed then continue going up. I am using keyEvents and do it like most tutorials show on the web, but this seems to not work well for me. I want it to go up and keep going up when i hold down my key and not stop for like half a seconed then continue normaly. I am not sure what I am doing wrong. I looked on the web for tutorials, but most of them are just the old keyUP and keyDown ones.
public void keyPressed(KeyEvent e){
int codeNum= e.getKeyCode();
if (codeNum==e.VK_UP){
if (ya>0)
ya=ya-8;
ballDir=‘u’;
repaint();
}else if (codeNum==e.VK_DOWN){
if (ya<178)
ya=ya+8;
ballDir=‘d’;
repaint();
}//End IF
}//END METHOD
public void keyTyped(KeyEvent e){
int codeNum= e.getKeyCode();
}//END METHOD
public void keyReleased(KeyEvent e){
int codeNum=e.getKeyCode();
}//END METHOD
