Monday, March 9, 2009

iPhone Journal 0xF

(click on images to enlarge)

Today was the start of the final week of my immersion. As promised, I linked all of the views of my application together so that the buttons at the bottom of each view work properly. I then decided to start working on the suggestions Mr. Collias provided me with. First, I edited the mixed piece icon to be more unique, and then I began to implement the Undo button. I created a linked list of object pointers to store each move and rewrote most of the screen touch code to allow each move to be planned out before completion. As visible in the screenshots below, I have added a special square selector icon that indicates the path a piece will follow as it moves. When the switch button is clicked, it now causes an entire move to be completed. With the progress I have made, actually getting the undo button to do something should not be comparatively difficult.
There are also several bugs to work out, including that a memory access error occurs when attempting to re-plan the path that a piece jumps if the jump consists of several steps. Another problem arises when an already visited square is re-visited by a piece in the same turn. I plan to make this impossible in order to make the game more fair and to reduce user confusion resulting from being unable to tell if a square is to be visited twice or not (note the image with 3 white pieces captured and a mixed piece selected). Although I have not attempted this yet, I imagine that jumping over the same piece twice from different angles with a mixed piece is currently allowed, and I need to prevent this.
I am very glad that I have not yet added data persistence because I would have had to rewrite that code had I already done so.
Tomorrow, I intend to finally remove all of the bugs I can find, finish the undo button, and see if I can get started on adding data persistence. With my newfound experience in adding the linked list functionality, the latter should probably wait until I have populated the other views with content and functionality.