This is easy to change and give more level to your games. It contains all the base information for your game and you can change it very easy.
This is good for Sprite Kit, too. All this come from Apple so they will perfect with other.
So first we should know how to create a Plist File:
+ Just create a new File in your Xcode project and you will see it from
* This time you only need to create your pList to start store your data. This will be constructor like this:
- You have 2 types of collection data to store an data with have many properties: Dictionary and Array
+ Dictionary to store the different type of property
+ Array to store to similar property for your object
- The other types is used to store the data for you to use this:
+ Boolean
+ Data
+ Date
+ Number
+ String
- This will very easy to get your data from pList:
NSString* lkPath = [[NSBundle mainBundle] bundlePath];
NSString* lkFinalPath = [lkPath stringByAppendingPathComponent:@"LKGameData.plist"];
NSDictionary *lkPlistData = [NSDictionary dictionaryWithContentsOfFile:lkFinalPath];
=> This code will get all the data from pList for ready to create your level.
- You can check all the property in this pList by using:
NSLog(@"The property list contains: %@", lkPlistData);
=> This code will show all your property list in this pList and you can check them for right input
No comments:
Post a Comment