@Override
public void keyReleased(KeyEvent e) {
	// TODO Auto-generated method stub
	int key = e.getKeyCode();
	if (key == KeyEvent.VK_RIGHT && !left) {
		right = false;
		} else if (left) {
		left = false;
		}
		if (key == KeyEvent.VK_LEFT && !right) {
		left= false;
		} else if (right) {
		right = false;
		}

		if (key == KeyEvent.VK_UP && !down) {
		up= false;
		} else if (down) {
		down = false;
		}

		if (key == KeyEvent.VK_DOWN && !up) {
		down= false;
		} else if (up) {
		up = false;
		}
}