public void keyReleased (KeyEvent e) { //sets the motion of the balls

       int key = e.getKeyCode(); //gets the key pressed

       if (key == KeyEvent.VK_SPACE) {
           shot = false;
       }
   }