O'Reilly logo

Cocos2d Cross-Platform Game Development Cookbook - Second Edition by Siddharth Shekar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Loading the PLIST file data

As mentioned earlier, PLIST is a Mac- and iOS-specific format to store and retrieve data, so it cannot be used for cross-platform game development. It is very easy to create and understand as compared to other forms, such as XML and JSON.

Getting ready

To load a PLIST file, we obviously need a file to work with. In the project file, there are two files: scene1.plist and whackamole_template.plist. Import these files into the project by creating a separate group.

For PLIST, no additional libraries or files are required to import.

A PLIST file is structured similarly to the following:

{ nodes = ( { type = spriteFile; file = "cactus1_00.png"; position = { x = 100; y = 100; }; scale = 1; }, { type = spriteFile; file = "cactus2_00.png"; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required