views:

529

answers:

1

Let's say you have a game board where you have tiles, like those where its a picture and its scrambled but you have one empty tile. So you drag a tile around until you can reassemble the picture. You have a 3x3 or 4x4 (doesnt matter) matrix with one empty square.

example:

http://www.kirix.com/extensions/sliding-tile-picture-puzzle/

What I'm interested in is the mechanics of the dragging and placing. So you select a tile next to the blank spot, and drag it to the open spot and release. it then 'stays' put.

has anyone a source example of such a game?

A: 

Apple has a sample for a board game (GeekBoardGame), although it is for OS X and not iPhone, so you will have to replace the mouse code for the cocoa-touch equivalent.

The original author updated the code and now it works on iPhone too.

Marco Mustapic