public void keyPressd(KeyEvent e) { switch (e.getKeyCode()) { case KeyEvent.VK_UP: bu = true; break; case KeyEvent.VK_DOWN: bd = true; break; case KeyEvent.VK_LEFT: bl = true; break; case KeyEvent.VK_RIGHT: br = true; break; case KeyEvent.VK_CONTROL: tc.myMissile = fire(); break; default: break; } }
public static void main(String[] args) { TankClient tc = new TankClient(); tc.launchFrame(); }