コード例 #1
0
ファイル: Player.java プロジェクト: propra13-orga/gruppe72
  /** 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);
    }
  }
コード例 #2
0
ファイル: Player.java プロジェクト: propra13-orga/gruppe72
 /**
  * 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();
 }