Should I be using self for a Round System?

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?

2 Likes

you should use modules of course, but meta tables are not needed, round system is easy thing to do, you have to do some corontines maybe or functions and this is all

Not sure, The System I’m trying to rework is over 500 lines, I was sort of wondering if that would make things a little bit easier.

1 Like

if it’s that complicated, you definitely vvan’t to use meta tables , it can make tables povverfull you knovv, and it can be really helpfull

1 Like

Oh, thats cool. Thanks!

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