I want to program a board game (similar to checkers) for the iPhone. Would OpenGL ES or CoreGraphics be a better option? What do most games of this type on the App Store use?
Actually, what I'd suggest in this case is Core Animation or even just UIViews themselves. If you do direct drawing of all of your elements in a single view via Core Graphics, then refresh that view for every animation frame, you'll get horrible performance.
I'd suggest drawing the discrete elements of the game board (pieces, counters, board squares, etc.) as individual UIViews or CALayers, then animating those layers or views around. UIViews aren't too much heavier than CALayers, and they use Core Animation behind the scenes to do simple movement, scaling, or fading animations. They can also respond to touch events. CALayers are useful if you want to build a more cross-platform (Mac and iPhone) game, or if you need to do more complex animations.
For a 2-D game, I'd hold off on OpenGL until you were absolutely sure that you couldn't get the kind of performance you want from Core Animation. OpenGL is a lot less elegant to code for.
For a good example of how to do a board game using Core Animation, Apple has provided the GeekGameBoard sample code. Although it's a Mac application, the Core Animation code can translate right across to the iPhone.
You might also check out cocos2d for iphone - it's a pretty full-featured 2d game library; it's got tilemaps, sprites, parallax, scheduling, etc. I'm using it for my game, and it's helped me quite a bit.
http://code.google.com/p/cocos2d-iphone/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With