iPhone OpenGL ES Gaming Framework Update

Its taken me a few days to port over some of my XNA stuff to the iPhone SDK, but it looks as if the current framework is starting to take shape. So what do I have so far? Currently the framework’s feature list is as follows;

– Started with a base OpenGL project template. This template was written by Jeff Lamarche of iPhoneDevelopment fame. He also helped write the “Beginning iPhone Development; exporing the iPhone SDK” book (amazon link HERE ) the template can be picked up at Jeff’s blog post located: HERE

– From here, I converted the GLViewController into my screen manager class. This screen manager is heavily inspired by the XNA Development Team (creators.xna.com) for use with the XNA Framework for writing C# programs. This screen manager will manage all game screens, updating and displaying their contents, and even filter all user input to the screen that is currently active.

– The GameScreen class structure, where GameScreen is the parent class of any screen I wish to create. Right off the top of my head, in the game I am currently writing my design doc for, I will have several screen classes inheriting from GameScreen, including TitleScreen, MainGame, Paused, and Achievements.

– Several helper classes such as RandomNumber for random number generation and Apple’s Texture2D class which is a life saver for getting textures and text to screen.

Right now, this is the extent of the gaming framework, but eventually I will need to add sound support and various other things. As of my progress? I have been tinkering with things and was able to get touches and game flow working. The following two screenshots demonstrate this, where the first screen shot shows nothing but 3 buttons, and the 2nd screenshot shows what would happen if you clicked inside one of the buttons.

Exciting huh? Well there is much more work to do! I have not posted the code to any of this stuff yet, because it is incomplete. I am not sure if I will be writing any tutorials on the gaming framework, but if there is enough demand than I will.

Being able to get the gaming framework set up will be a great step forward. It means I can take more time working on the actual game, and less time setting up things like the screen manager every time I want to start a new project!

Happy coding everyone! Let me know what you all think should be included in a gaming framework such as this!

Advertisements

3 comments so far

  1. tabularasa on

    I’d be interested in seeing code/tutorials on this project once you feel that it’s ready.

  2. Andrew Wilson on

    I’ve just happened across your blog while I was researching how to port an XNA game I was working on, to the iPhone, and figured this blog might be quite useful. Code samples would be appreviated, but first I’ve got to brush on my obj-C. I take it 2D stuff is a lot simpler than 3D stuff, can you actually miss out the OpenGL when dealing with 2D graphics?

    Keep up the blogging :D

  3. Craig on

    @andrew
    3D stuff can be more difficult, but its really all as to how you approach it. What kind of XNA projects were you involved in? Most of mine were 2D, in fact my Dream Build Play was a HEAVILY modified version of the RPG Starter Kit with custom tile engine / battle / quest / movement systems.

    I actually just finished converting the screen manager to Obj-C, and getting it to work within the iPhone SDK. Tested it out last night and it works great. Its just a conversion of the GameState Management system from XNA, so if you’ve used that you’ll feel right at home. I’ll be posting a little about that in the coming days.

    EDIT: If anyone has a good tutorial on how to set up a template file, I could actually just make a template with the screen manager and everything included… and put it up for download with the writeup.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: