@Override
	public void keyPressed(KeyEvent e) {
		if(e.getKeyCode()>=0&&e.getKeyCode()<keys.length){
			keys[e.getKeyCode()]=true;
		}
		//Pausing the game by pressing escape
		if(e.getKeyCode()==KeyEvent.VK_ESCAPE){
			if(renderMode==RENDER_MODE_GAME) pauseGame();
			else if(renderMode==RENDER_MODE_PAUSED_GAME) unpauseGame();
			else if(renderMode==RENDER_MODE_HIGHSCORES) unpauseGame();
			else if(renderMode==RENDER_MODE_HIGHSCORE_ENTER) unpauseGame();
			else if(renderMode==RENDER_MODE_GAME_OVER) unpauseGame();
		}
	}