Hi,
I would like to know if it will be bad to set a local value = a value from another .lua script in the update() block.
My constants.lua
local M = {}
M.asteroid_speed = 15
M.asteroid_create_timer = 5
return M
My factory.script
local asteroid_speed = constants.asteroid_speed
local asteroid_create_timer = constants.asteroid_create_timer
function update(self, dt)
asteroid_create_timer = asteroid_create_timer - dt
if asteroid_create_timer < 0 then
create_factory(self)
asteroid_create_timer = constants.asteroid_create_timer
print("Set!")
end
end
For example:
asteroid_create_timer = constants.asteroid_create_timer
Is this bad in update() block?