Hi, everyone! I’am quite newbie to Corona SDK.
Now I’am working at my first game. I’am using Storyboard API.
In different tuts and video I noticed that people use different methods to structure the game code:
Method A (put variables right into the scene:enterScene(e) function). Simple code for example:
function scene:enterScene(e) local view = self.view; logo = display.newImageRect( "logo.png", 500, 500) view:insert(logo) end
Method B (first declare some function to create logo and the put it into scene:enterScene(e) function). Simple code for example:
local function setupLogo() logo = display.newImageRect( "logo.png", 500, 500) logo.x = \_W logo.y = \_H end function scene:enterScene(e) local view = self.view; setupLogo() end
And the question is - " What is main difference between this two types of code structure?".
Does it have any effect on perfomance or on memory usage and etc.?
Thank you in advance!