Jump to content
  • Advertisement
Sign in to follow this  
Grahf750

Item class layout

This topic is 4812 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am constructing my item classes right now and I decided I would pass by my idea to you guys to critique. Here is an example ofhow they will be layed out. parent: Item kids: Armor_________________Weapons_________________Jewelry_________________Potions grandKid: Tunic_________________Sword___________________Bracelet________________health leggings______________mace____________________ring____________________strength shield________________bow_____________________necklace________________Mana The grandkids will then have different names and stats to simulate different weapons.

Share this post


Link to post
Share on other sites
Advertisement
Not that what you're doing is wrong, but I would suggest trying to look at the problem differently -- it might give you more ideas. Instead of breaking down your classes based on names or item groups as found in-game, break them down in terms of functionality.

Give "Item" the subclasses "Equippable" and "Consumable," for example. If you think about it, the functionality of armor/weapons/jewelry is different from that of potions/scrolls. Both are "Items" and can reside in an inventory or on a monster or could be purchased from a shop. But, you wear armor/weapons/jewelry (and it bestows some effects on you while it is equipped) and you drink/use/consume a potion/scroll, which generally creates some temporary effect or does other things such as opens a portal, casts a spell, etc and then disappears. The ways of implementing these two things could be very different, depending on your system.

Anyway, just an idea off the top of my head. My point is, try to think in terms of what the classes are doing functionally rather than just breaking them up into groups as you would find them in game.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!