I don't see any syntax errors in that code, except that you declared "UITouch *touch" twice in the same method. The second time you assign that variable you don't need to declare it again, just assign it.
There is some kind of logic error though - startTouchPosition and currentTouchPosition will always be the same, they'll always be the location of the touch as it moves. You probably want to make startTouchPosition an instance variable and set it in touchesBegan; then you can get the distance from the start of the touch to the current position, right?
Now that you have your array of stopped blocks, you should be able to use the same trick for your jumping guy. Compute his next position, then see if his new position frame touches a stopped block.
__________________

Free Games!
|