Book Image

Sparrow iOS Game Framework Beginner's Guide

By : Stein
Book Image

Sparrow iOS Game Framework Beginner's Guide

By: Stein

Overview of this book

An easy-to-follow guide full of descriptive step-by-step procedures on how to develop a game for iOS. With each topic, a new challenge will be tackled to get a deeper knowledge of the Sparrow game framework and gain the skills to develop a complete mobile experience. This book is aimed at those who have always wanted to create their own games for iOS devices. Perhaps you've already dabbled in game development and want to know how to develop games for the Apple App Store, or maybe you have developed Objective-C apps in the past but you are new to game development. In either case, this book will help with descriptive examples and teach you to develop a game throughout its course. Some experience in Objective-C and a basic understanding of object-oriented programming are required.
Table of Contents (15 chapters)
13
Afterword
14
Index

Creating a file manager


Now, we almost have a manager for all kinds of assets we want to use. The last thing we need is a manager for our data. We know that data assets can be pretty much anything, so we need to descope the use case for managing data assets. Let's take a look at what we'll need right now:

  • Loading a plain text file is always a useful piece of functionality. It could contain game texts or a basic level layout.

  • NSDictionary and NSMutableDictionary are classes we already used and will be using to store data. How about we load a file and its content is converted to a structure similar to that of NSDictionary? The JSON format is very similar to a structure we find in NSDictionary, and luckily, since iOS 5, we have the means of converting a JSON file into NSDictionary without needing any third-party libraries.