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


world weapon vs world item

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