Tuesday, October 23, 2012

Adventures in Scene Management

It turns out that implementing an overall strategy for level handling/scene management in Corona is more difficult than I had expected. From what I can tell, the Storyboard API, which is the scene management functionality built into Corona, is relatively new. Presumably due in part to that reason, there seem to be some issues with its implementation. I read up on the API and created a version of our game that used the API - but I ran into a few issues. For example, when I switch scenes, I was getting errors that say the 'transition' method (which we are using to scroll the background) is getting a nil value error. It is certainly possible this is due to programmer error. So I am continuing to try to work through these issues as they come up. My goal is to have a working multi-level version of the game completed in the next couple of days. What I have found out from reading the Corona forums that one of the latest daily builds of the Corona SDK included fixes to some of the Storyboard functionality. Unfortunately, the daily builds are only available to subscribers. Since the other members of our team have not purchased a license, I have not upgraded past the latest 'public' release - which is the version the other team members have.

John has written up an excellent first draft of an architectural diagram for the game. I hope to get a chance to take another pass at a draft version of the design this week. A couple things I found interesting while investigating Corona and the lua programming language in general, which we may need to take into account:

- The lua source code examples I've seen don't often seem to use the concept of object-oriented Classes. Not that this means necessarily that we can't take this approach - in fact I wouldn't rule out the possibility that may be our preferred approach. I'm just wondering if there is a reason why the samples I haven't seen seem to stay away from this. It may simply be that the Corona sdk has been designed to be more accessible to non-developers. On further research, it appears that lua does not utilize the concept of separate Classes to implement OO, but they can be emulated (see http://www.lua.org/pil/16.html & http://www.lua.org/pil/16.1.html) as "tables".

- The books and tutorials I've seen on mobile app development emphasize the need to minimize the use of memory resources due to limitations of the platform. For example, objects are often "removed" as soon after use as possible to free up memory. I'm wondering what the impact would be on memory if we use separate classes for the Managers, etc. I've been leveraging the examples I can find in my testing/experimentation with the platform.

No comments:

Post a Comment