Hello fellow programmers! A question about a circle's angle.

Discuss issues specific to using Box2D on the iPhone
Aris
Posts: 1
Joined: Thu Mar 28, 2013 9:20 am

Hello fellow programmers! A question about a circle's angle.

Postby Aris » Thu Mar 28, 2013 9:36 am

Hello guys, I am new here, this forum seems to be very helpful. So, in the reason I created this topic. I am trying to learn box2d in cocos2d. I have searched for online tutorials and ray Wenderlich's seem to be the best ones!I am learning in a slow but steady pace! I am currently developing an app in which I will include a ball in the screen, and every time I touch/tap this ball, it is going to move like someone is flicking a soccer ball. I have coded the part for the upward movement of the ball, when touching/tapping it. The problem that I encounter is that I can not find a way to give the ball the appropriate angle in order to rotate. Let me give you an example. Imagine you are flicking a soccer ball, you kick the ball upwards but also there is a spinning force on the ball. I am trying to develop the spinning part. I would like to touch the ball, in its lower right "corner" for example and spin and move in a realistic way. Touching it in the lower right "corner" while the ball is in the air, means that the ball will move and spin to the left side of the screen. I hope I clarified the situation! I would be grateful if someone could help me to understand that kind of movement! Thanks guys and keep programming :)


P.S : I 've searched the forum for a similar situation but didn't find anything. So, I trust your programming knowledge ;)

irresistible force
Posts: 1991
Joined: Tue Jun 24, 2008 8:25 pm
Location: Tokyo
Contact:

Re: Hello fellow programmers! A question about a circle's an

Postby irresistible force » Thu Mar 28, 2013 9:34 pm

How are you moving the ball? If you use a mouse joint, I think it would naturally do what you're talking about.


Return to “iPhone”



Who is online

Users browsing this forum: No registered users and 1 guest