For those who like to declare their variables

I found this link with code (under the first approach described on the page) that prevents you declaring global variables by locking the globals table, so you have to declare all variables locally (unless you unlock globals first).

This is useful in development for catching typos, eg you could lock the global table at the end of setup, when you’ve declared all the globals you actually need. If you mistype a variable after that, Lua will try to add it to the globals list, fail, and throw an error.

So this forces you to explicitly declare all variables, eg local img

http://lua-users.org/wiki/DetectingUndefinedVariables

Thanks @Ignatz super helpful!

Very interesting.

Thanks for posting

Awesome. Thanks.