That sounds super cool. Checking out your script as soon as I can!
I've been using gravity() during a scene's setup to establish the starting position of the device. It works great on my iPad Air. My iPhone 5, however, doesn't seem to get any values from gravity() when run during setup.
To test this, check out the following code: https://gist.github.com/andrewschmidt/8293953
Run on my iPad Air, tilted mostly vertical, this outputs:
Run on my iPhone 5, in any position:
It's worth noting that in my actual script, the gravity() call made after the scene has begun looping works fine on the iPhone. It's only in setup that it doesn't return anything.
I don't know which is the intended behavior, but it can't be both!
And I'm back a couple minutes later with a discovery.
I added a hack-y bit of code—I stuck the gravity() call in a WHILE loop that doesn't end until it gets values different than zero.
This mostly solved the problem on my iPhone. Based on just how it feels to use gravity() to move a rect around, it seems like the accelerometer takes a second or two after it begins returning values to return correct values. I wouldn't expect Pythonista to do anything about that—it's just something devs will have to be aware of.
In summary: Looks like the iPhone 5 is a bit slower about either getting gravity() up and running, or getting values from the system's accelerometer. A little too slow to get any information before a scene has finished with setup.
Curiously I was working on a program that required this very thing—keyboard during scene (it's a typing game).
I don't think I'm likely to finish it (in Pythonista, that is), but it'd be a neat feature. Screenshotting the keyboard isn't so bad, though.
I know it's been forever since you posted this, but I hope you're still working on it! It's a super cool engine, at least, and I'm impressed at how fast it runs!