Minesweeper (Part 9)

Today we finally submit our Minesweeper clone to AAPL for approval. Let’s see how that goes. In the meantime, you can download the latest source code here.

Allow me to offer two words (well, “paragraphs”) of warning about the project’s default configuration (“Simulator – 3.0 | Debug”):

  1. If you execute certain perfectly legal Core Graphics code in the 3.0 Simulator, you generate a lot of very worrying memory management errors. I wrote a little bit about it here. You can ignore(!) the errors, or run against the 3.1 (or later) Simulator.
  2. In-app purchases don’t work in the Simulator at all; if you want to exercise this part of the code, you’ll need to run it on a device.

Incidentally: I wouldn’t say that implementing in-app purchases was hard, per se, but there were a lot of little things to run down. (E.g., if you don’t have a network connection, the store kit doesn’t report an error when you request product descriptions: it just never returns a result.) It took a while to get all that sorted out, but much of the resulting code should be reusable.

Future Features

Some features that we might add in version 2.0 of the game:

  • Auto-Clear 2.0: We might extend our current auto-clear logic to consider flags: If an uncovered cell has N mined neighbors and N flagged neighbors, all remaining neighbors are automatically uncovered.
  • Auto-Flagging: We might add logic to automatically flag cells: If an uncovered cell has N mined neighbors and exactly N covered neighbors, all those neighbors are automatically flagged. (Of course, this sort of thing could quickly get out of hand, both from a performance and a gameplay-ruining point of view.)
  • OCD Mode: A play-tester suggested an “obsessive-compulsive mode”: Untimed, with no auto-clear support.
  • No Guessing: We might revisit puzzle generation, altering it to generate puzzles that can always be solved deterministically. This might be an interesting little algorithm problem. It also might be a tedious slog.
  • Safe/Zero First Move: We might add some mechanism to ensure that a user’s first tap is always on an unmined cell, or possibly on a cell with no mined neighbors at all.
  • Safe Taps: In general, the fact that you touch the playfield to both move it and uncover cells on it doesn’t cause too many problems. The one use case that is a little tricky has to do with stopping the playfield in mid-scroll: If you put your finger down to stop the field from moving, and then lift the finger without moving it, the game will often interpret that gesture as a tap, possibly uncovering an unintended cell. I’d like to make this better, if possible.
  • Reveal on Failure: We might expose all covered mines after the player loses a game.
  • Rotation: It would be nice to support both landscape and portrait orientations.
  • Zooming: I’d like to go back to a fully zoomable vector graphics implementation, if the performance problems can be addressed.
  • iPad: I haven’t done much with the iPad; it would be interesting to experiment with tailoring this app’s UI for the larger device.
  • Sound!
Share and Enjoy:
  • Twitter
  • Facebook
  • Digg
  • Reddit
  • HackerNews
  • del.icio.us
  • Google Bookmarks
  • Slashdot
This entry was posted in iPhone, Projects. Bookmark the permalink.

Comments are closed.