Learning IOS Game Programming

Michael Daley, Mike Daley

Mentioned 3

Provides information on how to build a successful iPhone game and includes instructions for creating a 2D tile map game.

More on Amazon.com

Mentioned in questions and answers.

I am trying to import "EAGLView.h" in xcode 4 and am following the instructions given by the tutorial in the book http://www.amazon.com/Learning-iOS-Game-Programming-Hands-On/dp/0321699424/ref=sr_1_1?ie=UTF8&qid=1334873430&sr=8-1 . The book was written for previous versions of xcode so I am wondering if the EAGLView.h class has been phased out or if there is something special I need to do to import it?

When i was creating the new project I selected OpenGL game if it makes any difference.

As I explain in this answer, EAGLView isn't a built-in Cocoa Touch class. Apple started using that name for a custom UIView they used in their initial sample applications, and so many people copied and pasted that code that many developers started thinking it was built in to the system.

In general, all that these custom UIViews had in common was that they overrode the +layerClass method in this fashion:

+ (Class)layerClass 
{
    return [CAEAGLLayer class];
}

This indicates that instead of using the standard CALayer for backing this UIView subclass, this particular UIView will be backed with a CAEAGLLayer. CAEAGLLayers are what host OpenGL ES rendering content, so you'll need something like this for your OpenGL ES application.

I have, most of the time, 50+ FPS, but when I load resources(background tread) it drops to 30 FPS. I want to have constant FPS, 30 or even 20, it's not a problem for me. What is the best way to make FPS constant?

You should be using time-based redrawing, instead of frame based drawing. Michael Daley's book has some excellent info on this.

Also, try loading as many of your resources as possible in a spritesheet.

I just wanted to know some initial things before developing 2D games. I have developed 4-5 apps for iPhone in my career and am very much familiar with programming on iphone, but this is my first time developing a 2D game. I want to develop a game in which mountains and trees etc are constantly moving in background and a man or any living thing is running forward having so many obstacle in its way. He has ability to jump over obstacle etc.

I have no idea about Cocos2d or openGLES or Quartz 2D. I guess its important to choose the best template for 2D game development otherwise i can go in the wrong direction. Please guide me who have experience in 2D game development in iPhone. Any books or links for tutorial is highly appreciated.

Realated tags

iosios5iphoneopengl-es