public void keyPressed(KeyEvent e){
        int key = e.getKeyCode();
        if (key == KeyEvent.VK_RIGHT){
            dx = 6;
        }
        if (key == KeyEvent.VK_LEFT){
            dx = -6;
        }
        if (key == KeyEvent.VK_UP){
            dy = 6;
        }
        if (key == KeyEvent.VK_DOWN){
            dy = -6;
        }
    }