git clone git://github.com/jtg2078/Puzzle.git
cd puzzle
git submodule update --init
Lets build a slider puzzle~
This project is about building a slider puzzle app that allows users to move tiles(or blocks) by either tapping them, or sliding them with touches. For the sliding part, the users can slide row or column of tiles if applicable.
To animate the movement of blocks, I've decided to use [UIView animateWithDuration…]
and utilize the duration parameter to control the pace of the animation. The end result is somewhat satisfactory, but it could definitely be better. One other way I can think that could probably give a smoother movement is using [CADisplayLink displayLinkWithTarget…]
to control the position of blocks. Will definitely try it on the next update…
User interactions, primarily the touches, are being handled by UIGestureRecognizer. Two types of gesture recognizer are used in the project, UITapGestureRecognizer and UIPanGestureRecognizer. I choose to use gesture recognizers instead of [UIView touchesBegan…]
and related methods are mainly because they are easier to implement and go rather well with [UIView animateWithDuration…]
. Again, if we are going to use the [CADisplayLink displayLinkWithTarget…]
, then it is probably better to switch to [UIView touchesBegan…]
to handle user touches there.
Testlfight is used(added as submodule)
- add a solver to solve the puzzle step by step
- ability to change the image from a set of images or use the camera to take a picture instead
- optimize the code for handling touches and blocks movement mechanism
- add a timer
- layout and icons