public synchronized void getAttacked(AtomicInteger power, StateActor state){

		life.getAndAdd(-power.get()); //Deals the damage.

		switch(state){ //Knockback effect.
		case ATTACKINGUP :
			if(getPosition().getY()-15>24*2*GameManager.SCALE){
				position.setXY(position.getX(), position.getY()-15);
			}
			break;
		case ATTACKINGDOWN :
			if(getPosition().getY()+15<122*2*GameManager.SCALE){
				position.setXY(position.getX(), position.getY()+15);
			}
			break;
		case ATTACKINGLEFT :
			if(getPosition().getX()-15>22*2*GameManager.SCALE){
				position.setXY(position.getX()-15, position.getY());
			}
			break;
		case ATTACKINGRIGHT :
			if(getPosition().getX()+15<122*2*GameManager.SCALE){
				position.setXY(position.getX()+15, position.getY());
			}
			break;
		default :
			break;
		}
	}