Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


world weapon vs world item

This topic is 5828 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

Is it more efficient to expect your weapon classes to act also as world entities (derived from CEntity)? Compared to having them derived from a CEquipment class and having a CItem class (which is derived from CEntity) to contain the weapon? Here''s a diagram: Entity --Actor (hold ''Object''s the same way the world does) --Object ----Weapon or: Entity --Actor (hold ''Equipment''s) --Object ----Item (can hold ''Equipment'') Equipment --Weapon Which is better? Thanks in advance, -Shambles

Share this post

Link to post
Share on other sites
Depends on how you have things set up.

Personally, this is how i do it:

flag //E_HEALTH, E_GUN1, E_GUN2, E_gun1_ammo etc
Count //ammo amount, health amout etc

The main code comes when the player actually touches the item.
Depending on the flag, we load it differently. IE a health gives health, E_GUN1 would set our gun flag for that spot to "true"

This is pretty much like the q1/q2/q3 way of doing things.. or atleast that''s where i learned it.


Colt "MainRoach" McAnlis

Share this post

Link to post
Share on other sites

  • 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!