RPG Equipped Item System

Posted by Jimmt on Game Development See other posts from Game Development or by Jimmt
Published on 2013-11-02T19:48:32Z Indexed on 2013/11/02 22:19 UTC
Read the original article Hit count: 154

Filed under:
|

I'm making a 2d rpg with libgdx and java. I have an Inventory class with an Array of Items, and now I want to be able to equip items onto the player. Would it be more managable to do

  1. have every item have an "equipped" boolean flag
  2. have an "equipped" array in the player class
  3. have individual equipped fields in player class, e.g.

    private Item equippedWeapon;
    private Item equippedArmor;
    public void equipWeapon(Item weapon){ equippedWeapon = weapon; }

Or just another way completely? Thanks.

© Game Development or respective owner

Related posts about java

Related posts about libgdx