Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

Miklas

Member Since 12 Sep 2009
Offline Last Active Today, 10:44 AM
-----

#4942629 Team communication software

Posted by Miklas on 23 May 2012 - 10:58 AM

Assembla (see link on gamedev page) or Redmineas ticket / tracker system. Altough I think assembla is quite good (I'm in love with the cardwall tool)

MSN as Instant Messenger / Mumbleas voice chat

And the most important thing: these tools might be great, nothing beats real-life, face to face communication and a wall with post-its ;)


#4942608 Java RPG Item system

Posted by Miklas on 23 May 2012 - 10:13 AM

The more details you give, the better.
-> How big is the inventory? If every Item takes maximum of 1 'spot' in your inventory, you could go for an 2 dimentional array.

Item Inventory[HorizontalSizeOfInventory][VerticalSizeOfInventory];


You can then loop them and everywhere Item[x][y] != null, you display that item.

For the Item structure, I'd work with a system like this:
Have one base Item class with the basics that every Item has; If every item has the same, leave it this way.
If some Items are different (for instance, Health items, Weapon Items ...) inherit from the Item base class and use the factory design pattern. This allows you to 'load' your items from a database or XML. Don't create a class for every Item, as it makes your code to 'implementation-wise' and adding Items will be more difficult.

The following UML can make things clear: make the following. Then create some class that will spawn the items (factory pattern) and add them to the inventory.

Posted Image

Of course, the array idea only works with everything of size 1. Otherwise you could use some system that has a 'size' field in the Item class and prevent from inserting new items to zones which are taken :)


PARTNERS