@Override
	public void keyPressed(KeyEvent e) {
		switch(e.getKeyCode()){
		case KeyEvent.VK_ESCAPE ://escape key ends the script
			running = false;
			break;
		case KeyEvent.VK_W :
			keyArray[2] = true;
			break;
		case KeyEvent.VK_A :
			keyArray[3] = true;
			break;
		case KeyEvent.VK_S :
			keyArray[4] = true;
			break;
		case KeyEvent.VK_D :
			keyArray[5] = true;
			break;
		case KeyEvent.VK_SHIFT :
			keyArray[6] = true;
			break;
		case KeyEvent.VK_CONTROL :
			keyArray[7] = true;
			break;
		case KeyEvent.VK_ALT :
			keyArray[8] = true;
			break;
		case KeyEvent.VK_SPACE :
			keyArray[9] = true;
			break;
		default :
			break;
		}
	}