Hello,
As of late I have been working on some games that have some more complex objects such as weapons, enemies, and tiles. For each of these categories, there are different things that each can be, for example, a tile can be a bush or a barrel. A weapon has different attributes such as noise, range, and damage. Enemies have different attributes and AI’s. I just wanted to ask what the best way of implementing these different behaviors would be. As much as I despise singletons, right now I am using a singleton table to store the different behaviors and reading from that based on an ID. Are there any alternative ways to accomplish these different behaviors? I could use class inheritance, but that would end in a lot of classes. I could hard-code it with if statements, but that is hardly expandable. How have you accomplished different behaviors for similar objects in the past? What is the best practice for doing what I described?