private void attack(){

		if(isAttacking()){
			if(GameManager.multiplayer){ //Message for multiplayer mode.
				message[1] = StateActor.convertToInt(state) +1000*position.getX()+1000*1000*position.getY();
				try {
					GameManager.buffer.produce(message);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
			}

			ArrayList<Monster> monstersList = canAttack(); //Creates the list of monsters he can attack.

			if(monstersList!=null){
				for(Monster m : canAttack()) {m.setState(StateActor.NONE); m.getAttacked(power);} //Stops the monster and attacks it. (to make it easier to win the game)
			}

			while(pauseCounter<ANIMATIONSPEED*7+1){ //Can't launch another attack right away ! But displays the animation completely.
				currentSprite = sprite.next();
				GameManager.updateGraphics(currentSprite, position,life.get()/LIFE_MAX);
				try {
					sleep(delay);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				pauseCounter++;
			}
			setState(StateActor.NONE);
			pauseCounter=0;
			sprite.reset();

		}

	}