コード例 #1
0
ファイル: Player.java プロジェクト: propra13-orga/gruppe72
  /**
   * Creates an instace of the player from an actorDescription.
   *
   * @param game instance of the game running
   * @param desc the ActorDescription
   * @param position the position in screenspace
   * @param controllerActive indicates if the player should be controlled by the keyboard
   * @param actID the actorID to be given. This is only done in network-games
   */
  public Player(
      Game game, ActorDescription desc, Vector2 position, boolean controllerActive, int actID) {
    super(game, desc, position);

    this.actorID = actID;

    this.state = DynamicObjectState.Idle;
    this.velocity = new Vector2(0, 0);
    this.game = game;

    controller = game.getController();
    statsMenu = new StatsMenu(stats, controller, this);
    statusbar = new StatusBar(this, game);
    inventory.setGold(25);

    // TEST
    spellManager = new SpellManager(this);
    spellManager.addShields();

    initAnimations();

    // DEBUG
    skillTree = new SkillTree(this, controller, collision);
    buildSpell();
    this.controllerActive = controllerActive;
    controlled = controllerActive;
    isInNetwork = game.isInNetwork();
    posState = new PositionState(this);
  }