-
Book Overview & Buying
-
Table Of Contents
Cocos2d for iPhone 1 Game Development Cookbook
By :
Many commercial games make use of a scripting language to isolate and abstract their game logic. The most popular of these is Lua. In this recipe, we will integrate Lua into our project.

Please refer to the project RecipeCollection03 for full working code of this recipe.
Lua can be added to your project in a few simple steps:
Highlight your project in the Navigator. At the bottom of your window in the middle, click Add Target:

Name the target "Lua". This will create a new folder inside your project folder next to your main target's similarly named folder. It should also create a new group.
Download the Lua source from http://www.lua.org and copy it to this folder.
Right-click the Lua group and select Add Files to " Your Project ":

Navigate to the src directory and add all the files located there except for lua.c, luac.c, Makefile, and print.c. Also, be sure to uncheck Copy items into destination groups folder and select only Lua under the Add to...
Change the font size
Change margin width
Change background colour