Third-Party Code
By now, it should be painfully apparent how much hard work and expertise go into making even small games. It’s almost overwhelming, but fear not! You don’t have to reinvent the wheel; no matter what type of game you are creating, reusable bodies of code are available that can supplement many parts of your game engine. They come in the form of libraries, middleware, and even fully fledged open source games.
Libraries
The iPhone SDK makes available many low-level Apple APIs (such as Core Graphics and Core
Audio) and mid-level APIs (such as NSUserDefaults, NSImage, NSSound, and NSNetService). But you are not limited to
these alone; many other libraries are available, and some even come with
the SDK (such as OpenGL and OpenAL).
Libraries exist to help you with sound, networking, and many other tasks that you might find too low level.
Perhaps you want to store and organize large amounts of data; SQLite provides database functionality on the iPhone. Most likely you don’t want to write volumes of linear algebra code for your 3D physics; that’s OK—Newton, Open Dynamics Engine, and Bullet have beat you to the punch. For a really cool 2D rigid body physics library, you should check out Box2D.
The iPhone is a relatively new platform and new libraries are still being made available. Fortunately, the iPhone shares a lot of code with the OS X platform, so many libraries that work for the Mac can be used for the iPhone with a little tweaking.
Middleware
If your goal is simply to make ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access