I have been making a game I have made sure to make as much local attribute as possible. But have some global function I am also using composer is it worth the performance enhancements I am only slightly in my game. Also I get some errors when I do something like
– sample 1
local mySampleObj = display.newRect(100, 100,100,100)
local function mySampleObj:touch(event)
–run
end
–sample 2
local function test1()
– trying to run this
end
local function test2()
–stuff happens
test1()
end
test2()
–sample 3
local myTimer
local function test1()
–stuff happens
myTimer = timer.performWithDelay (1000, timerFunction, 1)
end
local function timerFunction()
–run this
end
I would do this in code editor but I am doing this on my iPhone and have no wifi on my computer.
I understand this has to do with scope I was just wondering if there are any easy work arounds to get them to work or just make the functions global.
Thanks Scott
