Why not implement a Resource class with all stats?

See title.

Just thinking about performance, if there are a lot of enemies and we need to get a Stat form all of them. Each one has to loop the stats Array to get the correct resource.

in a more complex game we would have more Stat (maybe even hidden one) that we need, to calc the correct damage.

On the other hand this way we could implement a logging mechanism to tell the dev he is trying to access a resource that is not deined.

Sounds like a valid solution, For our game the number of enemies in a scene is likely to be limited as we transistion between each scene so its not going to be as much of an issue from a performance point of view.
That being said other methods could be utilized if all stats were in the resources then you could eliminate doing it for all enemies and only for the enemy that is currently attacking.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms