public void keyPressed(KeyEvent e)
	{	
		if(!listen_keyboard && !paused)
		{
			Thread.yield();
		}
		else
		{
			if(e.getKeyCode() == KeyEvent.VK_ESCAPE)
			{
				Game.score.updateHighScore(Game.score.getCurrentScore());
		
				System.exit(0);
			}
			else if(e.getKeyCode() == KeyEvent.VK_SPACE)
			{
				drawingArea.repaint();
				
				if(paused)
				{
					paused = false;
					drawingArea.getTimer().start();
				}
				else
				{
					paused = true;
					drawingArea.getTimer().stop();
				}
			}
			else
			{
				if((e.getKeyCode() == KeyEvent.VK_UP) & (drawingArea.getSnake().getBody().get(0).getDirection() != Direction.SOUTH))
				{
					drawingArea.getSnake().getBody().get(0).setDirection(Direction.NORTH);
				}
				else if((e.getKeyCode() == KeyEvent.VK_DOWN) & (drawingArea.getSnake().getBody().get(0).getDirection() != Direction.NORTH))
				{
					drawingArea.getSnake().getBody().get(0).setDirection(Direction.SOUTH);
				}
				else if((e.getKeyCode() == KeyEvent.VK_LEFT) & (drawingArea.getSnake().getBody().get(0).getDirection() != Direction.EAST))
				{
					drawingArea.getSnake().getBody().get(0).setDirection(Direction.WEST);
				}
				else if((e.getKeyCode() == KeyEvent.VK_RIGHT) & (drawingArea.getSnake().getBody().get(0).getDirection() != Direction.WEST))
				{
					drawingArea.getSnake().getBody().get(0).setDirection(Direction.EAST);
				}
			}
		
			listen_keyboard = false;
		}
	}