I have been thinking today about global and locals. I get locals are better but have some questions about locals.
Is the example variable local or global?
– 1
local example = 0
example = nil
example = 0
------------------------ separate code
–2
local example = display.newRect( 0, 0, 20, 20 )
display.remove(example)
example =
------------------------ separate code
–3
local example = display.newRect( 0, 0, 20, 20 )
display.remove(example)
example = display.newRect( 0, 0, 20, 20 )
What is the best way to clean out a local attribute and keep it a local attribute?
Thanks,
Scott