I have a question.How can I achieve the jumping up and down effects (swiping left and right effects too.) in iphone gaming using cocos2d and box2D just like in temple run and subway surfers apps.Any ideas would be appreciated.
Asked
Active
Viewed 672 times
-4
-
Fails the fundamental question "what have you tried"? – casperOne Jun 14 '12 at 18:23
1 Answers
1
You'll want to look at UISwipeGestureRecognizer. For help with getting swipe gesture recognizers working with Cocos2D, look here.
The short rundown is this:
- Set up your gesture recognizer (direction, number, selector/target).
- Attach gesture recognizer to the glView
- Set up event to fire when a swipe is detected. This is where you'll do the jump up/down stuff.
- Tear down the gesture recognizer when you no longer need it.
A side note, a little bit of research does wonders. All of this information is available with a quick google search.

Community
- 1
- 1

CrimsonDiego
- 3,616
- 1
- 23
- 26
-
Why did you downvote for my question.Is there anything wrong in clarifying my doubt? I would appreciate if you don't do that next time.Anyway thanks for your quick reply. – jessy Jun 14 '12 at 17:11
-
Your question was ill-formatted, and you did not do your own research before posting. Looking at the vote count, I was not the only person to feel that way. I did, however, try to be nice by providing you with a starting point. – CrimsonDiego Jun 14 '12 at 18:22