In this example set of code:
http://developer.anscamobile.com/code/break-out-game
In the example of bricky6withComments, at the top it mentions this:
main.lua
--[[ Any functions and variables that we want to use "globally" can be declared as local up here.
The advantage of doing this here is that we can treat them like globals below, while also
retaining the compiler optimization that results from local variables in Lua.
(Note: this comment also demonstrates multi-line Lua comment syntax.)
--]]
local main, newBall, moveBall, gameOver, killBrick, removeBrick, createBall, removeBall, newLevel
local ball, paddle, brick, brickImage, brickValue, brickCounte
What, specifically, is gained from declaring your global variables (and perhaps functions?) as local, in main.lua?
Speed somehow?
[import]uid: 8541 topic_id: 2755 reply_id: 302755[/import]