I'm developing a simple game, where one can move a character through a maze. To avoid collision detecting i thought it might be a good idea to set a path through the maze and move the character along this path.
The character shall be moved via touch. So i thought i can just test if the touchlocation.x or touchlocation.y are contained in the path and then set the characters image on the location corresponding to either the touchlocation.x or touchlocation.y value.
Unfortunately i found out i can only test if a CGPoint is contained in a path and not if the x or the y coordinate of that point would be on that path.
Does anyone of you know how to do this?
thx in advance
Mav
----EDIT----
This is the code how i create my CGPath:
mazePath = CGPathCreateMutable();
CGPathMoveToPoint(mazePath,NULL, 148, 723);
CGPathAddLineToPoint(mazePath, NULL, 148, 404);
CGPathAddLineToPoint(mazePath, NULL, 129, 353);
CGPathAddLineToPoint(mazePath, NULL, 129, 174);
CGPathAddArcToPoint(mazePath, NULL, 129, 174, 148, 404, 10);
CGPathAddLineToPoint(mazePath, NULL, 148, 404);
CGPathAddLineToPoint(mazePath, NULL, 290, 640);
CGPathAddArcToPoint(mazePath, NULL, 290, 640, 326, 196, 10);
CGPathAddArcToPoint(mazePath, NULL, 326, 296, 359, 234, 10);
CGPathAddLineToPoint(mazePath, NULL, 395, 198);
CGPathAddLineToPoint(mazePath, NULL, 396, 147);
CGPathAddLineToPoint(mazePath, NULL, 683, 147);
CGPathAddLineToPoint(mazePath, NULL, 683, 232);
CGPathAddLineToPoint(mazePath, NULL, 480, 232);
CGPathAddLineToPoint(mazePath, NULL, 461, 332);
CGPathAddLineToPoint(mazePath, NULL, 235, 345);
CGPathAddLineToPoint(mazePath, NULL, 219, 248);
CGPathAddLineToPoint(mazePath, NULL, 235, 345);
CGPathAddLineToPoint(mazePath, NULL, 233, 607);
CGPathAddLineToPoint(mazePath, NULL, 324, 605);
CGPathAddLineToPoint(mazePath, NULL, 324, 464);
CGPathAddArcToPoint(mazePath, NULL, 324, 464, 364, 425, 10);
CGPathAddLineToPoint(mazePath, NULL, 537, 426);
CGPathAddArcToPoint(mazePath, NULL, 537, 426, 559, 396, 10);
CGPathAddLineToPoint(mazePath, NULL, 559, 396);
CGPathAddLineToPoint(mazePath, NULL, 567, 330);
CGPathAddLineToPoint(mazePath, NULL, 678, 330);
CGPathAddLineToPoint(mazePath, NULL, 678, 504);
CGPathAddLineToPoint(mazePath, NULL, 412, 510);
CGPathAddLineToPoint(mazePath, NULL, 412, 598);
CGPathAddLineToPoint(mazePath, NULL, 691, 598);
CGPathAddLineToPoint(mazePath, NULL, 690, 723);