Beispiel #1
0
  /** The player will perform a simple MeleeAttack. */
  public void simpleAttack() {
    if (state == DynamicObjectState.Attacking) return;

    state = DynamicObjectState.Attacking;

    if (!isInNetwork) {
      curAnim = simpleAttack.getAnimation(heading);
      manager.registerAttack(simpleAttack);
      simpleAttack.activate();
    } else {
      NetworkManager.sendAttackMessage(this);
    }
  }
Beispiel #2
0
 /**
  * The player received an attackMessage in a network game. This method sets the AttackingState and
  * initializes the attack.
  */
 public void receivedAttackMsg() {
   state = DynamicObjectState.Attacking;
   curAnim = simpleAttack.getAnimation(heading);
   manager.registerAttack(simpleAttack);
   simpleAttack.activate();
 }