Well having 200 variables in a given Lua file scoped to the entire file is a lot of variables…
I ran into this with my first Corona game before I learned about modules, and I solved it with a basic Lua table trick.
If you have variables
local a, b, c, d, e, f, g
you can do
local t = {}
t.a = 0
t.b = 0
t.c = 0
t.d = 0
t.e = 0
t.f = 0
t.g = 0
You go from 7 local variables to 1 by using table’s to hold member variables. You can logically group these into tables that make sense.
For instance put all of your player related local variables in a table called player. Put all of your enemy local variables in a table named enemies.
Once you’re there, the next step is to make functions that just work on the player, functions that just work on the enemy and then you have an easy path to create a player.lua and enemies.lua and move that code out of your lua file you’re having problems with and your life will get a lot easier.
I hate maintaining my first game because it’s a lot of scrolling in the editor, there is no code organization and to me represents what should not be done, but almost everyone new to Lua and Corona will run in to.
Rob