Game Development Reference
In-Depth Information
the lead programmer at LucasArts (of Grim Fandango fame), wanted to replace their scripting
language SCUMM with Lua. This drew interest from other developers, and Lua started to appear on
newsgroups.
Starting with Lua
One important point that I'll make throughout the topic is that, with Lua, it doesn't matter what
framework you use; what's important is the glue that holds it all together: Lua. In the '90s, Microsoft
was pushing client-server and three-tier architecture (similar to what Apple has been pushing as
MVC [Model-View-Controller]). The idea behind MVC is that it involves three distinct portions: a
model , which takes care of the data; a view , which displays the data from the model and provides
interaction with the user; and a controller , which communicates between the model and the view,
as these two do not have any idea of each other's existence. The controller is the broker that helps
the two talk to each other. The most usual way to work with MVC is to use a framework, which takes
care of a lot of the details for you.
In this topic, I shall cover a few frameworks: CoronaSDK, Gideros Studio, Moai, Codea, and LÖVE.
All of these except LÖVE help develop and run apps on the iOS platform. The architecture of a
Lua-based mobile app is simple, as the diagram in Figure 1-1 shows.
Figure 1-1. The architecture of an app using Lua on a mobile device platform
An application is made up of all the resources graphics, music, text, etc.), which are compiled into
the application, with the Lua code along with the framework stub. When run, the framework or the
engine creates an OpenGL surface on which all of the graphics are displayed. This is how all of
the frameworks work, and this is how they can offer cross-platform compatibility. The limitations on the
framework are imposed mainly due to either the limitations of OpenGL or the framework engine.
 
Search WWH ::




Custom Search