public void keyPressed(KeyEvent e)
{
	
    setTitle(""+ KeyEvent.getKeyText(e.getKeyCode()));  
    System.out.println("hit + "+ KeyEvent.getKeyText(e.getKeyCode()));
    switch(e.getKeyCode())
       {
       	  case KeyEvent.VK_DOWN :player.setVelocityY( player.getSpeed());
       	  						 player.setVelocityX(0);
       	  						 player.setDir(2);
       	                        break; //Sets the player's movement
       	  case KeyEvent.VK_UP :player.setVelocityY( -1* player.getSpeed());
       	  					   player.setVelocityX(0);
       	  					   player.setDir(0);
       	                        break; //Sets the player's movement
       	  case KeyEvent.VK_RIGHT :player.setVelocityX( player.getSpeed());
       	  						  player.setVelocityY(0);
       	  						  player.setDir(1);
       	                        break;  //Sets the player's movement
       	  case KeyEvent.VK_LEFT :player.setVelocityX( -1*player.getSpeed());
       	  						 player.setVelocityY(0);
       	  						 player.setDir(3);
       	                        break;  //Sets the player's movement
       	  case KeyEvent.VK_END :
							     player.setVelocityY(0);
							     player.setVelocityX(0);
       	                          break; //Stops the player completly
       	                          case KeyEvent.VK_ESCAPE :gameNotOver = false;
       	                        break;
      	  
       }

}