I am making my first game as a simple puzzle game.
i mew in the game program.
i put image 4 in the view to assign them images, cropping one original image with this code.
int partId = 0; for (int x=0; x<=200; x+=100) { for(int y=0; y<=200; y+=100) { CGImageRef cgImg = CGImageCreateWithImageInRect(whole.CGImage, CGRectMake(x, y, 100, 100)); UIImage* part = [UIImage imageWithCGImage:cgImg];
to get the viewing position of the image in the view, I use this code
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
Now I need that ever one kind of image approaches another representation of the image, then I need to exchange my positions.
for example: part1 go through part2, then part2 to place1 of part one and part1 to place part2.
How can I do this, can someone help me.
This is the right approach to make this puzzle.
Thanks in advance.
source share