I’m currently creating a framework for TowerDefenceLike games and I want to make it perfect. For this reason, I went from the opposite and decided to first determine the type of the class, and then prescribe it. Since I’m trying to parody the syntax and style of roblox in use, I immediately had a question:
okay, I see that Tween inherits from the TweenBase class. Okay, maybe this is specifically all about “Tween”, and TweenObject itself already has methods in the style of Tween & Instance or something similar. Okay, my question is simple: should I try to make a similar class structure, and not just shove all the methods into the “Mob” class, why?
As I understand it, I should implement something like MobBase & SpecificMob, am I right?
If I am understanding correctly, you are asking a question about OOP Hierarchy? OOP Hierarchy is where you have objects referencing objects within in each other. Roblox’s Tween service is an object itself, and it contains methods related to it, like TweenInfo or tween create.
If you are creating a mob class, you could definitely put your methods into other module scripts to keep things clean and organized. There’s nothing wrong with putting all your methods within one module script, but if your mob class has several methods, it’s best practice to split them up into other modules.
Implementing stuff like “MobBase” and “SpecificMob” would probably be best as methods and not other objects.
Hope that answers your question, good luck creating your framework!