@Override
	public void keyPressed(KeyEvent e) 
	{
		switch (e.getKeyCode())
		{
			case KeyEvent.VK_DOWN:	
			{ 
				downPressed=true;
			}
			break;
			
			case KeyEvent.VK_UP:	
			{ 
				upPressed=true;
			}
			break;
			
			case KeyEvent.VK_RIGHT:	
			{ 
				rightPressed=true;
			}
			break;
			
			case KeyEvent.VK_LEFT:	
			{ 
				leftPressed=true;
			}
			break;
			
			case KeyEvent.VK_SPACE:
			{
				spacePressed=true;
			}
			break;
			
			case KeyEvent.VK_P:
			{
				pPressed=!pPressed;
			}
			break;
		}
	}