Friday, February 27, 2009

iPhone Journal 0000 1000

Today (2/26/08), I planned to get further in my textbook and to plan part of my final project, for which I had some ideas yesterday.
A few years ago, when I was first examining programming concepts using a graphical programming language, I played a game with a friend in which we each tried to use replicating objects to fill a screen as quickly as possible with as few commands as possible. The result of this evolved into an extremely addicting computer game for two players, "Blobs and Globs." Today, we spoke together about the physics that would be involved in simulating fluid on a tilting plane with friction such that a mobile device such as the iPhone could handle the required calculations of an updated version. The only problems with the game in its current form is that a one player implementation is not as good as would be possible with a language such as objective-C, and movement was possible only with two sets of keys that could not be held down to move characters; the key buffer was essentially of length one.
Using the iPhone and its unique accelerometer controls could improve that game to a very high degree and produce a fun game-playing experience. However, creating this game will likely require me to gain at least a beginner's understanding of OpenGL ES, a low level graphics API. In case I am unable to reach this point by the end of this project, I invented a board game several years ago. It is easy to learn, yet very difficult to master, involving strategies at a similar level as Chess. I could easily create an application for the iPhone that implements this game, "Cingo," in two player form. The problem with this app would be training a computer player to be a challenging opponent. Furthermore, the amount of people interested in board games is sadly much smaller than the amount interested in short addicting games with a simple premise.
Finally, I reached what seems to be the end of the C portion of the CS50 Harvard Lectures and finished chapter 7 in my textbook. While I intended to make progress into chapter 8, the final step of the chapter, which is simply to import the AudioToolbox framework into the project proved to be a painful experience. After adding it and pressing compile, the compiler informed me of 416 errors of the type "Syntax error before...". I tried compiling the version included with the book successfully, but deleting the framework in the provided project and reimporting produced the same error. I searched online extensively, and yet no one seemed to have reached the same error. After multiple application restarts, computer restarts, "Clean all Targets" commands, and a great deal of trial and error, I copied all of the files in my project to a blank project. Upon compiling, I got only 7 errors, which I fixed by adding two #import statements. However, when I launched my application, I got a black screen. At that point, I realized that both the new and old projects were likely irreversibly broken, and I am only glad that I have sample code available that does essentially what my application was intended to.
In the future, I will never make any changes to frameworks without making a project backup first. There is no "undo" option to reverse a process of that nature.
Tomorrow, I will forge ahead in chapter 8 and will get an opportunity to ask questions of Mr.Collias' team of programmers. Maybe they will be able to figure out what went wrong with my chapter 7 project.

No comments:

Post a Comment