lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


----- Original Message -----
From: Mark Feldman
Date: 4/27/2010 6:00 PM
Joshua Jensen wrote:

> As near as I can figure, the only way I can ship levels for a game is to embed them as raw > C code in my application's executable, because the mere act of interpreting the data is bad.

Nonononono, that's exactly what Adobe's Flash-to-iPhone compiler was doing and it's explicitly forbidden in the new guidelines. Quote:

- "Applications that link to documented APIs through an 'intermediary translation or compatibility layer' are strictly banned" - "Applications must be originally written in Objective-C, C, C++, or JavaScript"

Running your "<Width>5</Width>" XML script through a custom pre-processor to convert it directly into a "SetWidth" call and statically binding that to your application would clearly violate this, God help you if you get caught!

(rolls eyes...)
Funny story: Many years ago, I wrote a text adventure on a Commodore 64. I didn't know about data structures, and I coded every location in the text adventure directly in BASIC. I would test for a direction, and when the user decided to go North, I would GOTO the appropriate line number for the room located to the North. It was spaghetti code galore!

Reading Apple's rules literally, they can be understood to mean I have to code my levels directly in C, just as I did my text adventure all those years ago.

But translation into the SetWidth() call directly wasn't what I was thinking of. What I was actually thinking was memory overlays. If a block of data is read directly into memory and no further processing is performed, that should be okay. If I parse through the binary data and make it do various setup functionality, including pointer fix ups, I think I fail Apple's legal requirements.

What truly makes me sad from a Lua perspective is I have become used to using coroutines within the game to do things like tutorials. Now, I have to write massive state machines to accomplish the same effect. Oh, well.

In any case, I'm still going to use Lua for my data formats.

Josh