Exceeded instruction limit!

Hey there Codeans,

So I’m building this project which uses a lot of objects, classes within classes, and I’m calling a whole bunch of draw() functions from a single drawAll() function. At this line, Codea occasionally gives me a “Lua program has exceeded instruction limit” error message. I can only assume this means I need to optimise my code. I’m new to Lua, and have only actually worked with even simpler scripting languages, so are there any general techniques people can suggest me for optimisation?


Maybe: make sure you avoid infinite recursion with some of your function?

You could also call this in your setup function. It’ll tell it there’s no instruction limit I believe: