public void keyPressed(KeyEvent e){
			try{
				if(e.getKeyCode() == KeyEvent.VK_W){
					hero.setDir(90);
					hero.move();
				} else if(e.getKeyCode() == KeyEvent.VK_A){
					hero.setDir(180);
					hero.move();
				} else if(e.getKeyCode() == KeyEvent.VK_S){
					hero.setDir(270);
					hero.move();
				} else if(e.getKeyCode() == KeyEvent.VK_D){
					hero.setDir(360);
					hero.move();
				} else if(e.getKeyCode() == KeyEvent.VK_SPACE){
					int dmg = hero.attack();
					if(enemy.inArea(hero.getX(), hero.getY()) || enemy.inArea(hero.getX() + hero.getRange(), hero.getY() + hero.getRange()) || enemy.inArea(hero.getX() - hero.getRange(), hero.getY() - hero.getRange())){
						enemy.takeDmg(dmg);
					}
				}
				repaint();
			}catch(IOException q) {
				q.printStackTrace();
			}
		}