This is just a small Question I have.
So right now, I’m reworking a Round System in a game, and I was deciding to use a Module to store some of the Data, and their functions to operate the Game, But when I started doing this, I started to wonder if I should use self
for all this, or if I should not.
So Its essentially where the Topic Name comes from.
I was thinking maybe I could do something like this?
local module = {}
function Game.Setup()
local self = setmetatable({}, {__index = Game}) --'Game' is another table
self.MaxTime = 120
self.IntermissionTime = 5
self.DifficultyColors = {
[1] = Color
}
return self
end
return Game.Setup()
But, I’m not entirely sure if I should be doing this with the System I’m trying to rework.
What should I do?