like this
local game = gameClass.new()
game:init()
like this
local game = gameClass.new()
game:init()
My first thought is no. To me, it’s like storing all of your code in a single script; you can do it on a technical level, but just because you can doesn’t mean you should. I would find it difficult to read such a script on something as complex as a game, and I imagine making a class of similar form would be no different.
However, that’s assuming you store everything in a single class. If you intend to use subclasses, I could see this being a viable game architecture. All of Roblox Studio’s classes inherit from Instance
, so I can imagine that you could do the same with your game, even if I have no tangible idea on how.
In other words, yes, but only if you intend to use emulated subclasses or are fine with spending hours scrolling through a single script to debug something.