Musings of a programmer

A blog where I discuss mainly iPhone programming and the things that are on my mind related to said programming.

What to do with down time?

We are currently waiting on a new batch of art assets to come our way before we can continue with development of Ingot and some of the other projects we have going. The question is, how do you spend your time when you’re idle? Cody and I try to have at least one weekly meeting to discuss where we’re at and what we need to be doing. Having those weekly meetings definitely must take place whether you are busy or not. I’ve found it keeps us on track. Since we don’t have any definitive deadlines, staying on track is something that is a challenge for two independent iPhone developers. We definitely have not had a perfect track record with scheduling. We released our first(and only) application to the App Store in December of 2008. We released one update in February of 2009. Since then, we’ve been met with pitfalls and delays. Some being out of our control, others were probably our fault. We hope to release the new update to Ingot in a few months. But, we now are reliant upon another person. So, this throws another wrench into the machinery.

I guess the main reason for this post was to let you indy developers out there know that you need to set deadlines whether you meet them or not. And don’t get discouraged if you go over. Just try that much harder to meet the next deadline. And don’t waste the down time you have. Stay productive.


If you’ve looked at my earlier posts, you’ll notice that on the main screen on Ingot, we have an Openfeint button. Openfeint is an open source application that you can integrate into your iPhone applications. Openfeint is very similar to Xbox Live, in that it can track achievements, leaderboards and it also keeps a friend list. The interface is very slick and has a polished look. And, it makes it so much easier to implement achievements. Before my friend and I heard about Openfeint, we were in the process of implementing our own achievement system into the game. This wouldn’t have taken too long, but it would not have looked nearly as good as what Openfeint provides. Many iPhone games use Openfeint now: Fieldrunners, Desert Chronicles and Plushed just to name a few. It has quickly become the thing to use to create a more seamless experience when you use application on the iPhone. They truly are the coolest thing since sliced awesome.

Creating a level select screen.

Currently, I have been working on trying to create the new level select screen for Ingot. This is what the screen looked like before.

We decide that this screen could definitely look better. Also, if we ever decided to add more than 20 levels, we would have to implement some sort of paging system. Here’s is the current state of the screen(this isn’t the final design).

Now, players will be able to scroll through levels, which eliminates real-estate issues. Also I think the design is much slicker and more intuitive. The level ranks(the letters) are a little pixelated so they will have to be redone, but overall I think this is a much better design.

Coding with Cocos2d

Cocos2d is a framework for building 2d graphical applications(games,demos, etc…). We are in the process of implementing this into Ingot. It’s a much easier way of creating animations and placing the art assets on the screen. Below is some sample code:

These 4 lines of code basically move a sprite to a certain position, waits for 1 second and then eases in as it moves, which means the speed slowly increases as the sprite is moved. All of these animations are then put into a sequence object and then the sprite to be moved calls the runAction method where you would supply the sequence. It’s all a little foreign at first, but it is actually quite simple once you get the hang of it. Let’s break it down:

First, declare an id variable. This is basically a generic type.

Next you decide on the type of animation you want. Cocos2d provides many animation types(MoveBy, MoveTo, FadeIn, FadeOut,etc…)

Most animation types accept an actionWithDuration parameter that is of type double. This just tells the program how long it has to complete the animation. Typically, the lower the number, the faster the animation. Next is position. Call ccp(x,y) where x is your x-value and y is your y-value. If you were calling MoveTo, this means that the sprite would move from its initial position to the ccp(x,y) value you gave it.

Sequences are just a way of bundling animations together to get the desired effect. You could just call one animation or create a sequence of animations.

And that’s all there is to it!

This is the current state of our game out on the App Store. I am posting these so you can see the difference in the quality of art when a computer programmer creates art vs. an actual graphic designer. Ignore the lightning bolt on the second image. We’re experimenting with creating a lightning effect in-game. Other than having a better artist, we have changed our programming approach. In the first iteration, we used NSObjects and Quartz for the animations. This time around, we’re using an open source project called cocos2d to do all the animations. This has made it much easier and faster to program. In the next post, I’ll put up some example code.

Creating iPhone games

The process of creating games for a portable platform was new to me when my friend and I decide to dive head first into iPhone development. We both had iPhones and we knew a few independent developers who had made quite a bit of money off of their applications. We wanted a piece of the action. We had an idea for a game and started working right away. The initial cost for iPhone development is:

- 100 bucks annually to be an iPhone developer

- You’ll need a Mac computer if you don’t already have one(Macbook, iMac, etc…)

- Time(for developing and learning Objective-C)

- A website(for application support)

So, there’s quite a bit in terms of cost to even get started. I didn’t have a Mac so after all was said and done, it cost me about $1,100 to just get started developing.

It took us a little over a full month of development to finish our first iPhone game, Ingot(which you can find on the App Store for $2.99. Shameless plug :P). This was our first attempt and we did everything: from sound to art to coding to promoting, everything was done by two people. It was a lot of fun and I am so glad I got to be able to be a part of creating something.

The down side here is that, so far, we haven’t made hardly any money at all. We got a few reviews, most are positive but we’ve had some bad ones. We’ve learned a lot from our mistakes and are currently working on releasing an updated version of the game.

This blog will focus on showing exactly how our progress is going this time around and pointing out the mistakes and triumphs that occur along the way. We are currently in the middle of several iPhone projects so some of the posts won’t be just about Ingot. We are also working on a Tea Timer application and other game projects as well. Hope you enjoy!


My buddy( turned me on to Tumblr so I am trying it out. I think this blog will focus on something that interests me and something I think needs more attention: programming for the iPhone. I will attempt to share my experiences in programming for the iPhone and provide example code and other tips that would help any would-be developer.

Fixed. theme by Andrew McCarthy