Home > other >  Damage calculation on the weapon class object of good or good?
Damage calculation on the weapon class object of good or good?

Time:09-19

Such as topic, in arpg game, there will be a weapon attack and judgement, and harm the goals of a process, at this time of the injury, the effect of the trigger, I can think of, there are two kinds:
1, will the class of the object as a parameter to the weapon class, a function call weapon class, in the function of weapons classes to damage calculation such as the object,
2, sending weapons such as parameters, to the object, call a function object class, in the function of object class damage calculation processing,

Question:
1, this two ways, what are the advantages and disadvantages of each? Mainly from the performance, logic, and may consult the bug,
2, the two ways are suitable for what?
3, is there a better solution?

CodePudding user response:

Weapons just increase the damage of equipment, concrete damage and the main body must be role and made N a game without a put the main damage weapons...

CodePudding user response:

The building Lord said the two I feel like there are many types of weapons, also have a variety of objects, is N: the relationship between N, upstairs was good thinking
  • Related