Search:

Type: Posts; User: javapenguin

Search: Search took 0.09 seconds.

  1. Replies
    12
    Views
    5,392

    Re: beginner w/ text based RPG

    Well, you could always assign each one a weight and if the total was more than the maximum weight, it wouldn't let you add it.

    This might be trickier, but I think it's not that much harder.
    ...
  2. Replies
    12
    Views
    5,392

    Re: beginner w/ text based RPG

    Value as in how many slots it takes up,or value as in price?
  3. Replies
    12
    Views
    5,392

    Re: beginner w/ text based RPG

    Assuming that each item has a slot, or location. Well, the user would need to know the location, but they can.


    public void addAtSlot(int index, DataType item)
    {

    if (index < 0 || index >=...
  4. Replies
    12
    Views
    5,392

    Re: beginner w/ text based RPG

    for check inventory



    public boolean checkInventory(DataType item)
    if (aList.contains(item))

    return true;

    else return false;
  5. Replies
    12
    Views
    5,392

    Re: beginner w/ text based RPG

    Arrays or ArrayLists might work.

    Arrays if there is a maximum size.

    Adding/removing items needs an ArrayList.

    You just need to make sure the user can't add beyond a certain range.
    ...
Results 1 to 5 of 5