question about program flow

hi guys,

I’m new to Codea and am loving it so far.

But, I have a possibly stupid question about program flow: does everything happen in the draw() function? I have been trying to control the flow of a program from outside of the draw() function and I am getting unexpected results (mainly the screen not updating or the app crashing). For example, I have something like this in main():

Setup()

End

Draw()

End

While exitCondition == false do
Function1()
Function2()
Function3()
End

When I run this, the screen renders once (presumably from the first time draw() is called) and then nothing happens. If I get rid of the while loop and place functions 1-3 inside the draw() function, everything works fine.

Am I missing something in Lua or Codea? Does all program flow stem from the draw() function?

Thanks,

David.

David,

Yes, you should use the draw function to control program flow.

I’ve written some ebooks that may help explain. Try the Codea book from here

https://www.dropbox.com/sh/mr2yzp07vffskxt/AACqVnmzpAKOkNDWENPmN4psa

Ok, thanks. I’ll take a look at those.