"Holiday"


I've had the last 2 weeks "off". Every single day though was dedicated to developing this application worth 70%. I found it annoying actually. 2 weeks work on something that would pass an entire paper and 2 weeks was enough to barely prepare for it. I have some understanding of programming and yet I could not understand what we had learnt. - Objective-C's syntax is odd. C was easier to understand. If I'd been given a month to learn C and a month to learn Objective-C, I could have decided to build an application and gone and built it without much fuss.

I spent my first week reading Learn C on the Mac. I had meant to finish it by that weekend and start-and-finish the K&R within the week too and have made headway into some Objective-C material. That is a ridiculous goal really. Absorbing and understanding such dry material in a time limit and battling the inevitable attention wandering as you read all about the joys of pointers. By about Friday in the first week I decided it was time to start building the interface of my application. I used one of the tutorials from earlier in the week to build it and connect it via code, sort of making sense of things. But there were so many unanswered questions about the processes behind this very visual way of building an application and how it connects with the code.

I had settled on making an iPhone version of Simon, the game from the 80s.

Original Simon

I was weary about it at first as I thought it might be a bit simple or lack navigation to other views. I couldn't help myself and googled to see if any Simon iPhone apps already existed, and yes they did. I then looked through the iTunes store and yep, there were a quite few. I had been worried that looking at them might influence my design. But I wasn't that impressed with the apps that already existed and I was able to check some comments by users about what they liked and didn't like. This made me realise that while the game is basic, it's very customisable. I could have an options screen. Those options could be saved as user preferences.

I started to make decent progress over the weekend, and I started polishing up the UI with Photoshopped buttons and a textured background.

I had an idea of how one would code the basic game but googled for a JavaScript version so I could analyse that and take anything from it. I found an example and they had built it kind of the way I'd have done it. Well, the beginning part anyway I never got past reviewing the initial set up of the game before I was knee-deep in my own code that I was comfortable with continuing on.

I had a few ideas though: I wanted to give 2 options to game play. Standard is where Simon plays a sequence, progressively adding another step as the game continues. I called this "Advance". The other way was harder, called "Scramble". Each time the user won a round another step would be added, but the sequence would be entirely different.

Another option was an 8-tile game.

Other options added to the options screen was setting the tempo of the game, the timer before you lost, and how many steps in the game was to start. I also originally added volume but slowly got the idea that such a control is somewhat redundant. I think it would have been hard to implement anyway.

I had some major issues that seemed insurmountable. I had a function that plays a tile according to the value of a particular variable handed to it from another part of the program. The other part of the program is a loop that iterates as many times as the game has progressed. The first time I implemented it, it did what I expected it to do, which was play everything too fast - just about instantaneous. My solution was to add a delay, so I googled how one would do that. The standard way(s) unfortunately halted UI updates so the tiles did not light up until the entire sequence had played. Other methods of implementing it confused me, it seemed that the for loop that called that function didn't wait for the function to say it had finished and it could be called multiple times at the same time. Basically a lot of stuffing around was done until I finally gave up and implemented a timer that everything in the application runs in sync to.

Every step in this was difficult because I didn't (and still don't really) understand the syntax, or how and when pointers are implemented, memory management (of which there is quite a bit on the iPhone) so my application leaks like a siv I'm pretty sure.

That said I did manage to get the game running, the tiles lighting up, sounds playing (Which I sampled from a rock organĀ  posted online, the notes are A, D, G, A like the original), play sequences and then waiting (for a limited time) for the user to reply. It has 99 levels (the original has 68 apparently), you can pause the game at any time, mute it (someone wanted that as a feature on a different Simon iPhone game) and atm there is a quit button which is apparently against Apple interface guidelines... Though the home button doesn't quit the game properly. I could replace it with a new game button but then I wonder why anyone would want such a feature... It originally had a new game button beside the quit button but I took it out for that reason. If only I could afford a real iPhone or iPod Touch to get familiar with. Trying to design a HIG-compliment interface when I've only spend about 10 minutes using one is a bit difficult.

I couldn't get the options view to come up until last night (Saturday). This is something I've spend hours mucking around with much like the timer/sync issues. Now I have it poping up I don't really have time to get it to change settings or learn how to save settings. And passing variables between screens isn't straightforward it turns out too.

Simon main screen Simon options screen

I think it will pass me through but I don't think I'll get an A. This annoys me as I don't really think it is possible to get an A, looking at the requirements verses our knowledge. I'll be interested to see what everyone else comes up with.

I have found some really good books on Objective-C and I still have to read the K&R. With this project out of the way I will dedicate some time to it with the view of understanding iPhone/iPad and to a (much) smaller degree Mac/PC application development by the end of the year. I think there is real money in this platform and this will be fulfilling the idea I had early on about this course: It has the potential to pay for itself while studying because the skills it teaches are so current. If I can use what I learn as I go, then doing postgrad is much more likely. Given that there is a certain devaluation in education because there is more of it, I think it's important to not stop at degree level. Not that I ever intend to be a worker Bee making someone else rich ever again. I quite like the idea of multiple (and hopefully passive eventually) income streams that I generate for myself.