Running a Lua script

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.

Running a Lua script

Getting ready

Please refer to the project RecipeCollection03 for full working code of this recipe.

How to do it...

Lua can be added to your project in a few simple steps:

  1. Highlight your project in the Navigator. At the bottom of your window in the middle, click Add Target:
    How to do it...
  2. Name the target "Lua". This will create a new folder inside your project folder ...

Get Cocos2d for iPhone 1 Game Development Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.