tags:

views:

2163

answers:

3

Are there are libraries / frameworks that facilitate 2D game programming in Lua on the iPhone?


It looks like http://anscamobile.com/ and http://sio2interactive.com/GAMES.html are the only reasonable options at this point. Someone should create a simple Lua binding for OpenGL, AL and iPhone Events for the iPhone!

A: 

I'm trying out SIO2 as it apparently supports lua.

While it is for 3D and may be overkill for 2d it looks pretty powerful. Just make your models in 2d and fix your camera position.

--jdkoftinoff

jdkoftinoff
Thanks for the link!I think this is overkill. Something with Lua bindings to OpenGL, OpenAL and a way to receive events from the phone would suffice. I just don't want to deal with writing bindings.
richcollins
+1  A: 

There has been a fair amount of discussion of Lua on the iPhone on the Lua list. It appears that Apple is touchy about allowing user-supplied scripts, but has approved apps that used Lua internally as an implementation language.

I know I've seen reference to several approaches to wrapping iPhone goodies mentioned, but since I'm not personally an iPhone developer (or even user) I haven't paid attention to the details.

RBerteig
That's surprising. I figured Lua would be a no-no based on my reading of Apple App Store Law.
Nosredna
It is forbidden for any scripts that aren't initimately packaged within the app to be runnable. You can't ship an app that has a Lua command prompt that will `dofile()` any file the user wants, for example. But there are several ways to use Lua as an implementation language that hides it within the app without the ability to load arbitrary scripts. The claim is that there exist apps that were approved that included Lua internally.
RBerteig
Personally I like Google Android's approach where they embrace Lua as the preferred way for users to script their own phone...
RBerteig
From my research, you can't download and execute scripts. You can load scripts from your app wrapper. AFAICS, this is to prevent you from adding features without having them first reviewed in the app store.If anyone has any evidence supporting Apple rejecting scripted apps that don't allow loading of external scripts, I would love to hear it.
richcollins
@Rberteig. I don't know. It seems pretty clear to me that even embedded interpreters are forbidden, but I would not be surprised if some got through approval.
Nosredna
The famous case is PhoneGap. Many accepted and many rejected and very hard to tell which one for what reason. The problem is it's all rather opaque. I just checked the Google Group and there are still rejections, but the good news is that recent rejections say that Apple is contacting PhoneGap developers for changes to be made. I'm delighted if Lua is an option for scripting. But I'd be nervous about trying until there's more clarity from Apple.
Nosredna
I just read this one a Scheme for iPhone post: "... For 3.0, Apple modified their developer agreement to exclude any interpreters whatsoever, regardless of whether code was downloaded or simply run locally." http://jlongster.com/blog/2009/06/17/write-apps-iphone-scheme/
Nosredna
@Nosredna, that would seem to be a bad move from where I sit, given the success of the engine with scripting architecture used in so many set-top boxes, and in light of Android promoting scripting as a first-class capability even for end users.
RBerteig
To me, the biggest problem is lack of clarity. I can deal with almost any rule as long as I understand it.
Nosredna
I don't see how Apple is forbidding interpreters. What they seem to outlaw is *compilers* for other languages, not interpreters like Lua and some Schemes.
munificent
+1  A: 

@richcollins: Actually, as of late last year you CAN test on the physical device using Corona (anscamobile.com).

If you want to check this out, download the free trial at developer.anscamobile.com, and it'll let you make developer builds for your phone.

The full version will also make App Store builds -- feel free to email support (at) anscamobile.com if you have further questions.

Evan Kirchhoff