Folks:
I have been programming in various languages for over 25 years…yet I’m a newbie to Lua…so far I love Corona, love LUA, but some things are driving me mad…after endless hours of trying everything I could think of, I am stuck with the following problem:
I have all of the game logic and board graphics generation in a single function, lets call it ‘function A’ Inside of it, there are multiple other “child” functions. Everything works fine. Inside this function I have an object, called ‘ball’ that simply falls due to gravity (using physics).
What I am trying to do is to check if the ‘ball’ goes outside the screen limits (actually off the screen view) and reset everything.
I have tried placing this logic into Runtime onframe event - that doesn’t work because it doesn’t see ‘ball’ object.
I have tried numerous other things and nothing works.
How can I continuously check the coordinates of the ‘ball’ object? Can the 'ball object have its own ‘onframe’ event? Are there any continuous events that fire so that I can check the state of objects? What events can be assigned to the ‘ball’ so that this off-limits condition can be checked? I would think this would be such a common problem.
Lua is nice, but so far has been very unforgiving…please help…really frustrated.
Thanks,
Oleg
[import]uid: 92927 topic_id: 18389 reply_id: 318389[/import]
[import]uid: 52491 topic_id: 18389 reply_id: 70512[/import]