Get Updates By E-mail 

Article Written By:
Johann Dowa

iPhone Game Development With Core Animation

  •  
  •  
  •  
  •  
  •  

I’ve made quite a few posts about OpenGL ES, and the available game engines on the iPhone, and I’d like to iterate that you do not need to use OpenGL ES or any game engine.  Core Animation can be used for iPhone game development, and if you’re used to Objective-C/Cocoa it may be the easiest route.

There are some caveats to using Core Animation, for one, you can get better performance from using raw OpenGL ES, and it can be somewhat tedious to use in instances where you may want to micromanage the animation of a graphical object.  Also, while there are 3D transformations available Core Animation is designed for 2D graphics.  All this being said, Core Animation is great for games such as card games, and board games.  A huge advantage of Core Animation is that you can lay out your components using interface builder which can be a real time saver, as all the graphical components are inherited from UIView.

You wil want to check out the manual on Apple’s official Core Animation Programming Guide here:
Core Animation Programming Guide

While much of that guide is for Mac, you can also check out the Core Animation Cookbook:
Core Animation Cookbook

As far as code samples go the best example I’ve seen is the fantastic Geek Game Board, and an iPhone compatible version with some updates beyond the Mac version available at the Apple site is here:
http://bitbucket.org/snej/geekgameboard/

and for those who have trouble downloading the source can find it here:
Geek Game Board From Bit Bucket

I was able to get this example compiling to iPhone OS 3.0 straight out.

I also have some examples on doing some simple animation that can be used in iPhone game development here:
Easy Fading Buttons and Images
Scaling Images & Button

What makes the GeekGameBoard example so good is that it includes board games, and card games (specifically Go, TicTacToe, Hex, and Klondike) that you can use as a framework which includes cards, boards, and pieces that you can use in iPhone game development.  This should get you off to a very fast start.


  •  
  •  
  •  
  •  
  •  

Submit A Resource

Have you created a useful tutorial, library or tool for iOS development that you would like to get in front of our 300,000+ monthly page views from iOS developers?

You can submit the url here.

The resources we feel will appeal to our readers the most will be posted on the front page.

Comments