views:

241

answers:

1

I am trying to build 15-puzzle game.

Here I need to swap a blank image with a clicked on image. I would like to know how to swap these images.

I have stored the co-ordinates of the two images,but don't know the format to identify the blank image and then set its origin to clicked image.

+1  A: 

Present each tile as a CALayer. To swap two tiles, set each layer's position to the other's position.

Peter Hosey