iPhone Development

All posts related to iPhone Development.

One Comment

Belajar Membuat Game di iPhone « Heru Prasetia B'loGs  on January 4th, 2010

[...] ada yang mau belajar juga, aku punya 1 web bagus. Coba kunjungi link ini : http://www.71squared.com/iphone-development/. Di web tersebut ada sekitar 12 tutorial iPhone game programming. Di web tersebut, juga disediakan [...]

Learning iPhone Game Programming – available on Safari Rough Cuts

I’m really pleased to announce that my book “Learning iPhone Game Programming: A Hands-On Guide To Building Your First iPhone Game” is now available in Safari Rough Cuts.

The final book will also include video tutorials for many of the chapters in the same style as those on the blog. These are not available yet [...]

Voices That Matter Conference – 24th to 25th April

I just wanted to let you know that I’ll be speaking at the Voices That Matter conference in Seattle, Washington. The conference runs from April 24th to the 25th and has some great speakers such as Aaron Hillegass the author of Cocoa Programming For Max OS X and founder of the Big Nerd Ranch.
My [...]

Collision Detection Methods

I’ve had a few queries about collision detection recently so I decided to share some code I’ve used to detect collisions between two circles as well as rectangles vs circles.
I will be doing a tutorial on this as soon as possible, but for the moment this code could be useful.
In SLQ I am using AABB [...]

If you write it they will come!!

…by they I mean of course the edits to the book. It’s in technical review now and the edits from the reviewers are starting to come through. This is really exciting as I’m starting to see what people think about the book. So far the feedback has been really positive.
I’m due to [...]

Book Update

I’ve had a number of people ask about progress with the book, so I thought I would do a quick post about it.
First of all I’m really excited about getting the book completed and into peoples hands. The great feedback I’ve had on the blog has really helped push this project forward and it [...]

SLQ Video Update

I’ve created a new video of SLQ to show progress. The game is almost complete now so I wanted to show everyone how it was looking. There are a couple of small areas to still fix. I’m still tweaking some sound effects for example and also working on the final map.
So, I [...]

New version of Tiled

The guys over at mapeditor.org have been really busy. They have redesigned their website but more importantly, they have released Tiled Qt 0.4.0. This version of Tiled is a re-write of the Java version using Qt. This version is much quicker than the Java version and looks WAY better too.

This version is [...]

Bitmap Font Update

I’ve been meaning to update the bitmap font code for a while. I made a number of changes to this code for the book as I found problems with the rendering of characters for some fonts. This was done to bugs in my code that positioned each character rendered. I fixed these [...]

Recent readers games

Apologies to those who have sent me information on their games which they have released based on some part on the tutorials. I am behind on getting these mentioned on the blog, but this post should fix that.
I continue to get updates from blog readers who are pushing on and getting their own games [...]

Latest Sound Manager Class

I’ve finally managed to upload the latest version of the SoundManager class. This is the same version I am using in Sir Lamorak’s Quest. There are a few changes from the class in the tutorials. I’ve added some new methods

- (void)playNextTrack;
- (void)addToPlaylistNamed:(NSString*)aPlaylistName track:(NSString*)aTrackName;
- (void)startPlaylistNamed:(NSString*)aPlaylistName;
- (void)removeFromPlaylistNamed:(NSString*)aPlaylistName track:(NSString*)aTrackName;
- (void)removePlaylistNamed:(NSString*)aPlaylistName;
- (void)clearPlaylistNamed:(NSString*)aPlaylistName;
- (void)fadeMusicVolumeFrom:(float)aFromVolume toVolume:(float)aToVolume duration:(float)aSeconds stop:(BOOL)aStop;

Also [...]

Sound Manager Update

Hi all
By the end of this weekend I will post a new version of the Sound Manager. I’ve been introducing music into SLQ and found that there were some features missing from the SoundManager class that would be handy such as named play lists, fading music etc.
I’ve added these features now as well as [...]

The sound of music with Vincent Webb

I’ve been hunting around for a while for the sounds and music I can use for Sir Lamorak’s Quest. As I’m working to a tight budget i.e. nothing, I had dropped the thought of ever getting music created for SLQ specifically. That has changed.

While taking my daily walk through the forums on iDevGames [...]

New Sound Manager Version

If you have followed the tutorials you will know that tutorial 9 covered the sound manager classes. Since the tutorial I’ve been making updates to those classes so that they correctly handle sound interruptions, such as alarms or phone calls. There are also a number of other bug fixes that I’ve added as [...]

Project 72

I came across a site yesterday which is documenting in real time a team of four guys who writing an iPhone game in 71 hours, hence the name of the project.
They all seem to have experience already and hence thought they could create the entire game in 7 days, with the actual game coding being [...]

TBXML – XML parsing on the iPhone

Just wanted to remind people about TBXML developed by Tom Bradley. This is an Objective-C based XML parser for the iPhone that is QUICK and light on resources. It has a really simple API and can be implemented really quickly.
If all you want to do is read and parse XML then this is [...]

Iphone Game Programming – Tutorial 12 – Saving State

I’ve managed to squeeze in one last small tutorial for 2009. I had a request on the blog for a tutorial on saving game state. This is only a quicky and I’ve built it on the code from Tutorial 11. It covers how I’ve used NSCoding to store game state which is [...]

Saving Game State

Just a FYI that I’ve just started to put together a tutorial on saving game state. I had a request for a tutorial on this recently and its something I had to do in Sir Lamorak’s Quest.
It actually sounds harder than it is. I ended up using NSCoding in the objects that I [...]

iPhone Game Programming – Tutorial 11 – Joypad

At last, I’ve finally recorded the joypad tutorial. This is a short tutorial of 20 minutes that covers how to implement a joypad control into the code that has been used through the other tutorials.
Tutorial 11
Tutorial 11 Project
Update 19/12/09:
After a request I’ve created a very simple view based app that does the same as [...]

Happy Christmas

It’s been a long time coming, but I’m actually encoding the Joypad tutorial as I type. Once it’s encoded I’ll be loading it straight onto the blog tonight.
Seeing as it was Christmas and I wanted to say thanks to everyone who has been supporting 71Squared over the last year I forced some time into [...]

Vertex Buffer Objects

A while back I posted on how I had been trying to use Vertex Buffer Objects with the tile map in Sir Lamorak’s Quest. Until recently everything was going really well and then I hit a snag.
Performance on the real device had been great but then all of a sudden dropped to 6fps. I [...]

Sprite Sheet Builder Tool

I have recently found a great tool for creating sprite sheets. I have been using a Java tool called Packer created by Kev Glass who wrote the Java game API called Slick.
The new app I have found is called Zwopple and is currently a web based Flash application, although I think plans are in [...]

On MacDev Podcast

Whilst I was at the Voices That Matter iPhone Development conference I was interviewed for the InformIT On MacDev podcast series talking about beginning iPhone game development.
There are also podcasts of others who were talking at the conference such as Aaron Hillegass, Kevin Avila who did a talk on OpenAL and Erik Buck who is [...]

Sir Lamorak’s Quest Sneak Peak

Hi all
I’ve managed to put together a short movie of Sir Lamorak’s Quest. I wanted to give you all a preview of how the game is coming along and how its looking. I’m really pleased with how its coming along and I cant wait to get the book and the game finished and [...]

Degenerate Triangles

I’ve been working on optimising some areas of Sir Lamorak’s Quest. Most recently this has been reviewing the Tiled class. I was until this week only rendering the tiles of the map that were visible on the screen thereby trying to reduce the amount of work the GPU was being asked to do.
During [...]

VTM iPhone Conference has finished

Hi all
I wanted to thank all those people who made time to give me great feedback on my presentation today as well as those who told me they had been using the tutorials on the blog. It always amazes me how these things spread so quickly and I was nicely surprised at how many [...]

Deadmau5 Ghosts

Navigate your mouse around the mazes collecting cheeses to get rid of the ghosts. Aim for a high-score, get on the leaderboard and stay up-to-date with push notifications. Complete the game and download a free exclusive Deadmau5 track!

Quote from the developer:
We’ve a game just been accepted in the app store – that uses [...]

Two Plus Two

Two Plus Two is a puzzle game that will get your brain flowing.
You are given twelve numbers which you must add together to make a randomly generated number at the bottom of the screen. You get a point for each of the twelve buttons you use. However, you get more points if you [...]

Joystick Tutorial?

Hey everyone
First of all thanks to all those who are still reading the blog and checking out the tutorials. It has been quiet recently due to me travelling on business and Johns wedding and as I’ve said a few times the book is taking up a lot of my time.
That said, I have just [...]

iPhone Developers Conference

I wanted to let people know that I have been invited to talk at the “Voices That Matter – iPhone Developers Conference” in Boston on the 17th and 18th October.
This will be a really great conference with some of the most well known names in Mac OS X and iPhone development on the [...]

TBXML released

Hi all. Sorry for not posting much at the moment and for the distinct lack of tutorials. Things are hectic both at work and with the book. That said I wanted to post tonight about TBXML.
TBXML is a great lightweight XML parser tool that has been created by Tom Bradley. Tom [...]

News: How to become an iPhone app developer

Calling all iPhone users: there’s a resounding future in building iPhone applications -apps in iPhan lingo. So says Apple itself, which sponsors app development conference, provides tools and sells the finished, approved app through its store.
Read More »

News: GDC Austin: Tips for Success as an Indie iPhone Developer

Day two of the Game Developers Conference in Austin, TX began with a talk by husband and wife duo Keith Shepherd and Natalia Luckyanova of Imangi Studios. Keith began the talk detailing the history of Imangi and how they approach making iPhone games.
Read More »

News: Is Granny Coder the oldest iPhone developer in the world?

They say you’re never too old to make a change, and Marie Bila is certainly proof when it comes to iPhone game development.
The 77-year-old Czech granny has been hard at work this year on her physics puzzle iPhone game Gelex, and has been documenting the process on her Granny Coder blog.
Read More »

News: Mono swings .NET development into iPhone

Mono developers have shrunk their open-source implementation of the .NET runtime down to iPhone size. Novell on Monday unfurled MonoTouch, a commercial toolkit that allows developers to use Microsoft’s development framework to build apps for Apple’s ubiquitous mobile.
MonoTouch consists of a suite of compilers, libraries, and tools for integrating with the iPhone and iPod Touch [...]

Shake it all about

For Sir Lamorak’s Quest I’ve just implemented the settings page. I have a UIKit view containing slider controls etc slide up over the game view, pausing the game and allowing you to set the volume etc.
Rather than waste space on the game screen I decided today that I wanted to shake the phone during [...]

Why Apple loves iPhone games right now

Wasn’t the Apple event last night supposed to be all about music? That was the impression given by the invites – ‘It’s only rock and roll but we like it’ – with speculation leading up to the event focusing on new iPods, interactive albums and the possibility of The Beatles on the iTunes Store.
Well, there [...]

What Happens When Apple Features Your App?

BillMinder is our most popular application. It has been in the Top 20 Paid Finance apps since it’s release over a year ago. We recently made a lot of changes to BillMinder and got some unexpected but appreciated help from Apple, <3. We thought we’d share what we did and what it changed.
Read More »

Table View Cells in Interface Builder – the Apple Way™

When Dave and I originally wrote Beginning iPhone Development, the SDK was very much in beta, and a lot of the documentation was incomplete or completely lacking. Given that, I think we did a pretty good job trying to stick with Apple’s “best practices” and at guessing at which techniques would later evolve into best [...]

Interview with iPhone game developer Seung Jee Baek of Leaders Association, Inc.

Q. Tell us a little about you, and your current company.
A. I currently lead the Majestic Interactive Entertainment division at Leaders Association Inc. I am also co-positioned as a technical director. Leaders Association was found in 2003. The company originally began as a management consulting company, but now it mainly focuses on [...]

ObjectiveResource is an Objective-C port of Ruby on Rails’ ActiveResource.

ObjectiveResource is an Objective-C port of Ruby on Rails’ ActiveResource. It provides a way to serialize objects to and from Rails’ standard RESTful web-services (via XML or JSON) and handles much of the complexity involved with invoking web-services of any language from the iPhone.
Read More »

CACurrentMediaTime rather than CFAbsoluteTimeGetCurrent

Hi all
A regular reader of the blog has sent in some interesting information about CFAbsoluteTimeGetCurrent.
It would appear that Apple recommend using CACurrentMediaTime rather than CFAbsoluteTimeGetCurrent. It would appear that CFAbsoluteTimeGetCurrent uses the network synched time which can cause irregular skips in timing. I’ve changes to CACurrentMediaTime and its working well. I’ve not [...]

Presenting in London

Just wanted to let you know that I have kindly been invited to present at the next London iPhone Developers Group meeting. This will be take place at 7pm in the Regents Street Apple store on the 2nd September.
I’m going to be presenting for 20-30 minutes on creating an iPhone game using OpenGL ES. [...]

New SoundManager Class

Just as with the bitmap font class, I’ve also been making changes to the SoundManager class. This new version has fixes which means that is plays nicely with other sounds on the iPhone. Previously if a phone call came in or an alarm went off whilst the sound engine was being used, on [...]

Particle Collider

It you want to see what is possible with the code we have been using in the tutorials check out Particle Collider on the App Store. ExoticPixel have done a great job on this game which has sharp graphics and sound and is very well put together. They have very kindly mentioned 71Squared [...]

Tutorial Code License Details

There have been a number of request in comments about any license which may exist on the code provided from this site in the tutorials and projects. This is something I should have had from the start but I was too interested in just diving into the tutorials to worry about it.
I am more [...]

Sir Lamorak’s Quest: The Spell of Release

The book is coming along and I needed to come up with a name for the game I’m writing with the book. I may come up with something else by the time I’m finished, but the title of this blog entry is my current game title.

I am actually thinking that I would like to [...]

More tutorials to come

Just wanted to let you all know that I am still going to putting tutorials up on the site. Things have slowed down due to work and the book writing, but I’m not intending to let the tutorials slip as its what people really like about the blog.
So, I just wanted to let people [...]

Writing a book

Well, I have mentioned a few times that I have a project which has been taking shape in the background and I am now in a position to share more information.
Based on the success of this blog and the excellent feedback I have received from those using the tutorials I am currently writing a book [...]

Using 3D models from Blender in Open GL ES

One question I get asked a lot is “how do I load 3D models into OpenGL ES?”.
Of course, the answer to that isn’t a simple one. If you followed my my earlier posts on importing Wavefront OBJ files, you’re probably aware of that already. There are many file formats, and none of them are ideal [...]

iPhone Game Programming – Tutorial 10 – Game Structure

You will be pleased to know that the first part of tutorial 10 is now available for viewing. It’s taken me much longer than I would have liked to get this ready, but I’m glad that at least part 1 is out.
This part of the tutorial covers the changes to the project structure I [...]

Black screen of .. urm .. nothingness

A number of blog readers have mentioned the problem of getting nothing but a black screen when running the earlier tutorials under SDK 3.0. This is something which has been discussed in other blog entries, but I should have really done a blog post for it a while ago to save people digging around [...]

iPhone Distribution Build Cheatsheet

Stumbled across this very useful cheatsheet for creating a Distribution Build to submit to the App Store.
http://iphonedevelopertips.com/xcode/iphone-distribution-build-cheatsheet.html

Changes are coming…

I just wanted to let you all know that when I cover Tutorial 10 I will also be covering a number of changes to the overall project.
As I’ve been writing these tutorials and working on my own code I’ve found better ways of doing things as well as I’ve started to find my own style [...]

3D Sound

I mentioned in my Sound Manager tutorial that I was still playing with 3D sound and I didn’t include it in the tutorial itself. Well, I have been playing with it and finally got it working. I’m going to be recording an update soon which will cover fixes/changes to the Image, SpriteSheet and [...]

iPhone Game Programming – Tutorial 9 – Sound Manager

In this tutorial I create a simple sound manager class that can play back multiple sounds using OpenAL. It also allows you to play background music as well using the AVAudioPlayer class.
The reason for writing my own sound manager was to see how OpenAL works. Commenters on this blog provided some great links, [...]

iPhone Game Programming – Tutorial 8 – Particle Emitter

Finally I’ve managed to finish the Particle Emitter tutorial. I got seriously side tracked with other fun things like sound etc on the iPhone, but I’ve managed to focus back on this and get it finished.

This tutorial will go through the creation of a particle emitter. This is a class which can generate [...]

The sound of music…explosions and lasers

One area that I’ve not covered yet is sound. This is going to be in another tutorial but I’ve seen a few conversations starting about it.
When I wrote iServant and needed sound I used the SoundEngine from the Crash Landing example. Whilst I didn’t understand and to be honest did not want to [...]

Video update

So I’ve decided to try something different, which is to provide a quick update on what I’m doing via a screen cast rather than the written word. Its just a small video of around 4 minutes and shows some of the things I’m working on at the moment.
Let me know if you think if [...]

Steering AI

I’ve just finished getting some steering AI working and I thought I’d share what I’m doing.
For some time I’ve been trying to work out how to get my baddies to follow cool paths on screen. The game I’m doing at the moment, with the code that’s going into these tutorials, is a top town [...]

iPhone Game Programming – Tutorial 7 – Singleton Class

This is a small tutorial on how to create and use a Singleton class. Whilst I’ve been creating these tutorials it has become clear that managing state is important in your game. The ability to manage both the OpenGL state locally and also any state related to your game is a key building [...]

Managing state

While I have been developing the tutorials and learning OpenGL, it has become obvious that managing state, both game state and OpenGL state is important. From an OpenGL point of view, being able to identify what state its in such as the currently bound texture, blending options etc is important.

Querying OpenGL for this information [...]

Processing XML on the iPhone

For Tutorial 6 I needed to process an XML document produced by a tilemap editor. I was most disappointed to find that the iPhone SDK does not come with very much in the way of classes to process XML.

The one class it does have NSXMLParser is not bad but its VERY VERY slow and [...]

iPhone Game Programming – Tutorial 6 – Tiled Map Class

The next installment of the 71Squared iPhone Programming tutorials is now available. This tutorial covers a tile map class which can consume configuration files created using the Tiled map editor.
The Tiled editor can be found here.

Tile maps allow you to create large images or playing areas within your game using smaller tile images. [...]

Tutorial Update

Well, I survived my travels and I’m back in the good old UK. I’m about to head for bed as I’m beat, but I wanted to give a small update on how the next tutorial is coming along.
The next tutorial will be on the Tile Map Class. The class is working and rendering [...]

Cocoa with Love: Easy custom UITableView drawing

It is really easy to customize your UITableViews. I’ll show you how to completely customize the appearance of UITableViews without overriding or subclassing and without the need for any tricky hackery.
Direct Link »

Image Class update

In a recent comment under the Tutorial 2 post, Mike Weller pointed out that within the
initWithTexture:
and
initWithTexture:scale:
initializers, there is no retain on the texture being referenced.

This omission could cause the referenced texture to be released outside of the Image class and cause an error next time the Image class instance referencing it is used. [...]

More particles…

Progress is good on the particle system. I have to say though, that without sources such as Cocos2D I would have found it a lot harder :D
I’ve improved the speed by using both GL_POINT_SPRITEs and also Vertex Buffer Objects (thanks to Cocos2D). I can have a 500 particle emitter running on the iPhone, [...]

iPhone Game Programming – Tutorial 5 – Animation Class

Tutorial 5 is now uploaded and ready to view and runs for around 37mins. This tutorial covers the Animation class which allows you to specify a series of sprites which are displayed on screen in order. This class allows you to add any number of frames to an animation and also specify how [...]

2D Particle System

Flushed with how well my code is going at the moment :D I’ve decided that I’m going to have a go at a simple 2D particle system as well. I’ve always thought of these as difficult to write and never tried before, but, given that particles in games looks cool and I’m sure I’d [...]

mainGameLoop changes

I’ve made some changes to my game loop again which I’ve posted below. This game loop can be cut and pasted straight into the EAGLView.m file.

The first change was to add an autorelease pool inside the while loop. This was necessary to resolve a memory leak when using NSString stringWithFormat inside the renderScene [...]

Image class – Horizontal/Vertical Flipping

I’ve made some small changes to the Image class so that images can be flipped both horizontally and vertically. I have placed the changes into the Tutorial 4 project, so if you download the Tutorial 4 project you will get the Image class changes.
To flip an image you use a couple of new [...]

A great resource

I thought I would put a link to some of the resources I use.
You may have already come across this website in your travels, but its a resource I’ve been reading for a long time and just recently asked questions on. I’ve found the advice to be quick, clear and appropriate and its helped [...]

iPhone Game Programming – Tutorial 4 – Bitmap Font Class

Tutorial 4 is now available. This tutorial comes in at around 1:40 and covers both the creation of a new class called AngelCodeFont, but also changes to the Image and SpriteSheet classes. The changes to the Image and SpriteSheet classes was necessary so that I could make use of vertex arrays which significantly [...]

Tutorial 4 Progress Update

I’m working on the next Tutorial this weekend which will cover bitmap fonts. I have found though some performance issues with using glDrawArrays and drawing each image on the screen seperately. The API overhead of calling glDrawArrays for each image puts a real strain on the CPU and can cause your game to [...]

TileMap Class – DONE

HI all, just thought I would do a quick post on Tile Maps. Tile maps have been a part of computer games forever. They allow you to create large images from using lots of smaller images therefore saving memory, but the image they render is only a small part of what they can [...]

iPhone Game Programming – Tutorial 3 – SpriteSheet Class

Hi all and welcome to Tutorial 3 in my iPhone Programming series on creating an OpenGL game.
This video runs for 46 minutes and covers changes to the project so far which are based on feedback I have had in the blog and also the creation of the SpriteSheet class.
Play Tutorial 3

The changes to the project [...]

Wolfenstein 3D comes to iPhone; developer releases source

Id Software has finally made its debut on the iPhone and iPod touch, releasing its classic 3D shooter Wolfenstein 3D for the system. It’s available for $5 from the App Store.
Read more

iPhone Game Programming – Tutorial 2 – Image Class

I have finally been able to upload the second tutorial on writing a game on the iPhone using OpenGL.
This Tutorial has turned out to be longer than I thought and comes in at around 1.5 hours. It covers the creation of an Image class which wraps around the Texture2D class and functions which I [...]

iPhone Game Programming – Tutorial 1

OK, so I have finally managed to get my first video tutorial done for writing a game on the iPhone.
This Tutorial will cover the basics of taking an OpenGL ES Application template available in Xcode and making the changes necessary so that we can use it for writing out game. The game I am [...]

iPhone Game Development…

Flushed with getting my apps on the Apple App Store I decided to try my hand at writing a game on the iPhone.  I’ve done game development in Java as the Sudoku game I posted in an early post shows.  So given games seem to be very popular on the iPhone I’ve decided to give [...]

Custom button in UITableViewCell – indexPath

Hi all
I am currently working on iPhone app number two when I came across a problem that it has taken me a while to sort out.  I wanted to place a button inside each UITableCell I am displaying.  I then wanted to call a method when the user pressed that button which would perform some [...]

Programming the iPhone

I don’t write software at work anymore, although I used to be a developer years back, but I still enjoy writing software at home for my own uses.  My main area of interest at the moment is Java and writing 2D games in it.  I’ve got a couple of projects on the go which I [...]


Twitter (@71squared)

About the authors

John is a Web Developer working in Perth, Australia for Bouncing Orange - graphic + web design.

Mike works for the largest enterprise software company in the world.

They both love technology, especially Apple and dabble in iPhone dev in their spare time.